mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
Bug 1334346 - DocGroup should be correct for static clone documents (print, print preview) (r=smaug)
MozReview-Commit-ID: f0LdbxSahb
This commit is contained in:
parent
4640ca8852
commit
c8c4ea2401
@ -4527,6 +4527,7 @@ nsDocument::SetScopeObject(nsIGlobalObject* aGlobal)
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
MOZ_RELEASE_ASSERT(mDocGroup->MatchesKey(docGroupKey));
|
||||
}
|
||||
MOZ_RELEASE_ASSERT(mDocGroup->GetTabGroup() == tabgroup);
|
||||
} else {
|
||||
mDocGroup = tabgroup->AddDocument(docGroupKey, this);
|
||||
MOZ_ASSERT(mDocGroup);
|
||||
@ -9220,12 +9221,17 @@ nsDocument::CloneDocHelper(nsDocument* clone) const
|
||||
clone->mDocumentBaseURI = mDocumentBaseURI;
|
||||
clone->SetChromeXHRDocBaseURI(mChromeXHRDocBaseURI);
|
||||
|
||||
// Set scripting object
|
||||
bool hasHadScriptObject = true;
|
||||
nsIScriptGlobalObject* scriptObject =
|
||||
GetScriptHandlingObject(hasHadScriptObject);
|
||||
NS_ENSURE_STATE(scriptObject || !hasHadScriptObject);
|
||||
if (scriptObject) {
|
||||
if (mCreatingStaticClone) {
|
||||
// If we're doing a static clone (print, print preview), then we're going to
|
||||
// be setting a scope object after the clone. It's better to set it only
|
||||
// once, so we don't do that here. However, we do want to act as if there is
|
||||
// a script handling object. So we set mHasHadScriptHandlingObject.
|
||||
clone->mHasHadScriptHandlingObject = true;
|
||||
} else if (scriptObject) {
|
||||
clone->SetScriptHandlingObject(scriptObject);
|
||||
} else {
|
||||
clone->SetScopeObject(GetScopeObject());
|
||||
|
Loading…
Reference in New Issue
Block a user