Backed out 2 changesets (bug 1506687) for causing mochitest mass failures. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Sat, 17 Nov 2018 05:05:53 +0200
changeset 446884 b3ca607f2595dba7b94124868581c62a9fce668d
parent 446883 22e8321b69f180a1d74975fd8f162326a49d0efe
child 446885 e3f7bc3a94a158807643cdc0b3253e469e529f0f
push id35052
push userapavel@mozilla.com
push dateSat, 17 Nov 2018 11:25:40 +0000
treeherdermozilla-central@efc1da42132b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1506687
milestone65.0a1
backs outf93f179fb3b46ea0b3612c21db6cf0a044c03ec0
d8230f3fdd2c3ecea4771ebe98c83be6e3ebcbfc
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 2 changesets (bug 1506687) for causing mochitest mass failures. CLOSED TREE Backed out changeset f93f179fb3b4 (bug 1506687) Backed out changeset d8230f3fdd2c (bug 1506687)
dom/chrome-webidl/Flex.webidl
dom/flex/FlexItemValues.cpp
dom/flex/FlexItemValues.h
dom/flex/test/chrome.ini
dom/flex/test/chrome/test_flex_item_rect.html
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFlexContainerFrame.h
--- a/dom/chrome-webidl/Flex.webidl
+++ b/dom/chrome-webidl/Flex.webidl
@@ -78,17 +78,16 @@ interface FlexLineValues
 enum FlexItemClampState {
   "unclamped", "clamped_to_min", "clamped_to_max"
 };
 
 [ChromeOnly]
 interface FlexItemValues
 {
   readonly attribute Node? node;
-  readonly attribute DOMRectReadOnly frameRect;
   readonly attribute double mainBaseSize;
   readonly attribute double mainDeltaSize;
   readonly attribute double mainMinSize;
   readonly attribute double mainMaxSize;
   readonly attribute double crossMinSize;
   readonly attribute double crossMaxSize;
   readonly attribute FlexItemClampState clampState;
 };
--- a/dom/flex/FlexItemValues.cpp
+++ b/dom/flex/FlexItemValues.cpp
@@ -7,18 +7,17 @@
 #include "FlexItemValues.h"
 
 #include "mozilla/dom/FlexBinding.h"
 #include "nsFlexContainerFrame.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexItemValues, mParent, mNode,
-                                      mFrameRect)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexItemValues, mParent)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexItemValues)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexItemValues)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexItemValues)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 /**
@@ -45,24 +44,16 @@ FlexItemValues::FlexItemValues(FlexLineV
 {
   MOZ_ASSERT(aItem,
     "Should never be instantiated with a null ComputedFlexLineInfo.");
 
   // Eagerly copy values from aItem, because we're not
   // going to keep it around.
   mNode = aItem->mNode;
 
-  // Since mNode might be null, we associate the mFrameRect with
-  // our parent.
-  mFrameRect = new DOMRectReadOnly(mParent,
-    nsPresContext::AppUnitsToDoubleCSSPixels(aItem->mFrameRect.X()),
-    nsPresContext::AppUnitsToDoubleCSSPixels(aItem->mFrameRect.Y()),
-    nsPresContext::AppUnitsToDoubleCSSPixels(aItem->mFrameRect.Width()),
-    nsPresContext::AppUnitsToDoubleCSSPixels(aItem->mFrameRect.Height()));
-
   // Convert app unit sizes to css pixel sizes.
   mMainBaseSize = nsPresContext::AppUnitsToDoubleCSSPixels(
     aItem->mMainBaseSize);
   mMainDeltaSize = nsPresContext::AppUnitsToDoubleCSSPixels(
     aItem->mMainDeltaSize);
   mMainMinSize = nsPresContext::AppUnitsToDoubleCSSPixels(
     aItem->mMainMinSize);
   mMainMaxSize = ToPossiblyUnconstrainedPixels(aItem->mMainMaxSize);
@@ -80,22 +71,16 @@ FlexItemValues::WrapObject(JSContext* aC
 }
 
 nsINode*
 FlexItemValues::GetNode() const
 {
   return mNode;
 }
 
-DOMRectReadOnly*
-FlexItemValues::FrameRect() const
-{
-  return mFrameRect;
-}
-
 double
 FlexItemValues::MainBaseSize() const
 {
   return mMainBaseSize;
 }
 
 double
 FlexItemValues::MainDeltaSize() const
--- a/dom/flex/FlexItemValues.h
+++ b/dom/flex/FlexItemValues.h
@@ -34,29 +34,27 @@ public:
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
   FlexLineValues* GetParentObject()
   {
     return mParent;
   }
 
   nsINode* GetNode() const;
-  DOMRectReadOnly* FrameRect() const;
   double MainBaseSize() const;
   double MainDeltaSize() const;
   double MainMinSize() const;
   double MainMaxSize() const;
   double CrossMinSize() const;
   double CrossMaxSize() const;
   FlexItemClampState ClampState() const;
 
 protected:
   RefPtr<FlexLineValues> mParent;
   RefPtr<nsINode> mNode;
-  RefPtr<DOMRectReadOnly> mFrameRect;
 
   // These sizes are all CSS pixel units.
   double mMainBaseSize;
   double mMainDeltaSize;
   double mMainMinSize;
   double mMainMaxSize;
   double mCrossMinSize;
   double mCrossMaxSize;
--- a/dom/flex/test/chrome.ini
+++ b/dom/flex/test/chrome.ini
@@ -1,5 +1,4 @@
 [chrome/test_flex_axis_directions.html]
+[chrome/test_flex_items.html]
 [chrome/test_flex_item_clamp.html]
-[chrome/test_flex_item_rect.html]
-[chrome/test_flex_items.html]
 [chrome/test_flex_lines.html]
deleted file mode 100644
--- a/dom/flex/test/chrome/test_flex_item_rect.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<meta charset="utf-8">
-<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-<style>
-f {
-  display: flex;
-  background-color: grey;
-  width: 400px;
-  height: 25px;
-  margin-bottom: 5px;
-}
-
-f > * {
-  width: 100px;
-  height: 10px;
-}
-
-b {
-  background-color: gold;
-}
-
-c {
-  background-color: yellow;
-}
-</style>
-
-<script>
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-function testItemMatchesExpectedValues(item, values, index) {
-  is(item.frameRect.x, values.x,
-     "Item index " + index + " should have expected frameRect.x.");
-  is(item.frameRect.y, values.y,
-     "Item index " + index + " should have expected frameRect.y.");
-  if (typeof(values.width) != "undefined") {
-    is(item.frameRect.width, values.width,
-       "Item index " + index + " should have expected frameRect.width.");
-  }
-  is(item.frameRect.height, values.height,
-     "Item index " + index + " should have expected frameRect.height.");
-}
-
-function runTests() {
-  /**
-   * The expectedValues array contains one rect for each flex container child of
-   * of the body. The values in this object are compared against the returned flex
-   * API values of the LAST flex item in the first line of the corresponding flex
-   * container.
-   **/
-  const expectedValues = [
-    { x:0, y:0, width:100, height:10 },
-    { x:0, y:0, width:undefined /* not tested */, height:25 /* stretched to container */ },
-    { x:0, y:0, width:100, height:10 },
-    { x:0, y:0, width:100, height:10 },
-    { x:100, y:0, width:100, height:10 },
-    { x:10, y:10, width:100, height:10 },
-    { x:10, y:10, width:100, height:10 },
-    { x:0, y:0, width:200, height:20 },
-    { x:0, y:0, width:400, height:25 },
-    { x:0, y:0, width:100, height:10 },
-    { x:0, y:0, width:100, height:10 },
-  ];
-
-  let children = document.body.children;
-  is(children.length, expectedValues.length, "Document should have expected number of flex containers.");
-
-  for (let i = 0; i < children.length; ++i) {
-    const flex = children.item(i).getAsFlexContainer();
-    ok(flex, "Document child index " + i + " should be a flex container.");
-    if (flex) {
-      const values = expectedValues[i];
-      const firstLine = flex.getLines()[0];
-      const items = firstLine.getItems();
-      const lastItem = items[items.length - 1];
-      testItemMatchesExpectedValues(lastItem, values, i);
-    }
-  }
-
-  SimpleTest.finish();
-}
-</script>
-</head>
-
-<body onLoad="runTests();">
-  <!-- a single item -->
-  <f><b></b></f>
-
-  <!-- an anonymous box item around a text node -->
-  <f style="font-size: 10px">anonymous</f>
-
-  <!-- a table item -->
-  <f><table></table></f>
-
-  <!-- a display:table-cell item -->
-  <f><b style="display: table-cell"></b></f>
-
-  <!-- an item after a fixed size item -->
-  <f><b></b><c></c></f>
-
-  <!-- a relatively-positioned item -->
-  <f><b style="position: relative; top: 10px; left: 10px"></b></f>
-
-  <!-- a margin-adjusted item -->
-  <f><b style="margin-top: 10px; margin-left: 10px"></b></f>
-
-  <!-- an item sized with inline styles -->
-  <f><b style="width: 200px; height: 20px"></b></f>
-
-  <!-- an item that is flexed/stretched, in both axes -->
-  <f style="align-items: stretch"><b style="flex-grow: 1; height: auto"></b></f>
-
-  <!-- These stylings should have no effect on the frameRect. -->
-  <!-- a transform:scale item -->
-  <f><b style="transform: scale(2.0)"></b></f>
-
-  <!-- a transform:translate item -->
-  <f><b style="transform: translate(10px, 10px)"></b></f>
-</body>
-</html>
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -4844,19 +4844,24 @@ nsFlexContainerFrame::DoFlexLayout(nsPre
           }
         }
 
         ComputedFlexItemInfo* itemInfo =
           lineInfo->mItems.AppendElement();
 
         itemInfo->mNode = content;
 
-        // itemInfo->mMainBaseSize and mMainDeltaSize will be filled out
-        // in ResolveFlexibleLengths(). Other measurements will be captured
-        // at the end of this function.
+        // mMainBaseSize and itemInfo->mMainDeltaSize will
+        // be filled out in ResolveFlexibleLengths().
+
+        // Other FlexItem properties can be captured now.
+        itemInfo->mMainMinSize = item->GetMainMinSize();
+        itemInfo->mMainMaxSize = item->GetMainMaxSize();
+        itemInfo->mCrossMinSize = item->GetCrossMinSize();
+        itemInfo->mCrossMaxSize = item->GetCrossMaxSize();
       }
     }
   }
 
   aContentBoxMainSize =
     ResolveFlexContainerMainSize(aReflowInput, aAxisTracker,
                                  aContentBoxMainSize, aAvailableBSizeForContent,
                                  lines.getFirst(), aStatus);
@@ -5251,37 +5256,26 @@ nsFlexContainerFrame::DoFlexLayout(nsPre
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, childFrame);
   }
 
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize,
                                  aReflowInput, aStatus);
 
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize)
 
-  // Finally update our line and item measurements in our containerInfo.
+  // Finally update our line sizing values in our containerInfo.
   if (MOZ_UNLIKELY(containerInfo)) {
     lineIndex = 0;
     for (const FlexLine* line = lines.getFirst(); line;
          line = line->getNext(), ++lineIndex) {
       ComputedFlexLineInfo& lineInfo = containerInfo->mLines[lineIndex];
 
       lineInfo.mCrossSize = line->GetLineCrossSize();
       lineInfo.mFirstBaselineOffset = line->GetFirstBaselineOffset();
       lineInfo.mLastBaselineOffset = line->GetLastBaselineOffset();
-
-      uint32_t itemIndex = 0;
-      for (const FlexItem* item = line->GetFirstItem(); item;
-           item = item->getNext(), ++itemIndex) {
-        ComputedFlexItemInfo& itemInfo = lineInfo.mItems[itemIndex];
-        itemInfo.mFrameRect = item->Frame()->GetRect();
-        itemInfo.mMainMinSize = item->GetMainMinSize();
-        itemInfo.mMainMaxSize = item->GetMainMaxSize();
-        itemInfo.mCrossMinSize = item->GetCrossMinSize();
-        itemInfo.mCrossMaxSize = item->GetCrossMaxSize();
-      }
     }
   }
 }
 
 void
 nsFlexContainerFrame::MoveFlexItemToFinalPosition(
   const ReflowInput& aReflowInput,
   const FlexItem& aItem,
--- a/layout/generic/nsFlexContainerFrame.h
+++ b/layout/generic/nsFlexContainerFrame.h
@@ -28,17 +28,16 @@ nsContainerFrame* NS_NewFlexContainerFra
  * extracted by devtools via Chrome APIs. The structures are only
  * created when requested in GetFlexFrameWithComputedInfo(), and
  * the structures are attached to the nsFlexContainerFrame via the
  * FlexContainerInfo property.
  */
 struct ComputedFlexItemInfo
 {
   nsCOMPtr<nsINode> mNode;
-  nsRect mFrameRect;
   /**
    * mMainBaseSize is a measure of the size of the item in the main
    * axis before the flex sizing algorithm is applied. In the spec,
    * this is called "flex base size", but we use this name to connect
    * the value to the other main axis sizes.
    */
   nscoord mMainBaseSize;
   /**