mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1083855 - part 4, Make CreateShadowRoot first call DestroyFramesFor, then setup the new shadow root, then CreateFramesFor. r=bz
This commit is contained in:
parent
de4092a0f1
commit
0a12728365
@ -963,6 +963,16 @@ Element::CreateShadowRoot(ErrorResult& aError)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIDocument* doc = GetCrossShadowCurrentDoc();
|
||||
nsIContent* destroyedFramesFor = nullptr;
|
||||
if (doc) {
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
if (shell) {
|
||||
shell->DestroyFramesFor(this, &destroyedFramesFor);
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(!GetPrimaryFrame());
|
||||
|
||||
// Unlike for XBL, false is the default for inheriting style.
|
||||
protoBinding->SetInheritsStyle(false);
|
||||
|
||||
@ -998,11 +1008,11 @@ Element::CreateShadowRoot(ErrorResult& aError)
|
||||
|
||||
// Recreate the frame for the bound content because binding a ShadowRoot
|
||||
// changes how things are rendered.
|
||||
nsIDocument* doc = GetCrossShadowCurrentDoc();
|
||||
if (doc) {
|
||||
nsIPresShell *shell = doc->GetShell();
|
||||
MOZ_ASSERT(doc == GetCrossShadowCurrentDoc());
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
if (shell) {
|
||||
shell->RecreateFramesFor(this);
|
||||
shell->CreateFramesFor(destroyedFramesFor);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user