Bug 1647525 - Use HasAnyStateBits() in nsIFrameInlines r=emilio draft
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Sat, 27 Jun 2020 13:53:14 +0000
changeset 3009963 294c1bfe0c089be14d9b35c61b20cf19e915c89b
parent 3009962 ab600dc27ecd4ec9c1cbe153ef8c83c9b40f1c01
child 3009964 cc49af0d7c9a3827011faf1d3d0b03a0c49ef256
push id561044
push userreviewbot
push dateSat, 27 Jun 2020 13:54:39 +0000
treeherdertry@5802acc724ed [default view] [failures only]
reviewersemilio
bugs1647525
milestone79.0a1
Bug 1647525 - Use HasAnyStateBits() in nsIFrameInlines r=emilio Summary: Differential Revision: https://phabricator.services.mozilla.com/D81204 Depends on D81203 Test Plan: Reviewers: emilio Subscribers: Bug #: 1647525 Differential Diff: PHID-DIFF-eswfdspqsjuh5ydnzvek
layout/generic/nsIFrameInlines.h
--- a/layout/generic/nsIFrameInlines.h
+++ b/layout/generic/nsIFrameInlines.h
@@ -15,30 +15,30 @@
 #include "nsFrameManager.h"
 
 bool nsIFrame::IsSVGGeometryFrameOrSubclass() const {
   return IsSVGGeometryFrame() || IsSVGImageFrame();
 }
 
 bool nsIFrame::IsFlexItem() const {
   return GetParent() && GetParent()->IsFlexContainerFrame() &&
-         !(GetStateBits() & NS_FRAME_OUT_OF_FLOW);
+         !HasAnyStateBits(NS_FRAME_OUT_OF_FLOW);
 }
 
 bool nsIFrame::IsGridItem() const {
   return GetParent() && GetParent()->IsGridContainerFrame() &&
-         !(GetStateBits() & NS_FRAME_OUT_OF_FLOW);
+         !HasAnyStateBits(NS_FRAME_OUT_OF_FLOW);
 }
 
 bool nsIFrame::IsFlexOrGridContainer() const {
   return IsFlexContainerFrame() || IsGridContainerFrame();
 }
 
 bool nsIFrame::IsFlexOrGridItem() const {
-  return !(GetStateBits() & NS_FRAME_OUT_OF_FLOW) && GetParent() &&
+  return !HasAnyStateBits(NS_FRAME_OUT_OF_FLOW) && GetParent() &&
          GetParent()->IsFlexOrGridContainer();
 }
 
 bool nsIFrame::IsMasonry(mozilla::LogicalAxis aAxis) const {
   MOZ_DIAGNOSTIC_ASSERT(IsGridContainerFrame());
   return HasAnyStateBits(aAxis == mozilla::eLogicalAxisBlock
                              ? NS_STATE_GRID_IS_ROW_MASONRY
                              : NS_STATE_GRID_IS_COL_MASONRY);
@@ -190,17 +190,17 @@ void nsIFrame::PropagateWritingModeToSel
     mozilla::WritingMode aWM) {
   MOZ_ASSERT(IsCanvasFrame());
   for (auto f = this; f; f = f->GetParent()) {
     f->mWritingMode = aWM;
   }
 }
 
 nsContainerFrame* nsIFrame::GetInFlowParent() const {
-  if (GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
+  if (HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
     nsIFrame* ph =
         FirstContinuation()->GetProperty(nsIFrame::PlaceholderFrameProperty());
     return ph->GetParent();
   }
 
   return GetParent();
 }