mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1647525 - Use HasAnyStateBits() in remaining layout files r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81230
This commit is contained in:
parent
3979f83c6e
commit
21f2b48e01
@ -7462,7 +7462,7 @@ bool nsCSSFrameConstructor::ContentRemoved(nsIContent* aChild,
|
||||
// wrapper frame.)
|
||||
nsIFrame* grandparentFrame = parentFrame->GetParent();
|
||||
if (grandparentFrame && grandparentFrame->IsXULBoxFrame() &&
|
||||
(grandparentFrame->HasAnyStateBits(NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK)) &&
|
||||
grandparentFrame->HasAnyStateBits(NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK) &&
|
||||
// check if this frame is the only one needing wrapping
|
||||
aChild == AnyKidsNeedBlockParent(
|
||||
parentFrame->PrincipalChildList().FirstChild()) &&
|
||||
|
@ -5007,7 +5007,7 @@ bool nsLayoutUtils::IsFirstContinuationOrIBSplitSibling(
|
||||
if (aFrame->GetPrevContinuation()) {
|
||||
return false;
|
||||
}
|
||||
if ((aFrame->HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT)) &&
|
||||
if (aFrame->HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT) &&
|
||||
aFrame->GetProperty(nsIFrame::IBSplitPrevSibling())) {
|
||||
return false;
|
||||
}
|
||||
|
@ -7548,7 +7548,7 @@ bool nsBlockFrame::BlockNeedsFloatManager(nsIFrame* aBlock) {
|
||||
NS_ASSERTION(aBlock->IsBlockFrameOrSubclass(), "aBlock must be a block");
|
||||
|
||||
nsIFrame* parent = aBlock->GetParent();
|
||||
return (aBlock->HasAnyStateBits(NS_BLOCK_FLOAT_MGR)) ||
|
||||
return aBlock->HasAnyStateBits(NS_BLOCK_FLOAT_MGR) ||
|
||||
(parent && !parent->IsFloatContainingBlock());
|
||||
}
|
||||
|
||||
|
@ -279,9 +279,10 @@ void nsBlockReflowContext::ReflowBlock(
|
||||
tI = space.LineLeft(mWritingMode, mContainerSize);
|
||||
tB = mBCoord;
|
||||
|
||||
if ((mFrame->GetStateBits() & NS_BLOCK_FLOAT_MGR) == 0)
|
||||
if (!mFrame->HasAnyStateBits(NS_BLOCK_FLOAT_MGR)) {
|
||||
aFrameRI.mBlockDelta =
|
||||
mOuterReflowInput.mBlockDelta + mBCoord - aLine->BStart();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -32,7 +32,7 @@ class nsFirstLetterFrame final : public nsContainerFrame {
|
||||
virtual nsresult GetFrameName(nsAString& aResult) const override;
|
||||
#endif
|
||||
|
||||
bool IsFloating() const { return GetStateBits() & NS_FRAME_OUT_OF_FLOW; }
|
||||
bool IsFloating() const { return HasAnyStateBits(NS_FRAME_OUT_OF_FLOW); }
|
||||
|
||||
virtual bool IsFrameOfType(uint32_t aFlags) const override {
|
||||
if (!IsFloating()) aFlags = aFlags & ~(nsIFrame::eLineParticipant);
|
||||
|
@ -1086,7 +1086,7 @@ void nsImageFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
}
|
||||
FinishAndStoreOverflow(&aMetrics, aReflowInput.mStyleDisplay);
|
||||
|
||||
if ((GetStateBits() & NS_FRAME_FIRST_REFLOW) && !mReflowCallbackPosted) {
|
||||
if (HasAnyStateBits(NS_FRAME_FIRST_REFLOW) && !mReflowCallbackPosted) {
|
||||
mReflowCallbackPosted = true;
|
||||
PresShell()->PostReflowCallback(this);
|
||||
}
|
||||
|
@ -876,7 +876,7 @@ void nsFloatCacheFreeList::DeleteAll() {
|
||||
}
|
||||
|
||||
nsFloatCache* nsFloatCacheFreeList::Alloc(nsIFrame* aFloat) {
|
||||
MOZ_ASSERT(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
|
||||
MOZ_ASSERT(aFloat->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW),
|
||||
"This is a float cache, why isn't the frame out-of-flow?");
|
||||
|
||||
nsFloatCache* fc = mHead;
|
||||
|
@ -31,7 +31,7 @@ void nsPageContentFrame::Reflow(nsPresContext* aPresContext,
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
|
||||
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
|
||||
|
||||
if (GetPrevInFlow() && (GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
if (GetPrevInFlow() && HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
|
||||
nsresult rv =
|
||||
aPresContext->PresShell()->FrameConstructor()->ReplicateFixedFrames(
|
||||
this);
|
||||
|
@ -153,7 +153,7 @@ void nsPageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Don't do incremental reflow until we've taught tables how to do
|
||||
// it right in paginated mode.
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
if (!HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
|
||||
// Return our desired size
|
||||
SetDesiredSize(aDesiredSize, aReflowInput, mSize.width, mSize.height);
|
||||
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
||||
|
@ -784,7 +784,7 @@ void nsPluginFrame::DidReflow(nsPresContext* aPresContext,
|
||||
const ReflowInput* aReflowInput) {
|
||||
// Do this check before calling the superclass, as that clears
|
||||
// NS_FRAME_FIRST_REFLOW
|
||||
if (GetStateBits() & NS_FRAME_FIRST_REFLOW) {
|
||||
if (HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
|
||||
nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(mContent));
|
||||
NS_ASSERTION(objContent, "Why not an object loading content?");
|
||||
objContent->HasNewFrame(this);
|
||||
|
@ -48,7 +48,7 @@ class nsRubyTextContainerFrame final : public nsContainerFrame {
|
||||
virtual void RemoveFrame(ChildListID aListID, nsIFrame* aOldFrame) override;
|
||||
|
||||
bool IsSpanContainer() const {
|
||||
return GetStateBits() & NS_RUBY_TEXT_CONTAINER_IS_SPAN;
|
||||
return HasAnyStateBits(NS_RUBY_TEXT_CONTAINER_IS_SPAN);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -42,7 +42,7 @@ class nsRubyTextFrame final : public nsRubyContentFrame {
|
||||
nsReflowStatus& aStatus) override;
|
||||
|
||||
bool IsAutoHidden() const {
|
||||
return GetStateBits() & NS_RUBY_TEXT_FRAME_AUTOHIDE;
|
||||
return HasAnyStateBits(NS_RUBY_TEXT_FRAME_AUTOHIDE);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -4030,7 +4030,7 @@ void PaintedLayerData::AccumulateHitTestItem(ContainerState* aState,
|
||||
}
|
||||
}
|
||||
|
||||
if (hasRoundedCorners || (frame->GetStateBits() & NS_FRAME_SVG_LAYOUT)) {
|
||||
if (hasRoundedCorners || frame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT)) {
|
||||
mMaybeHitRegion.OrWith(area);
|
||||
} else {
|
||||
mHitRegion.OrWith(area);
|
||||
|
@ -253,8 +253,7 @@ bool RetainedDisplayListBuilder::PreProcessDisplayList(
|
||||
bool keepLinked = aKeepLinked;
|
||||
nsIFrame* invalid = item->FrameForInvalidation();
|
||||
if (!invalid->ForceDescendIntoIfVisible() &&
|
||||
!(invalid->GetStateBits() &
|
||||
NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) {
|
||||
!invalid->HasAnyStateBits(NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO)) {
|
||||
keepLinked = true;
|
||||
}
|
||||
|
||||
|
@ -2096,7 +2096,7 @@ nscoord nsComputedDOMStyle::GetUsedAbsoluteOffset(mozilla::Side aSide) {
|
||||
containerRect.SizeTo(
|
||||
viewportFrame->AdjustViewportSizeForFixedPosition(containerRect));
|
||||
} else if (container->IsGridContainerFrame() &&
|
||||
(mOuterFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW))) {
|
||||
mOuterFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
|
||||
containerRect = nsGridContainerFrame::GridItemCB(mOuterFrame);
|
||||
rect.MoveBy(-containerRect.x, -containerRect.y);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ void TransformReferenceBox::EnsureDimensionsAreCached() {
|
||||
|
||||
mIsCached = true;
|
||||
|
||||
if (mFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
|
||||
if (mFrame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT)) {
|
||||
if (!StaticPrefs::svg_transform_box_enabled()) {
|
||||
mX = -mFrame->GetPosition().x;
|
||||
mY = -mFrame->GetPosition().y;
|
||||
|
@ -163,7 +163,7 @@ nsresult SVGViewportFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
nsAtom* aAttribute,
|
||||
int32_t aModType) {
|
||||
if (aNameSpaceID == kNameSpaceID_None &&
|
||||
!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
!HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
|
||||
SVGViewportElement* content =
|
||||
static_cast<SVGViewportElement*>(GetContent());
|
||||
|
||||
|
@ -407,8 +407,8 @@ nsRegion nsFilterInstance::GetPreFilterNeededArea(
|
||||
nsRect nsFilterInstance::GetPostFilterBounds(nsIFrame* aFilteredFrame,
|
||||
const gfxRect* aOverrideBBox,
|
||||
const nsRect* aPreFilterBounds) {
|
||||
MOZ_ASSERT(!(aFilteredFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) ||
|
||||
!(aFilteredFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
MOZ_ASSERT(!aFilteredFrame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT) ||
|
||||
!aFilteredFrame->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY),
|
||||
"Non-display SVG do not maintain visual overflow rects");
|
||||
|
||||
nsRegion preFilterRegion;
|
||||
|
@ -352,8 +352,7 @@ already_AddRefed<SourceSurface> nsSVGPatternFrame::PaintPattern(
|
||||
|
||||
// Delay checking NS_FRAME_DRAWING_AS_PAINTSERVER bit until here so we can
|
||||
// give back a clear surface if there's a loop
|
||||
if (!(patternWithChildren->GetStateBits() &
|
||||
NS_FRAME_DRAWING_AS_PAINTSERVER)) {
|
||||
if (!patternWithChildren->HasAnyStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER)) {
|
||||
AutoSetRestorePaintServerState paintServer(patternWithChildren);
|
||||
for (nsIFrame* kid = firstKid; kid; kid = kid->GetNextSibling()) {
|
||||
gfxMatrix tm = *(patternWithChildren->mCTM);
|
||||
|
@ -803,7 +803,7 @@ void nsImageBoxFrame::OnSizeAvailable(imgIRequest* aRequest,
|
||||
mIntrinsicSize.SizeTo(nsPresContext::CSSPixelsToAppUnits(w),
|
||||
nsPresContext::CSSPixelsToAppUnits(h));
|
||||
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
if (!HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
|
||||
PresShell()->FrameNeedsReflow(this, IntrinsicDirty::StyleChange,
|
||||
NS_FRAME_IS_DIRTY);
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ void nsLeafBoxFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
nsIFrame* aPrevInFlow) {
|
||||
nsLeafFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
|
||||
if (GetStateBits() & NS_FRAME_FONT_INFLATION_CONTAINER) {
|
||||
if (HasAnyStateBits(NS_FRAME_FONT_INFLATION_CONTAINER)) {
|
||||
AddStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT);
|
||||
}
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ class nsMenuFrame final : public nsBoxFrame, public nsIReflowCallback {
|
||||
* @return true if this frame has a popup child frame.
|
||||
*/
|
||||
bool HasPopup() const {
|
||||
return (GetStateBits() & NS_STATE_MENU_HAS_POPUP_LIST) != 0;
|
||||
return HasAnyStateBits(NS_STATE_MENU_HAS_POPUP_LIST);
|
||||
}
|
||||
|
||||
// nsMenuFrame methods
|
||||
|
@ -1372,8 +1372,7 @@ nsSize nsSliderFrame::GetXULMaxSize(nsBoxLayoutState& aState) {
|
||||
void nsSliderFrame::EnsureOrient() {
|
||||
nsIFrame* scrollbarBox = GetScrollbar();
|
||||
|
||||
bool isHorizontal =
|
||||
(scrollbarBox->GetStateBits() & NS_STATE_IS_HORIZONTAL) != 0;
|
||||
bool isHorizontal = scrollbarBox->HasAnyStateBits(NS_STATE_IS_HORIZONTAL);
|
||||
if (isHorizontal)
|
||||
AddStateBits(NS_STATE_IS_HORIZONTAL);
|
||||
else
|
||||
|
@ -42,7 +42,7 @@ void nsSprocketLayout::Shutdown() { NS_IF_RELEASE(gInstance); }
|
||||
nsSprocketLayout::nsSprocketLayout() = default;
|
||||
|
||||
bool nsSprocketLayout::IsXULHorizontal(nsIFrame* aBox) {
|
||||
return (aBox->GetStateBits() & NS_STATE_IS_HORIZONTAL) != 0;
|
||||
return aBox->HasAnyStateBits(NS_STATE_IS_HORIZONTAL);
|
||||
}
|
||||
|
||||
void nsSprocketLayout::GetFrameState(nsIFrame* aBox, nsFrameState& aState) {
|
||||
|
@ -160,8 +160,9 @@ uint8_t nsStackLayout::GetOffset(nsIFrame* aChild, nsMargin& aOffset) {
|
||||
// As an optimization, we cache the fact that we are not positioned to avoid
|
||||
// wasting time fetching attributes.
|
||||
if (aChild->IsXULBoxFrame() &&
|
||||
(aChild->GetStateBits() & NS_STATE_STACK_NOT_POSITIONED))
|
||||
aChild->HasAnyStateBits(NS_STATE_STACK_NOT_POSITIONED)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t offsetSpecified = 0;
|
||||
nsIContent* content = aChild->GetContent();
|
||||
|
Loading…
Reference in New Issue
Block a user