зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1083855 - part 4, Make CreateShadowRoot first call DestroyFramesFor, then setup the new shadow root, then CreateFramesFor. r=bz
This commit is contained in:
Родитель
3be9dbfbb8
Коммит
1213cd6fa5
|
@ -963,6 +963,16 @@ Element::CreateShadowRoot(ErrorResult& aError)
|
||||||
return nullptr;
|
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.
|
// Unlike for XBL, false is the default for inheriting style.
|
||||||
protoBinding->SetInheritsStyle(false);
|
protoBinding->SetInheritsStyle(false);
|
||||||
|
|
||||||
|
@ -998,11 +1008,11 @@ Element::CreateShadowRoot(ErrorResult& aError)
|
||||||
|
|
||||||
// Recreate the frame for the bound content because binding a ShadowRoot
|
// Recreate the frame for the bound content because binding a ShadowRoot
|
||||||
// changes how things are rendered.
|
// changes how things are rendered.
|
||||||
nsIDocument* doc = GetCrossShadowCurrentDoc();
|
|
||||||
if (doc) {
|
if (doc) {
|
||||||
nsIPresShell *shell = doc->GetShell();
|
MOZ_ASSERT(doc == GetCrossShadowCurrentDoc());
|
||||||
|
nsIPresShell* shell = doc->GetShell();
|
||||||
if (shell) {
|
if (shell) {
|
||||||
shell->RecreateFramesFor(this);
|
shell->CreateFramesFor(destroyedFramesFor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче