Bug 1465502: Remove write-only NS_FRAME_MAY_HAVE_GENERATED_CONTENT. r?mats
It's write-only, and I'd love to use it for other purposes :)
MozReview-Commit-ID: KpXNp72TcDb
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3387,18 +3387,16 @@ nsCSSFrameConstructor::ConstructFieldSet
}
// Set the inner frame's initial child lists
contentFrame->SetInitialChildList(kPrincipalList, childItems);
// Set the outer frame's initial child list
fieldsetFrame->SetInitialChildList(kPrincipalList, fieldsetKids);
- fieldsetFrame->AddStateBits(NS_FRAME_MAY_HAVE_GENERATED_CONTENT);
-
// Our new frame returned is the outer frame, which is the fieldset frame.
return fieldsetFrame;
}
nsIFrame*
nsCSSFrameConstructor::ConstructDetailsFrame(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsContainerFrame* aParentFrame,
@@ -5739,20 +5737,16 @@ nsCSSFrameConstructor::AddFrameConstruct
// Pre-check for display "none" - if we find that, don't create
// any frame at all
if (display->mDisplay == StyleDisplay::None) {
return;
}
if (display->mDisplay == StyleDisplay::Contents) {
- if (aParentFrame) {
- // FIXME(emilio): Pretty sure aParentFrame can't be null here.
- aParentFrame->AddStateBits(NS_FRAME_MAY_HAVE_GENERATED_CONTENT);
- }
CreateGeneratedContentItem(aState, aParentFrame, aContent->AsElement(),
computedStyle, CSSPseudoElementType::before,
aItems);
FlattenedChildIterator iter(aContent);
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
if (!ShouldCreateItemsForChild(aState, child, aParentFrame)) {
continue;
@@ -10302,17 +10296,16 @@ nsCSSFrameConstructor::ProcessChildren(n
// :before/:after content should have the same style parent as normal kids.
//
// Note that we don't use this style for looking up things like special
// block styles because in some cases involving table pseudo-frames it has
// nothing to do with the parent frame's desired behavior.
ComputedStyle* computedStyle;
if (aCanHaveGeneratedContent) {
- aFrame->AddStateBits(NS_FRAME_MAY_HAVE_GENERATED_CONTENT);
computedStyle =
nsFrame::CorrectStyleParentFrame(aFrame, nullptr)->Style();
// Probe for generated content before
CreateGeneratedContentItem(aState, aFrame, aContent->AsElement(),
computedStyle, CSSPseudoElementType::before,
itemsToConstruct);
}
@@ -11368,19 +11361,16 @@ nsCSSFrameConstructor::ConstructInline(n
aDisplay->IsRelativelyPositionedStyle() &&
!nsSVGUtils::IsInSVGTextSubtree(aParentFrame);
nsInlineFrame* newFrame = NS_NewInlineFrame(mPresShell, computedStyle);
// Initialize the frame
InitAndRestoreFrame(aState, content, aParentFrame, newFrame);
- // Inline frames can always have generated content
- newFrame->AddStateBits(NS_FRAME_MAY_HAVE_GENERATED_CONTENT);
-
nsFrameConstructorSaveState absoluteSaveState; // definition cannot be inside next block
// because the object's destructor is significant
// this is part of the fix for bug 42372
newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
if (positioned) {
// Relatively positioned frames becomes a container for child
// frames that are positioned
@@ -11473,18 +11463,17 @@ nsCSSFrameConstructor::CreateIBSiblings(
SetFrameIsIBSplit(lastNewInline, blockFrame);
aSiblings.AddChild(blockFrame);
// Now grab the initial inlines in aChildItems and put them into an inline
// frame.
nsInlineFrame* inlineFrame = NS_NewInlineFrame(mPresShell, computedStyle);
InitAndRestoreFrame(aState, content, parentFrame, inlineFrame, false);
- inlineFrame->AddStateBits(NS_FRAME_MAY_HAVE_GENERATED_CONTENT |
- NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
+ inlineFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
if (aIsPositioned) {
inlineFrame->MarkAsAbsoluteContainingBlock();
}
if (aChildItems.NotEmpty()) {
nsFrameList::FrameLinkEnumerator firstBlock(aChildItems);
FindFirstBlock(firstBlock);
nsFrameList inlineKids = aChildItems.ExtractHead(firstBlock);
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -629,17 +629,16 @@ nsFrame::Init(nsIContent* aContent
// Make sure the general flags bits are the same
nsFrameState state = aPrevInFlow->GetStateBits();
// Make bits that are currently off (see constructor) the same:
AddStateBits(state & (NS_FRAME_INDEPENDENT_SELECTION |
NS_FRAME_PART_OF_IBSPLIT |
NS_FRAME_MAY_BE_TRANSFORMED |
- NS_FRAME_MAY_HAVE_GENERATED_CONTENT |
NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN));
} else {
PresContext()->ConstructedFrame();
}
if (GetParent()) {
nsFrameState state = GetParent()->GetStateBits();
// Make bits that are currently off (see constructor) the same:
--- a/layout/generic/nsFrameStateBits.h
+++ b/layout/generic/nsFrameStateBits.h
@@ -219,20 +219,18 @@ FRAME_STATE_BIT(Generic, 41, NS_FRAME_FO
// context?
FRAME_STATE_BIT(Generic, 42, NS_FRAME_FONT_INFLATION_FLOW_ROOT)
// This bit is set on SVG frames that are laid out using SVG's coordinate
// system based layout (as opposed to any of the CSS layout models). Note that
// this does not include nsSVGOuterSVGFrame since it takes part is CSS layout.
FRAME_STATE_BIT(Generic, 43, NS_FRAME_SVG_LAYOUT)
-// Is this frame allowed to have generated (::before/::after) content?
-FRAME_STATE_BIT(Generic, 44, NS_FRAME_MAY_HAVE_GENERATED_CONTENT)
-
-// Bit 45 is currently unused.
+// Bits 44 and 45 are currently unused, but be kind and check with bug 1465478
+// first please :-)
// This bit indicates that we're tracking visibility for this frame, and that
// the frame has a VisibilityStateProperty property.
FRAME_STATE_BIT(Generic, 46, NS_FRAME_VISIBILITY_IS_TRACKED)
// The frame is a descendant of SVGTextFrame and is thus used for SVG
// text layout.
FRAME_STATE_BIT(Generic, 47, NS_FRAME_IS_SVG_TEXT)
@@ -282,17 +280,17 @@ FRAME_STATE_BIT(Generic, 58, NS_FRAME_MA
// This state bit is set on frames within token MathML elements if the
// token represents an <mi> tag whose inner HTML consists of a single
// non-whitespace character to allow special rendering behaviour.
FRAME_STATE_BIT(Generic, 59, NS_FRAME_IS_IN_SINGLE_CHAR_MI)
// NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
// frame classes.
-// NOTE: Bit 45 is currently unused and available.
+// NOTE: Bits 44 and 45 are currently unused.
// == Frame state bits that apply to box frames ===============================
FRAME_STATE_GROUP(Box, nsBoxFrame)
FRAME_STATE_BIT(Box, 20, NS_STATE_BOX_CHILD_RESERVED)
FRAME_STATE_BIT(Box, 21, NS_STATE_STACK_NOT_POSITIONED)