Backed out changeset 236d827dc1c5 (bug 1491864) for crashing at builds/worker/workspace/build/src/layout/generic/nsIFrameInlines.h on a CLOSED TREE
authorCoroiu Cristina <ccoroiu@mozilla.com>
Thu, 20 Sep 2018 18:25:05 +0300
changeset 437453 40ade9ef77d00a003328bb3bc9853d74bd3567ea
parent 437452 e5781c87acb5468a9fd79e0d3c02748597fafcb6
child 437454 494efc7d8c29163ac544a584055329ce2d32d0b5
push id34683
push userapavel@mozilla.com
push dateThu, 20 Sep 2018 21:54:05 +0000
treeherdermozilla-central@4d3cd0ab7277 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1491864
milestone64.0a1
backs out236d827dc1c5a6a25afa6486f86e50ad2725fb26
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
Backed out changeset 236d827dc1c5 (bug 1491864) for crashing at builds/worker/workspace/build/src/layout/generic/nsIFrameInlines.h on a CLOSED TREE
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
layout/generic/nsIFrameInlines.h
layout/painting/nsDisplayList.cpp
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/css-transforms/preserve3d-button-ref.html
testing/web-platform/tests/css/css-transforms/preserve3d-button.html
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1599,17 +1599,17 @@ nsIFrame::Extend3DContext(const nsStyleD
          !GetClipPropClipRect(disp, effects, GetSize()) &&
          !nsSVGIntegrationUtils::UsingEffectsForFrame(this);
 }
 
 bool
 nsIFrame::Combines3DTransformWithAncestors(const nsStyleDisplay* aStyleDisplay) const
 {
   MOZ_ASSERT(aStyleDisplay == StyleDisplay());
-  nsIFrame* parent = GetClosestFlattenedTreeAncestorPrimaryFrame();
+  nsIFrame* parent = GetInFlowParent();
   if (!parent || !parent->Extend3DContext()) {
     return false;
   }
   return IsCSSTransformed(aStyleDisplay) ||
          BackfaceIsHidden(aStyleDisplay);
 }
 
 bool
@@ -2620,19 +2620,19 @@ CheckForApzAwareEventHandlers(nsDisplayL
 /**
  * True if aDescendant participates the context aAncestor participating.
  */
 static bool
 FrameParticipatesIn3DContext(nsIFrame* aAncestor, nsIFrame* aDescendant) {
   MOZ_ASSERT(aAncestor != aDescendant);
   MOZ_ASSERT(aAncestor->Extend3DContext());
   nsIFrame* frame;
-  for (frame = aDescendant->GetClosestFlattenedTreeAncestorPrimaryFrame();
+  for (frame = aDescendant->GetInFlowParent();
        frame && aAncestor != frame;
-       frame = frame->GetClosestFlattenedTreeAncestorPrimaryFrame()) {
+       frame = frame->GetInFlowParent()) {
     if (!frame->Extend3DContext()) {
       return false;
     }
   }
   MOZ_ASSERT(frame == aAncestor);
   return true;
 }
 
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -862,27 +862,24 @@ public:
   /**
    * Accessor functions for geometric parent.
    */
   nsContainerFrame* GetParent() const { return mParent; }
 
   /**
    * Gets the parent of a frame, using the parent of the placeholder for
    * out-of-flow frames.
+   *
+   * This is effectively the primary frame (or one of the continuations) of the
+   * closest flattened tree ancestor that has a frame (flattened tree ancestors
+   * may not have frames in presence of display: contents).
    */
   inline nsContainerFrame* GetInFlowParent() const;
 
   /**
-   * Gets the primary frame of the closest flattened tree ancestor that has a
-   * frame (flattened tree ancestors may not have frames in presence of display:
-   * contents).
-   */
-  inline nsIFrame* GetClosestFlattenedTreeAncestorPrimaryFrame() const;
-
-  /**
    * Return the placeholder for this frame (which must be out-of-flow).
    * @note this will only return non-null if |this| is the first-in-flow
    * although we don't assert that here for legacy reasons.
    */
   inline nsPlaceholderFrame* GetPlaceholderFrame() const {
     MOZ_ASSERT(HasAnyStateBits(NS_FRAME_OUT_OF_FLOW));
     return GetProperty(PlaceholderFrameProperty());
   }
--- a/layout/generic/nsIFrameInlines.h
+++ b/layout/generic/nsIFrameInlines.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsIFrameInlines_h___
 #define nsIFrameInlines_h___
 
-#include "mozilla/dom/ElementInlines.h"
 #include "nsContainerFrame.h"
 #include "nsPlaceholderFrame.h"
 #include "nsStyleStructInlines.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsFrameManager.h"
 
 bool
 nsIFrame::IsFlexItem() const
@@ -176,41 +175,9 @@ nsIFrame::GetInFlowParent() const
   if (GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
     nsIFrame* ph = FirstContinuation()->GetProperty(nsIFrame::PlaceholderFrameProperty());
     return ph->GetParent();
   }
 
   return GetParent();
 }
 
-// We generally want to follow the flattened DOM tree for preserve-3d, jumping
-// through display: contents.
-//
-// There are various fun mismatches between the flattened tree and the frame
-// tree which makes this non-trivial to do looking at the frame tree state:
-//
-//  - Anon boxes. You'd have to step through them, because you generally want to
-//    ignore them.
-//
-//  - IB-splits, which produce a frame tree where frames for the block inside
-//    the inline are not children of any frame from the inline.
-//
-//  - display: contents, which makes DOM ancestors not have frames even when a
-//    descendant does.
-//
-nsIFrame*
-nsIFrame::GetClosestFlattenedTreeAncestorPrimaryFrame() const
-{
-  if (!mContent) {
-    return nullptr;
-  }
-  Element* parent = mContent->GetFlattenedTreeParentElement();
-  while (parent) {
-    if (nsIFrame* frame = parent->GetPrimaryFrame()) {
-      return frame;
-    }
-    MOZ_ASSERT(parent->IsDisplayContents());
-    parent = parent->GetFlattenedTreeParentElement();
-  }
-  return nullptr;
-}
-
 #endif
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -8372,17 +8372,17 @@ nsDisplayTransform::GetResultingTransfor
     if (ComputePerspectiveMatrix(frame, aAppUnitsPerPixel, perspectiveMatrix)) {
       result *= perspectiveMatrix;
     }
   }
 
   if ((aFlags & INCLUDE_PRESERVE3D_ANCESTORS) && frame &&
       frame->Combines3DTransformWithAncestors()) {
     // Include the transform set on our parent
-    nsIFrame* parentFrame = frame->GetClosestFlattenedTreeAncestorPrimaryFrame();
+    nsIFrame* parentFrame = frame->GetInFlowParent();
     NS_ASSERTION(parentFrame && parentFrame->IsTransformed() &&
                    parentFrame->Extend3DContext(),
                  "Preserve3D mismatch!");
     FrameTransformProperties props(parentFrame, aAppUnitsPerPixel, nullptr);
 
     uint32_t flags =
       aFlags & (INCLUDE_PRESERVE3D_ANCESTORS | INCLUDE_PERSPECTIVE);
 
@@ -8651,17 +8651,17 @@ nsDisplayTransform::GetAccumulatedPreser
     if (!IsLeafOf3DContext()) {
       mTransformPreserves3D = GetTransform().GetMatrix();
       return mTransformPreserves3D;
     }
 
     const nsIFrame* establisher; // Establisher of the 3D rendering context.
     for (establisher = mFrame;
          establisher && establisher->Combines3DTransformWithAncestors();
-         establisher = establisher->GetClosestFlattenedTreeAncestorPrimaryFrame()) {
+         establisher = establisher->GetInFlowParent()) {
     }
     const nsIFrame* establisherReference = aBuilder->FindReferenceFrameFor(
       nsLayoutUtils::GetCrossDocParentFrame(establisher));
 
     nsPoint offset = establisher->GetOffsetToCrossDoc(establisherReference);
     float scale = mFrame->PresContext()->AppUnitsPerDevPixel();
     uint32_t flags =
       INCLUDE_PRESERVE3D_ANCESTORS | INCLUDE_PERSPECTIVE | OFFSET_BY_ORIGIN;
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -143180,28 +143180,16 @@
       [
        "/css/css-transforms/reference/perspective-reftest.html",
        "=="
       ]
      ],
      {}
     ]
    ],
-   "css/css-transforms/preserve3d-button.html": [
-    [
-     "/css/css-transforms/preserve3d-button.html",
-     [
-      [
-       "/css/css-transforms/preserve3d-button-ref.html",
-       "=="
-      ]
-     ],
-     {}
-    ]
-   ],
    "css/css-transforms/rotate/svg-rotate-3args-001.html": [
     [
      "/css/css-transforms/rotate/svg-rotate-3args-001.html",
      [
       [
        "/css/css-transforms/rotate/reference/svg-rotate-3args-ref.html",
        "=="
       ]
@@ -265209,21 +265197,16 @@
      {}
     ]
    ],
    "css/css-transforms/patternTransform/reference/svg-patternTransform-relative-ref.html": [
     [
      {}
     ]
    ],
-   "css/css-transforms/preserve3d-button-ref.html": [
-    [
-     {}
-    ]
-   ],
    "css/css-transforms/reference/backface-visibility-hidden-ref.html": [
     [
      {}
     ]
    ],
    "css/css-transforms/reference/css-scale-nested-ref.html": [
     [
      {}
@@ -561892,24 +561875,16 @@
   "css/css-transforms/perspective-translateZ-negative.html": [
    "2c7305e3b82d1067cb8c2ab75eab4b34095a525c",
    "reftest"
   ],
   "css/css-transforms/perspective-translateZ-positive.html": [
    "752888eaf76630ae9835dd444c4941793ecf53cc",
    "reftest"
   ],
-  "css/css-transforms/preserve3d-button-ref.html": [
-   "e5e3c1ebfcdd7c832a211d17ac2f1ed6f4116252",
-   "support"
-  ],
-  "css/css-transforms/preserve3d-button.html": [
-   "544bb2496638a52915f7c97a238ccb053b4e884e",
-   "reftest"
-  ],
   "css/css-transforms/reference/backface-visibility-hidden-ref.html": [
    "6a3e305e5c0c7fca6c8d53574b7a09eb21afb6cc",
    "support"
   ],
   "css/css-transforms/reference/css-scale-nested-ref.html": [
    "fe238e091bb9771622e1551b6660fd3b546ec47d",
    "support"
   ],
@@ -578421,17 +578396,17 @@
    "649f9485f44f800b7685d604ac31c88ce43e4d81",
    "testharness"
   ],
   "css/cssom/medialist-interfaces-004.html": [
    "cf9befb8ffb628f59508d5d74ec6ed4db9e4e09e",
    "testharness"
   ],
   "css/cssom/overflow-serialization.html": [
-   "136b8aba117eb64403700d8c4348db085cede9c8",
+   "2911c8da3e3ae47af4fd764170fd7439cda56685",
    "testharness"
   ],
   "css/cssom/preferred-stylesheet-order.html": [
    "dc990131ab39cd451b5cfced3464690c5ef1a802",
    "testharness"
   ],
   "css/cssom/preferred-stylesheet-reversed-order.html": [
    "ff3a8b09010cdb220fe5bf6661ae380a7fe2c267",
@@ -578813,17 +578788,17 @@
    "bba0c091a29d94615609d11eb23ce28bf8d57b87",
    "support"
   ],
   "css/filter-effects/fecolormatrix-type.html": [
    "8caaede02f27a120278d9d1512084e6fd57ab27f",
    "reftest"
   ],
   "css/filter-effects/filter-cb-abspos-inline-001-ref.html": [
-   "b4beae8004155c30dad4f48db3e2087f66c42c4f",
+   "6ebe4635511242cd0f5965a778a5a491cc406436",
    "support"
   ],
   "css/filter-effects/filter-cb-abspos-inline-001.html": [
    "6f99c48d5f34761ba1bc1ce7dbdfd927469ac65a",
    "reftest"
   ],
   "css/filter-effects/filter-cb-abspos-inline-002.html": [
    "6fcf8fea160f5661c97be6c6f45e5f3667badf51",
deleted file mode 100644
--- a/testing/web-platform/tests/css/css-transforms/preserve3d-button-ref.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!doctype html>
-<title>CSS Test Reference</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<style>
-.scene {
-  width: 200px;
-  height: 200px;
-  perspective: 5000px;
-}
-
-.card {
-  width: 100%;
-  height: 100%;
-  transform-style: preserve-3d;
-  position: relative;
-  background: none;
-  border: 0;
-  padding: 0;
-  transform: rotateY(180deg);
-}
-
-.face {
-  position: absolute;
-  top: 0;
-  width: 100%;
-  height: 100%;
-  backface-visibility: hidden;
-  background: red;
-}
-
-.backface {
-  background: green;
-  transform: rotateY(180deg);
-}
-</style>
-<div class="scene">
-  <div class="card">
-    <div class="face"></div>
-    <div class="face backface"></div>
-  </div>
-</div>
deleted file mode 100644
--- a/testing/web-platform/tests/css/css-transforms/preserve3d-button.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!doctype html>
-<title>CSS Test: preserve-3d on buttons</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="match" href="preserve3d-button-ref.html">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1491864">
-<style>
-.scene {
-  width: 200px;
-  height: 200px;
-  perspective: 5000px;
-}
-
-.card {
-  width: 100%;
-  height: 100%;
-  transform-style: preserve-3d;
-  position: relative;
-  background: none;
-  border: 0;
-  padding: 0;
-  transform: rotateY(180deg);
-}
-
-.face {
-  position: absolute;
-  top: 0;
-  width: 100%;
-  height: 100%;
-  backface-visibility: hidden;
-  background: red;
-}
-
-.backface {
-  background: green;
-  transform: rotateY(180deg);
-}
-</style>
-<div class="scene">
-  <button class="card">
-    <div class="face"></div>
-    <div class="face backface"></div>
-  </button>
-</div>