Issue #2112 - Part 6: Remove IsStyledByServo function and callers

This commit is contained in:
FranklinDM 2024-03-25 02:09:12 +08:00 committed by roytam1
commit 10bf8705d0
13 changed files with 16 additions and 181 deletions

View file

@ -2442,7 +2442,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
// this document. Unlike in AddFrameConstructionItems, it's safe to
// unset all element restyle flags, since we don't have any
// siblings.
aDocElement->UnsetRestyleFlagsIfGecko();
aDocElement->UnsetRestyleFlags();
// --------- CREATE AREA OR BOX FRAME -------
// FIXME: Should this use ResolveStyleContext? (The calls in this
@ -5585,7 +5585,7 @@ nsCSSFrameConstructor::ShouldCreateItemsForChild(nsFrameConstructorState& aState
nsContainerFrame* aParentFrame)
{
aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
if (aContent->IsElement() && !aContent->IsStyledByServo()) {
if (aContent->IsElement()) {
// We can't just remove our pending restyle flags, since we may
// have restyle-later-siblings set on us. But we _can_ remove the
// "is possible restyle root" flags, and need to. Otherwise we can
@ -10504,14 +10504,13 @@ nsCSSFrameConstructor::AddFCItemsForAnonymousContent(
{
for (uint32_t i = 0; i < aAnonymousItems.Length(); ++i) {
nsIContent* content = aAnonymousItems[i].mContent;
// Gecko-styled nodes should have no pending restyle flags.
MOZ_ASSERT_IF(!content->IsStyledByServo(),
!content->IsElement() ||
!(content->GetFlags() & ELEMENT_ALL_RESTYLE_FLAGS));
// Assert some things about this content
MOZ_ASSERT(!(content->GetFlags() &
(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME)),
"Should not be marked as needing frames");
MOZ_ASSERT(!content->IsElement() ||
!(content->GetFlags() & ELEMENT_ALL_RESTYLE_FLAGS),
"Should have no pending restyle flags");
MOZ_ASSERT(!content->GetPrimaryFrame(),
"Should have no existing frame");
MOZ_ASSERT(!content->IsNodeOfType(nsINode::eCOMMENT) &&
@ -10753,7 +10752,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
// Frame construction item construction should not post
// restyles, so removing restyle flags here is safe.
child->UnsetRestyleFlagsIfGecko();
child->UnsetRestyleFlags();
if (addChildItems) {
AddFrameConstructionItems(aState, child, iter.XBLInvolved(), insertion,
itemsToConstruct);
@ -11917,7 +11916,7 @@ nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState,
// restyle root" flags in AddFrameConstructionItems. But note
// that we can remove all restyle flags, just like in
// ProcessChildren and for the same reason.
content->UnsetRestyleFlagsIfGecko();
content->UnsetRestyleFlags();
RefPtr<nsStyleContext> childContext =
ResolveStyleContext(parentStyleContext, content, &aState);