Bug 678465 - 'document-element-inserted' doesn't fire on ImageDocument; r=bz
This commit is contained in:
@@ -363,7 +363,7 @@ ImageDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject)
|
||||
|
||||
// Set the script global object on the superclass before doing
|
||||
// anything that might require it....
|
||||
nsHTMLDocument::SetScriptGlobalObject(aScriptGlobalObject);
|
||||
MediaDocument::SetScriptGlobalObject(aScriptGlobalObject);
|
||||
|
||||
if (aScriptGlobalObject) {
|
||||
if (!GetRootElement()) {
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "nsIParser.h" // kCharsetFrom* macro definition
|
||||
#include "nsIDocumentCharsetInfo.h"
|
||||
#include "nsNodeInfoManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@@ -130,6 +131,7 @@ const char* const MediaDocument::sFormatNames[4] =
|
||||
};
|
||||
|
||||
MediaDocument::MediaDocument()
|
||||
: mDocumentElementInserted(false)
|
||||
{
|
||||
}
|
||||
MediaDocument::~MediaDocument()
|
||||
@@ -433,5 +435,16 @@ MediaDocument::UpdateTitleAndCharset(const nsACString& aTypeStr,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MediaDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject)
|
||||
{
|
||||
nsHTMLDocument::SetScriptGlobalObject(aGlobalObject);
|
||||
if (!mDocumentElementInserted && aGlobalObject) {
|
||||
mDocumentElementInserted = true;
|
||||
nsContentUtils::AddScriptRunner(
|
||||
new nsDocElementCreatedNotificationRunner(this));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
@@ -64,6 +64,8 @@ public:
|
||||
bool aReset = true,
|
||||
nsIContentSink* aSink = nsnull);
|
||||
|
||||
virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject);
|
||||
|
||||
protected:
|
||||
virtual nsresult CreateSyntheticDocument();
|
||||
|
||||
@@ -93,9 +95,10 @@ protected:
|
||||
|
||||
nsCOMPtr<nsIStringBundle> mStringBundle;
|
||||
static const char* const sFormatNames[4];
|
||||
|
||||
|
||||
private:
|
||||
enum {eWithNoInfo, eWithFile, eWithDim, eWithDimAndFile};
|
||||
bool mDocumentElementInserted;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user