mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 11:45:37 +00:00
Bug 837315 - Add SVG document loaded event. r=bz
This commit is contained in:
parent
792423680f
commit
9e1cc718d6
@ -7541,15 +7541,30 @@ nsDocument::UnblockOnload(bool aFireSync)
|
|||||||
|
|
||||||
--mOnloadBlockCount;
|
--mOnloadBlockCount;
|
||||||
|
|
||||||
// If mScriptGlobalObject is null, we shouldn't be messing with the loadgroup
|
if (mOnloadBlockCount == 0) {
|
||||||
// -- it's not ours.
|
if (mScriptGlobalObject) {
|
||||||
if (mOnloadBlockCount == 0 && mScriptGlobalObject) {
|
// Only manipulate the loadgroup in this case, because if mScriptGlobalObject
|
||||||
if (aFireSync && mAsyncOnloadBlockCount == 0) {
|
// is null, it's not ours.
|
||||||
// Increment mOnloadBlockCount, since DoUnblockOnload will decrement it
|
if (aFireSync && mAsyncOnloadBlockCount == 0) {
|
||||||
++mOnloadBlockCount;
|
// Increment mOnloadBlockCount, since DoUnblockOnload will decrement it
|
||||||
DoUnblockOnload();
|
++mOnloadBlockCount;
|
||||||
} else {
|
DoUnblockOnload();
|
||||||
PostUnblockOnloadEvent();
|
} else {
|
||||||
|
PostUnblockOnloadEvent();
|
||||||
|
}
|
||||||
|
} else if (mIsBeingUsedAsImage) {
|
||||||
|
// To correctly unblock onload for a document that contains an SVG
|
||||||
|
// image, we need to know when all of the SVG document's resources are
|
||||||
|
// done loading, in a way comparable to |window.onload|. We fire this
|
||||||
|
// event to indicate that the SVG should be considered fully loaded.
|
||||||
|
// Because scripting is disabled on SVG-as-image documents, this event
|
||||||
|
// is not accessible to content authors. (See bug 837135.)
|
||||||
|
nsRefPtr<nsAsyncDOMEvent> e =
|
||||||
|
new nsAsyncDOMEvent(this,
|
||||||
|
NS_LITERAL_STRING("MozSVGAsImageDocumentLoad"),
|
||||||
|
false,
|
||||||
|
false);
|
||||||
|
e->PostDOMEvent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user