bug 1369015 - Remove a useless do_QueryFrame() call. r=jfkthame
authorMats Palmgren <mats@mozilla.com>
Wed, 31 May 2017 21:29:49 +0200
changeset 361678 bd52d785f0d482d6a106b5d5603c3c334a521b2e
parent 361677 45409ba9a985de2d6572055f5d6f552dff74f4f6
child 361679 62c2ff7599a301ec3e3cfee0e16325ab2afa0eea
push id43854
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 00:50:28 +0000
treeherderautoland@5ecd65c9136b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1369015
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1369015 - Remove a useless do_QueryFrame() call. r=jfkthame GetParent() already returns a nsContainerFrame* so there's no need to do_QueryFrame that to a nsContainerFrame* ! MozReview-Commit-ID: B8CwGkUWIoT
layout/generic/nsAbsoluteContainingBlock.cpp
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -374,26 +374,23 @@ nsAbsoluteContainingBlock::DoMarkFramesD
       kidFrame->AddStateBits(NS_FRAME_IS_DIRTY);
     } else if (FrameDependsOnContainer(kidFrame, true, true)) {
       // Add the weakest flags that will make sure we reflow this frame later
       kidFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
     }
   }
 }
 
-// Given an out-of-flow frame, this method returns the parent frame of
-// its placeholder frame, if that parent is a nsContainerFrame.
+// Given an out-of-flow frame, this method returns the parent frame of its
+// placeholder frame or null if it doesn't have a placeholder for some reason.
 static nsContainerFrame*
 GetPlaceholderContainer(nsIFrame* aPositionedFrame)
 {
   nsIFrame* placeholder = aPositionedFrame->GetPlaceholderFrame();
-  if (!placeholder) {
-    return nullptr;
-  }
-  return do_QueryFrame(placeholder->GetParent());
+  return placeholder ? placeholder->GetParent() : nullptr;
 }
 
 /**
  * This function returns the offset of an abs/fixed-pos child's static
  * position, with respect to the "start" corner of its alignment container,
  * according to CSS Box Alignment.  This function only operates in a single
  * axis at a time -- callers can choose which axis via the |aAbsPosCBAxis|
  * parameter.