Bug 1405319 part 1 - Don't try to optimize re-positioning of Flexbox/Grid abs.pos. children since they are affected by CSS Align positioning too. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Thu, 09 Nov 2017 03:00:47 +0100
changeset 390877 d441a4991106f20aa328c9299a3e63d3bfa7d8c3
parent 390876 f44464a40e7d4f5f88998b7915051283e4768ddd
child 390878 64d402a152c1ac57fd3100b4500187386363ae2b
push id32849
push userarchaeopteryx@coole-files.de
push dateThu, 09 Nov 2017 09:53:32 +0000
treeherdermozilla-central@d16b52f5d195 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1405319
milestone58.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 1405319 part 1 - Don't try to optimize re-positioning of Flexbox/Grid abs.pos. children since they are affected by CSS Align positioning too. r=dholbert MozReview-Commit-ID: 2KNfvNVCeIN
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -723,16 +723,26 @@ RecomputePosition(nsIFrame* aFrame)
   // have a view somewhere in their descendants, because the corresponding view
   // needs to be repositioned properly as well.
   if (aFrame->HasView() ||
       (aFrame->GetStateBits() & NS_FRAME_HAS_CHILD_WITH_VIEW)) {
     StyleChangeReflow(aFrame, nsChangeHint_NeedReflow);
     return false;
   }
 
+  // Flexbox and Grid layout supports CSS Align and the optimizations below
+  // don't support that yet.
+  if (aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
+    nsIFrame* ph = aFrame->GetPlaceholderFrame();
+    if (ph && ph->HasAnyStateBits(PLACEHOLDER_STATICPOS_NEEDS_CSSALIGN)) {
+      StyleChangeReflow(aFrame, nsChangeHint_NeedReflow);
+      return false;
+    }
+  }
+
   aFrame->SchedulePaint();
 
   // For relative positioning, we can simply update the frame rect
   if (display->IsRelativelyPositionedStyle()) {
     // Move the frame
     if (display->mPosition == NS_STYLE_POSITION_STICKY) {
       if (display->IsInnerTableStyle()) {
         // We don't currently support sticky positioning of inner table