Issue #1375 - Follow-up: Remove shadow tree hacks in the frame constructor

This should've been removed alongside bug 1404789 when it landed.
This commit is contained in:
FranklinDM 2023-02-27 12:14:49 +08:00 committed by roytam1
commit 6a26ce3455

View file

@ -7255,21 +7255,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
#endif // MOZ_XUL
if (aContainer && aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
!aFirstNewContent->IsInNativeAnonymousSubtree()) {
// Recreate frames if content is appended into a ShadowRoot
// because children of ShadowRoot are rendered in place of children
// of the host.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
LAYOUT_PHASE_TEMP_EXIT();
RecreateFramesForContent(bindingParent, InsertionKind::Sync,
REMOVE_FOR_RECONSTRUCTION);
LAYOUT_PHASE_TEMP_REENTER();
return;
}
// See comment in ContentRangeInserted for why this is necessary.
if (!GetContentInsertionFrameFor(aContainer) &&
!aContainer->IsActiveChildrenElement()) {
@ -7735,22 +7720,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
return;
}
if (aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
(!aStartChild || !aStartChild->IsInNativeAnonymousSubtree()) &&
(!aEndChild || !aEndChild->IsInNativeAnonymousSubtree())) {
// Recreate frames if content is inserted into a ShadowRoot
// because children of ShadowRoot are rendered in place of
// the children of the host.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
LAYOUT_PHASE_TEMP_EXIT();
RecreateFramesForContent(bindingParent, InsertionKind::Sync,
REMOVE_FOR_RECONSTRUCTION);
LAYOUT_PHASE_TEMP_REENTER();
return;
}
// Put 'parentFrame' inside a scope so we don't confuse it with
// 'insertion.mParentFrame' later.
{
@ -8238,21 +8207,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
}
}
if (aContainer && aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
!aChild->IsInNativeAnonymousSubtree()) {
// Recreate frames if content is removed from a ShadowRoot
// because it may contain an insertion point which can change
// how the host is rendered.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
RecreateFramesForContent(bindingParent, insertionKind, aFlags);
LAYOUT_PHASE_TEMP_REENTER();
return;
}
if (aFlags == REMOVE_DESTROY_FRAMES) {
CaptureStateForFramesOf(aChild, mTempFrameTreeState);
}