Backed out changeset 6b2edbf5944a (bug 1388614) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 10 Aug 2017 14:40:09 +0200
changeset 373968 97d71323c3f9a6b7d034a692ae2ad9cd489357f0
parent 373967 13521db456ac837fc298b6827b2038860133039c
child 373969 3c4d5576374d3a4dd74945e7246576a8877dca79
push id32311
push userkwierso@gmail.com
push dateFri, 11 Aug 2017 01:14:57 +0000
treeherdermozilla-central@253a8560dc34 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1388614
milestone57.0a1
backs out6b2edbf5944a1afbb8670920eae565e5543a735e
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 6b2edbf5944a (bug 1388614) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout
layout/mathml/nsMathMLFrame.cpp
layout/mathml/nsMathMLFrame.h
layout/mathml/nsMathMLmencloseFrame.cpp
layout/mathml/nsMathMLmencloseFrame.h
layout/mathml/nsMathMLmsqrtFrame.cpp
--- a/layout/mathml/nsMathMLFrame.cpp
+++ b/layout/mathml/nsMathMLFrame.cpp
@@ -323,36 +323,31 @@ nsMathMLFrame::DisplayBoundingMetrics(ns
   aLists.Content()->AppendNewToTop(new (aBuilder)
       nsDisplayMathMLBoundingMetrics(aBuilder, aFrame, nsRect(x,y,w,h)));
 }
 #endif
 
 class nsDisplayMathMLBar : public nsDisplayItem {
 public:
   nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder,
-                     nsIFrame* aFrame, const nsRect& aRect, uint32_t aIndex)
-    : nsDisplayItem(aBuilder, aFrame), mRect(aRect), mIndex(aIndex) {
+                     nsIFrame* aFrame, const nsRect& aRect)
+    : nsDisplayItem(aBuilder, aFrame), mRect(aRect) {
     MOZ_COUNT_CTOR(nsDisplayMathMLBar);
   }
 #ifdef NS_BUILD_REFCNT_LOGGING
   virtual ~nsDisplayMathMLBar() {
     MOZ_COUNT_DTOR(nsDisplayMathMLBar);
   }
 #endif
 
-  virtual uint32_t GetPerFrameKey() override {
-    return (mIndex << TYPE_BITS) | nsDisplayItem::GetPerFrameKey();
-  }
-
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      gfxContext* aCtx) override;
   NS_DISPLAY_DECL_NAME("MathMLBar", TYPE_MATHML_BAR)
 private:
   nsRect    mRect;
-  uint32_t  mIndex;
 };
 
 void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder,
                                gfxContext* aCtx)
 {
   // paint the bar with the current text color
   DrawTarget* drawTarget = aCtx->GetDrawTarget();
   Rect rect =
@@ -362,23 +357,22 @@ void nsDisplayMathMLBar::Paint(nsDisplay
   ColorPattern color(ToDeviceColor(
     mFrame->GetVisitedDependentColor(&nsStyleText::mWebkitTextFillColor)));
   drawTarget->FillRect(rect, color);
 }
 
 void
 nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder,
                           nsIFrame* aFrame, const nsRect& aRect,
-                          const nsDisplayListSet& aLists,
-                          uint32_t aIndex) {
+                          const nsDisplayListSet& aLists) {
   if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
     return;
 
   aLists.Content()->AppendNewToTop(new (aBuilder)
-    nsDisplayMathMLBar(aBuilder, aFrame, aRect, aIndex));
+    nsDisplayMathMLBar(aBuilder, aFrame, aRect));
 }
 
 void
 nsMathMLFrame::GetRadicalParameters(nsFontMetrics* aFontMetrics,
                                     bool aDisplayStyle,
                                     nscoord& aRadicalRuleThickness,
                                     nscoord& aRadicalExtraAscender,
                                     nscoord& aRadicalVerticalGap)
--- a/layout/mathml/nsMathMLFrame.h
+++ b/layout/mathml/nsMathMLFrame.h
@@ -358,18 +358,17 @@ protected:
 #endif
 
   /**
    * Display a solid rectangle in the frame's text color. Used for drawing
    * fraction separators and root/sqrt overbars.
    */
   void DisplayBar(nsDisplayListBuilder* aBuilder,
                   nsIFrame* aFrame, const nsRect& aRect,
-                  const nsDisplayListSet& aLists,
-                  uint32_t aIndex = 0);
+                  const nsDisplayListSet& aLists);
 
   // information about the presentation policy of the frame
   nsPresentationData mPresentationData;
 
   // information about a container that is an embellished operator
   nsEmbellishData mEmbellishData;
 
   // Metrics that _exactly_ enclose the text of the frame
--- a/layout/mathml/nsMathMLmencloseFrame.cpp
+++ b/layout/mathml/nsMathMLmencloseFrame.cpp
@@ -42,17 +42,17 @@ nsIFrame*
 NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsMathMLmencloseFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmencloseFrame)
 
 nsMathMLmencloseFrame::nsMathMLmencloseFrame(nsStyleContext* aContext, ClassID aID) :
-  nsMathMLContainerFrame(aContext, aID),
+  nsMathMLContainerFrame(aContext, aID), mNotationsToDraw(0),
   mRuleThickness(0), mRadicalRuleThickness(0),
   mLongDivCharIndex(-1), mRadicalCharIndex(-1), mContentWidth(0)
 {
 }
 
 nsMathMLmencloseFrame::~nsMathMLmencloseFrame()
 {
 }
@@ -94,68 +94,63 @@ nsresult nsMathMLmencloseFrame::Allocate
  */
 nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation)
 {
   nsresult rv;
 
   if (aNotation.EqualsLiteral("longdiv")) {
     rv = AllocateMathMLChar(NOTATION_LONGDIV);
     NS_ENSURE_SUCCESS(rv, rv);
-    mNotationsToDraw += NOTATION_LONGDIV;
+    mNotationsToDraw |= NOTATION_LONGDIV;
   } else if (aNotation.EqualsLiteral("actuarial")) {
-    mNotationsToDraw += NOTATION_RIGHT;
-    mNotationsToDraw += NOTATION_TOP;
+    mNotationsToDraw |= (NOTATION_RIGHT | NOTATION_TOP);
   } else if (aNotation.EqualsLiteral("radical")) {
     rv = AllocateMathMLChar(NOTATION_RADICAL);
     NS_ENSURE_SUCCESS(rv, rv);
-    mNotationsToDraw += NOTATION_RADICAL;
+    mNotationsToDraw |= NOTATION_RADICAL;
   } else if (aNotation.EqualsLiteral("box")) {
-    mNotationsToDraw += NOTATION_LEFT;
-    mNotationsToDraw += NOTATION_RIGHT;
-    mNotationsToDraw += NOTATION_TOP;
-    mNotationsToDraw += NOTATION_BOTTOM;
+    mNotationsToDraw |= (NOTATION_LEFT | NOTATION_RIGHT |
+                         NOTATION_TOP | NOTATION_BOTTOM);
   } else if (aNotation.EqualsLiteral("roundedbox")) {
-    mNotationsToDraw += NOTATION_ROUNDEDBOX;
+    mNotationsToDraw |= NOTATION_ROUNDEDBOX;
   } else if (aNotation.EqualsLiteral("circle")) {
-    mNotationsToDraw += NOTATION_CIRCLE;
+    mNotationsToDraw |= NOTATION_CIRCLE;
   } else if (aNotation.EqualsLiteral("left")) {
-    mNotationsToDraw += NOTATION_LEFT;
+    mNotationsToDraw |= NOTATION_LEFT;
   } else if (aNotation.EqualsLiteral("right")) {
-    mNotationsToDraw += NOTATION_RIGHT;
+    mNotationsToDraw |= NOTATION_RIGHT;
   } else if (aNotation.EqualsLiteral("top")) {
-    mNotationsToDraw += NOTATION_TOP;
+    mNotationsToDraw |= NOTATION_TOP;
   } else if (aNotation.EqualsLiteral("bottom")) {
-    mNotationsToDraw += NOTATION_BOTTOM;
+    mNotationsToDraw |= NOTATION_BOTTOM;
   } else if (aNotation.EqualsLiteral("updiagonalstrike")) {
-    mNotationsToDraw += NOTATION_UPDIAGONALSTRIKE;
+    mNotationsToDraw |= NOTATION_UPDIAGONALSTRIKE;
   } else if (aNotation.EqualsLiteral("updiagonalarrow")) {
-    mNotationsToDraw += NOTATION_UPDIAGONALARROW;
+    mNotationsToDraw |= NOTATION_UPDIAGONALARROW;
   } else if (aNotation.EqualsLiteral("downdiagonalstrike")) {
-    mNotationsToDraw += NOTATION_DOWNDIAGONALSTRIKE;
+    mNotationsToDraw |= NOTATION_DOWNDIAGONALSTRIKE;
   } else if (aNotation.EqualsLiteral("verticalstrike")) {
-    mNotationsToDraw += NOTATION_VERTICALSTRIKE;
+    mNotationsToDraw |= NOTATION_VERTICALSTRIKE;
   } else if (aNotation.EqualsLiteral("horizontalstrike")) {
-    mNotationsToDraw += NOTATION_HORIZONTALSTRIKE;
+    mNotationsToDraw |= NOTATION_HORIZONTALSTRIKE;
   } else if (aNotation.EqualsLiteral("madruwb")) {
-    mNotationsToDraw += NOTATION_RIGHT;
-    mNotationsToDraw += NOTATION_BOTTOM;
+    mNotationsToDraw |= (NOTATION_RIGHT | NOTATION_BOTTOM);
   } else if (aNotation.EqualsLiteral("phasorangle")) {
-    mNotationsToDraw += NOTATION_BOTTOM;
-    mNotationsToDraw += NOTATION_PHASORANGLE;
+    mNotationsToDraw |= (NOTATION_BOTTOM | NOTATION_PHASORANGLE);
   }
 
   return NS_OK;
 }
 
 /*
  * Initialize the list of notations to draw
  */
 void nsMathMLmencloseFrame::InitNotations()
 {
-  mNotationsToDraw.clear();
+  mNotationsToDraw = 0;
   mLongDivCharIndex = mRadicalCharIndex = -1;
   mMathMLChar.Clear();
 
   nsAutoString value;
 
   if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::notation_, value)) {
     // parse the notation attribute
     nsWhitespaceTokenizer tokenizer(value);
@@ -163,23 +158,23 @@ void nsMathMLmencloseFrame::InitNotation
     while (tokenizer.hasMoreTokens())
       AddNotation(tokenizer.nextToken());
 
     if (IsToDraw(NOTATION_UPDIAGONALARROW)) {
       // For <menclose notation="updiagonalstrike updiagonalarrow">, if
       // the two notations are drawn then the strike line may cause the point of
       // the arrow to be too wide. Hence we will only draw the updiagonalarrow
       // and the arrow shaft may be thought to be the updiagonalstrike.
-      mNotationsToDraw -= NOTATION_UPDIAGONALSTRIKE;
+      mNotationsToDraw &= ~NOTATION_UPDIAGONALSTRIKE;
     }
   } else {
     // default: longdiv
     if (NS_FAILED(AllocateMathMLChar(NOTATION_LONGDIV)))
       return;
-    mNotationsToDraw += NOTATION_LONGDIV;
+    mNotationsToDraw = NOTATION_LONGDIV;
   }
 }
 
 NS_IMETHODIMP
 nsMathMLmencloseFrame::InheritAutomaticData(nsIFrame* aParent)
 {
   // let the base class get the default from our parent
   nsMathMLContainerFrame::InheritAutomaticData(aParent);
@@ -220,53 +215,53 @@ nsMathMLmencloseFrame::BuildDisplayList(
 
   if (IsToDraw(NOTATION_RADICAL)) {
     mMathMLChar[mRadicalCharIndex].Display(aBuilder, this, aLists, 0);
 
     nsRect rect;
     mMathMLChar[mRadicalCharIndex].GetRect(rect);
     rect.MoveBy(StyleVisibility()->mDirection ? -mContentWidth : rect.width, 0);
     rect.SizeTo(mContentWidth, mRadicalRuleThickness);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_RADICAL);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_PHASORANGLE)) {
     DisplayNotation(aBuilder, this, mencloseRect, aLists,
                 mRuleThickness, NOTATION_PHASORANGLE);
   }
 
   if (IsToDraw(NOTATION_LONGDIV)) {
     mMathMLChar[mLongDivCharIndex].Display(aBuilder, this, aLists, 1);
 
     nsRect rect;
     mMathMLChar[mLongDivCharIndex].GetRect(rect);
     rect.SizeTo(rect.width + mContentWidth, mRuleThickness);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_LONGDIV);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_TOP)) {
     nsRect rect(0, 0, mencloseRect.width, mRuleThickness);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_TOP);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_BOTTOM)) {
     nsRect rect(0, mencloseRect.height - mRuleThickness,
                 mencloseRect.width, mRuleThickness);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_BOTTOM);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_LEFT)) {
     nsRect rect(0, 0, mRuleThickness, mencloseRect.height);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_LEFT);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_RIGHT)) {
     nsRect rect(mencloseRect.width - mRuleThickness, 0,
                 mRuleThickness, mencloseRect.height);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_RIGHT);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_ROUNDEDBOX)) {
     DisplayNotation(aBuilder, this, mencloseRect, aLists,
                     mRuleThickness, NOTATION_ROUNDEDBOX);
   }
 
   if (IsToDraw(NOTATION_CIRCLE)) {
@@ -287,23 +282,23 @@ nsMathMLmencloseFrame::BuildDisplayList(
   if (IsToDraw(NOTATION_DOWNDIAGONALSTRIKE)) {
     DisplayNotation(aBuilder, this, mencloseRect, aLists,
                     mRuleThickness, NOTATION_DOWNDIAGONALSTRIKE);
   }
 
   if (IsToDraw(NOTATION_HORIZONTALSTRIKE)) {
     nsRect rect(0, mencloseRect.height / 2 - mRuleThickness / 2,
                 mencloseRect.width, mRuleThickness);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_HORIZONTALSTRIKE);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 
   if (IsToDraw(NOTATION_VERTICALSTRIKE)) {
     nsRect rect(mencloseRect.width / 2 - mRuleThickness / 2, 0,
                 mRuleThickness, mencloseRect.height);
-    DisplayBar(aBuilder, this, rect, aLists, NOTATION_VERTICALSTRIKE);
+    DisplayBar(aBuilder, this, rect, aLists);
   }
 }
 
 /* virtual */ nsresult
 nsMathMLmencloseFrame::MeasureForWidth(DrawTarget* aDrawTarget,
                                        ReflowOutput& aDesiredSize)
 {
   return PlaceInternal(aDrawTarget, false, aDesiredSize, true);
@@ -756,20 +751,16 @@ public:
     MOZ_COUNT_CTOR(nsDisplayNotation);
   }
 #ifdef NS_BUILD_REFCNT_LOGGING
   virtual ~nsDisplayNotation() {
     MOZ_COUNT_DTOR(nsDisplayNotation);
   }
 #endif
 
-  virtual uint32_t GetPerFrameKey() override {
-    return (mType << TYPE_BITS) | nsDisplayItem::GetPerFrameKey();
-  }
-
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      gfxContext* aCtx) override;
   NS_DISPLAY_DECL_NAME("MathMLMencloseNotation", TYPE_MATHML_MENCLOSE_NOTATION)
 
 private:
   nsRect             mRect;
   nscoord            mThickness;
   nsMencloseNotation mType;
--- a/layout/mathml/nsMathMLmencloseFrame.h
+++ b/layout/mathml/nsMathMLmencloseFrame.h
@@ -3,17 +3,16 @@
  * 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 nsMathMLmencloseFrame_h___
 #define nsMathMLmencloseFrame_h___
 
 #include "mozilla/Attributes.h"
-#include "mozilla/EnumSet.h"
 #include "nsMathMLContainerFrame.h"
 
 //
 // <menclose> -- enclose content with a stretching symbol such
 // as a long division sign.
 //
 
 /*
@@ -22,30 +21,30 @@
   The menclose element renders its content inside the enclosing notation
   specified by its notation attribute. menclose accepts any number of arguments;
   if this number is not 1, its contents are treated as a single "inferred mrow"
   containing its arguments, as described in Section 3.1.3 Required Arguments.
 */
 
 enum nsMencloseNotation
   {
-    NOTATION_LONGDIV,
-    NOTATION_RADICAL,
-    NOTATION_ROUNDEDBOX,
-    NOTATION_CIRCLE,
-    NOTATION_LEFT,
-    NOTATION_RIGHT,
-    NOTATION_TOP,
-    NOTATION_BOTTOM,
-    NOTATION_UPDIAGONALSTRIKE,
-    NOTATION_DOWNDIAGONALSTRIKE,
-    NOTATION_VERTICALSTRIKE,
-    NOTATION_HORIZONTALSTRIKE,
-    NOTATION_UPDIAGONALARROW,
-    NOTATION_PHASORANGLE
+    NOTATION_LONGDIV = 0x1,
+    NOTATION_RADICAL = 0x2,
+    NOTATION_ROUNDEDBOX = 0x4,
+    NOTATION_CIRCLE = 0x8,
+    NOTATION_LEFT = 0x10,
+    NOTATION_RIGHT = 0x20,
+    NOTATION_TOP = 0x40,
+    NOTATION_BOTTOM = 0x80,
+    NOTATION_UPDIAGONALSTRIKE = 0x100,
+    NOTATION_DOWNDIAGONALSTRIKE = 0x200,
+    NOTATION_VERTICALSTRIKE = 0x400,
+    NOTATION_HORIZONTALSTRIKE = 0x800,
+    NOTATION_UPDIAGONALARROW = 0x1000,
+    NOTATION_PHASORANGLE = 0x2000
   };
 
 class nsMathMLmencloseFrame : public nsMathMLContainerFrame {
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsMathMLmencloseFrame)
 
   friend nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell*   aPresShell,
                                              nsStyleContext* aContext);
@@ -97,20 +96,20 @@ protected:
                          ReflowOutput& aDesiredSize,
                          bool                 aWidthOnly);
 
   // functions to parse the "notation" attribute.
   nsresult AddNotation(const nsAString& aNotation);
   void InitNotations();
 
   // Description of the notations to draw
-  mozilla::EnumSet<nsMencloseNotation> mNotationsToDraw;
-  bool IsToDraw(nsMencloseNotation notation)
+  uint32_t mNotationsToDraw;
+  bool IsToDraw(nsMencloseNotation mask)
   {
-    return mNotationsToDraw.contains(notation);
+    return mask & mNotationsToDraw;
   }
 
   nscoord mRuleThickness;
   nscoord mRadicalRuleThickness;
   nsTArray<nsMathMLChar> mMathMLChar;
   int8_t mLongDivCharIndex, mRadicalCharIndex;
   nscoord mContentWidth;
   nsresult AllocateMathMLChar(nsMencloseNotation mask);
--- a/layout/mathml/nsMathMLmsqrtFrame.cpp
+++ b/layout/mathml/nsMathMLmsqrtFrame.cpp
@@ -29,17 +29,17 @@ nsMathMLmsqrtFrame::~nsMathMLmsqrtFrame(
 
 void
 nsMathMLmsqrtFrame::Init(nsIContent*       aContent,
                          nsContainerFrame* aParent,
                          nsIFrame*         aPrevInFlow)
 {
   nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
   AllocateMathMLChar(NOTATION_RADICAL);
-  mNotationsToDraw += NOTATION_RADICAL;
+  mNotationsToDraw |= NOTATION_RADICAL;
 }
 
 NS_IMETHODIMP
 nsMathMLmsqrtFrame::InheritAutomaticData(nsIFrame* aParent)
 {
   nsMathMLContainerFrame::InheritAutomaticData(aParent);
 
   mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_VERTICALLY;