Backed out changeset 6b2edbf5944a (bug 1388614) for failing chrome's test_animation_performance_warning.html | preserve-3d transform. r=backout

This commit is contained in:
Sebastian Hengst 2017-08-10 14:40:09 +02:00
parent 3ab3b25fad
commit d389170f49
5 changed files with 53 additions and 70 deletions

View File

@ -328,8 +328,8 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder,
class nsDisplayMathMLBar : public nsDisplayItem { class nsDisplayMathMLBar : public nsDisplayItem {
public: public:
nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder, nsDisplayMathMLBar(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect, uint32_t aIndex) nsIFrame* aFrame, const nsRect& aRect)
: nsDisplayItem(aBuilder, aFrame), mRect(aRect), mIndex(aIndex) { : nsDisplayItem(aBuilder, aFrame), mRect(aRect) {
MOZ_COUNT_CTOR(nsDisplayMathMLBar); MOZ_COUNT_CTOR(nsDisplayMathMLBar);
} }
#ifdef NS_BUILD_REFCNT_LOGGING #ifdef NS_BUILD_REFCNT_LOGGING
@ -338,16 +338,11 @@ public:
} }
#endif #endif
virtual uint32_t GetPerFrameKey() override {
return (mIndex << TYPE_BITS) | nsDisplayItem::GetPerFrameKey();
}
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
gfxContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("MathMLBar", TYPE_MATHML_BAR) NS_DISPLAY_DECL_NAME("MathMLBar", TYPE_MATHML_BAR)
private: private:
nsRect mRect; nsRect mRect;
uint32_t mIndex;
}; };
void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder, void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder,
@ -367,13 +362,12 @@ void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder,
void void
nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder, nsMathMLFrame::DisplayBar(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect, nsIFrame* aFrame, const nsRect& aRect,
const nsDisplayListSet& aLists, const nsDisplayListSet& aLists) {
uint32_t aIndex) {
if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty()) if (!aFrame->StyleVisibility()->IsVisible() || aRect.IsEmpty())
return; return;
aLists.Content()->AppendNewToTop(new (aBuilder) aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayMathMLBar(aBuilder, aFrame, aRect, aIndex)); nsDisplayMathMLBar(aBuilder, aFrame, aRect));
} }
void void

View File

@ -363,8 +363,7 @@ protected:
*/ */
void DisplayBar(nsDisplayListBuilder* aBuilder, void DisplayBar(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, const nsRect& aRect, nsIFrame* aFrame, const nsRect& aRect,
const nsDisplayListSet& aLists, const nsDisplayListSet& aLists);
uint32_t aIndex = 0);
// information about the presentation policy of the frame // information about the presentation policy of the frame
nsPresentationData mPresentationData; nsPresentationData mPresentationData;

View File

@ -47,7 +47,7 @@ NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmencloseFrame) NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmencloseFrame)
nsMathMLmencloseFrame::nsMathMLmencloseFrame(nsStyleContext* aContext, ClassID aID) : nsMathMLmencloseFrame::nsMathMLmencloseFrame(nsStyleContext* aContext, ClassID aID) :
nsMathMLContainerFrame(aContext, aID), nsMathMLContainerFrame(aContext, aID), mNotationsToDraw(0),
mRuleThickness(0), mRadicalRuleThickness(0), mRuleThickness(0), mRadicalRuleThickness(0),
mLongDivCharIndex(-1), mRadicalCharIndex(-1), mContentWidth(0) mLongDivCharIndex(-1), mRadicalCharIndex(-1), mContentWidth(0)
{ {
@ -99,47 +99,42 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation)
if (aNotation.EqualsLiteral("longdiv")) { if (aNotation.EqualsLiteral("longdiv")) {
rv = AllocateMathMLChar(NOTATION_LONGDIV); rv = AllocateMathMLChar(NOTATION_LONGDIV);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mNotationsToDraw += NOTATION_LONGDIV; mNotationsToDraw |= NOTATION_LONGDIV;
} else if (aNotation.EqualsLiteral("actuarial")) { } else if (aNotation.EqualsLiteral("actuarial")) {
mNotationsToDraw += NOTATION_RIGHT; mNotationsToDraw |= (NOTATION_RIGHT | NOTATION_TOP);
mNotationsToDraw += NOTATION_TOP;
} else if (aNotation.EqualsLiteral("radical")) { } else if (aNotation.EqualsLiteral("radical")) {
rv = AllocateMathMLChar(NOTATION_RADICAL); rv = AllocateMathMLChar(NOTATION_RADICAL);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mNotationsToDraw += NOTATION_RADICAL; mNotationsToDraw |= NOTATION_RADICAL;
} else if (aNotation.EqualsLiteral("box")) { } else if (aNotation.EqualsLiteral("box")) {
mNotationsToDraw += NOTATION_LEFT; mNotationsToDraw |= (NOTATION_LEFT | NOTATION_RIGHT |
mNotationsToDraw += NOTATION_RIGHT; NOTATION_TOP | NOTATION_BOTTOM);
mNotationsToDraw += NOTATION_TOP;
mNotationsToDraw += NOTATION_BOTTOM;
} else if (aNotation.EqualsLiteral("roundedbox")) { } else if (aNotation.EqualsLiteral("roundedbox")) {
mNotationsToDraw += NOTATION_ROUNDEDBOX; mNotationsToDraw |= NOTATION_ROUNDEDBOX;
} else if (aNotation.EqualsLiteral("circle")) { } else if (aNotation.EqualsLiteral("circle")) {
mNotationsToDraw += NOTATION_CIRCLE; mNotationsToDraw |= NOTATION_CIRCLE;
} else if (aNotation.EqualsLiteral("left")) { } else if (aNotation.EqualsLiteral("left")) {
mNotationsToDraw += NOTATION_LEFT; mNotationsToDraw |= NOTATION_LEFT;
} else if (aNotation.EqualsLiteral("right")) { } else if (aNotation.EqualsLiteral("right")) {
mNotationsToDraw += NOTATION_RIGHT; mNotationsToDraw |= NOTATION_RIGHT;
} else if (aNotation.EqualsLiteral("top")) { } else if (aNotation.EqualsLiteral("top")) {
mNotationsToDraw += NOTATION_TOP; mNotationsToDraw |= NOTATION_TOP;
} else if (aNotation.EqualsLiteral("bottom")) { } else if (aNotation.EqualsLiteral("bottom")) {
mNotationsToDraw += NOTATION_BOTTOM; mNotationsToDraw |= NOTATION_BOTTOM;
} else if (aNotation.EqualsLiteral("updiagonalstrike")) { } else if (aNotation.EqualsLiteral("updiagonalstrike")) {
mNotationsToDraw += NOTATION_UPDIAGONALSTRIKE; mNotationsToDraw |= NOTATION_UPDIAGONALSTRIKE;
} else if (aNotation.EqualsLiteral("updiagonalarrow")) { } else if (aNotation.EqualsLiteral("updiagonalarrow")) {
mNotationsToDraw += NOTATION_UPDIAGONALARROW; mNotationsToDraw |= NOTATION_UPDIAGONALARROW;
} else if (aNotation.EqualsLiteral("downdiagonalstrike")) { } else if (aNotation.EqualsLiteral("downdiagonalstrike")) {
mNotationsToDraw += NOTATION_DOWNDIAGONALSTRIKE; mNotationsToDraw |= NOTATION_DOWNDIAGONALSTRIKE;
} else if (aNotation.EqualsLiteral("verticalstrike")) { } else if (aNotation.EqualsLiteral("verticalstrike")) {
mNotationsToDraw += NOTATION_VERTICALSTRIKE; mNotationsToDraw |= NOTATION_VERTICALSTRIKE;
} else if (aNotation.EqualsLiteral("horizontalstrike")) { } else if (aNotation.EqualsLiteral("horizontalstrike")) {
mNotationsToDraw += NOTATION_HORIZONTALSTRIKE; mNotationsToDraw |= NOTATION_HORIZONTALSTRIKE;
} else if (aNotation.EqualsLiteral("madruwb")) { } else if (aNotation.EqualsLiteral("madruwb")) {
mNotationsToDraw += NOTATION_RIGHT; mNotationsToDraw |= (NOTATION_RIGHT | NOTATION_BOTTOM);
mNotationsToDraw += NOTATION_BOTTOM;
} else if (aNotation.EqualsLiteral("phasorangle")) { } else if (aNotation.EqualsLiteral("phasorangle")) {
mNotationsToDraw += NOTATION_BOTTOM; mNotationsToDraw |= (NOTATION_BOTTOM | NOTATION_PHASORANGLE);
mNotationsToDraw += NOTATION_PHASORANGLE;
} }
return NS_OK; return NS_OK;
@ -150,7 +145,7 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation)
*/ */
void nsMathMLmencloseFrame::InitNotations() void nsMathMLmencloseFrame::InitNotations()
{ {
mNotationsToDraw.clear(); mNotationsToDraw = 0;
mLongDivCharIndex = mRadicalCharIndex = -1; mLongDivCharIndex = mRadicalCharIndex = -1;
mMathMLChar.Clear(); mMathMLChar.Clear();
@ -168,13 +163,13 @@ void nsMathMLmencloseFrame::InitNotations()
// the two notations are drawn then the strike line may cause the point of // 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 // the arrow to be too wide. Hence we will only draw the updiagonalarrow
// and the arrow shaft may be thought to be the updiagonalstrike. // and the arrow shaft may be thought to be the updiagonalstrike.
mNotationsToDraw -= NOTATION_UPDIAGONALSTRIKE; mNotationsToDraw &= ~NOTATION_UPDIAGONALSTRIKE;
} }
} else { } else {
// default: longdiv // default: longdiv
if (NS_FAILED(AllocateMathMLChar(NOTATION_LONGDIV))) if (NS_FAILED(AllocateMathMLChar(NOTATION_LONGDIV)))
return; return;
mNotationsToDraw += NOTATION_LONGDIV; mNotationsToDraw = NOTATION_LONGDIV;
} }
} }
@ -225,7 +220,7 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mMathMLChar[mRadicalCharIndex].GetRect(rect); mMathMLChar[mRadicalCharIndex].GetRect(rect);
rect.MoveBy(StyleVisibility()->mDirection ? -mContentWidth : rect.width, 0); rect.MoveBy(StyleVisibility()->mDirection ? -mContentWidth : rect.width, 0);
rect.SizeTo(mContentWidth, mRadicalRuleThickness); rect.SizeTo(mContentWidth, mRadicalRuleThickness);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_RADICAL); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_PHASORANGLE)) { if (IsToDraw(NOTATION_PHASORANGLE)) {
@ -239,29 +234,29 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsRect rect; nsRect rect;
mMathMLChar[mLongDivCharIndex].GetRect(rect); mMathMLChar[mLongDivCharIndex].GetRect(rect);
rect.SizeTo(rect.width + mContentWidth, mRuleThickness); rect.SizeTo(rect.width + mContentWidth, mRuleThickness);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_LONGDIV); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_TOP)) { if (IsToDraw(NOTATION_TOP)) {
nsRect rect(0, 0, mencloseRect.width, mRuleThickness); nsRect rect(0, 0, mencloseRect.width, mRuleThickness);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_TOP); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_BOTTOM)) { if (IsToDraw(NOTATION_BOTTOM)) {
nsRect rect(0, mencloseRect.height - mRuleThickness, nsRect rect(0, mencloseRect.height - mRuleThickness,
mencloseRect.width, mRuleThickness); mencloseRect.width, mRuleThickness);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_BOTTOM); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_LEFT)) { if (IsToDraw(NOTATION_LEFT)) {
nsRect rect(0, 0, mRuleThickness, mencloseRect.height); nsRect rect(0, 0, mRuleThickness, mencloseRect.height);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_LEFT); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_RIGHT)) { if (IsToDraw(NOTATION_RIGHT)) {
nsRect rect(mencloseRect.width - mRuleThickness, 0, nsRect rect(mencloseRect.width - mRuleThickness, 0,
mRuleThickness, mencloseRect.height); mRuleThickness, mencloseRect.height);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_RIGHT); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_ROUNDEDBOX)) { if (IsToDraw(NOTATION_ROUNDEDBOX)) {
@ -292,13 +287,13 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (IsToDraw(NOTATION_HORIZONTALSTRIKE)) { if (IsToDraw(NOTATION_HORIZONTALSTRIKE)) {
nsRect rect(0, mencloseRect.height / 2 - mRuleThickness / 2, nsRect rect(0, mencloseRect.height / 2 - mRuleThickness / 2,
mencloseRect.width, mRuleThickness); mencloseRect.width, mRuleThickness);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_HORIZONTALSTRIKE); DisplayBar(aBuilder, this, rect, aLists);
} }
if (IsToDraw(NOTATION_VERTICALSTRIKE)) { if (IsToDraw(NOTATION_VERTICALSTRIKE)) {
nsRect rect(mencloseRect.width / 2 - mRuleThickness / 2, 0, nsRect rect(mencloseRect.width / 2 - mRuleThickness / 2, 0,
mRuleThickness, mencloseRect.height); mRuleThickness, mencloseRect.height);
DisplayBar(aBuilder, this, rect, aLists, NOTATION_VERTICALSTRIKE); DisplayBar(aBuilder, this, rect, aLists);
} }
} }
@ -761,10 +756,6 @@ public:
} }
#endif #endif
virtual uint32_t GetPerFrameKey() override {
return (mType << TYPE_BITS) | nsDisplayItem::GetPerFrameKey();
}
virtual void Paint(nsDisplayListBuilder* aBuilder, virtual void Paint(nsDisplayListBuilder* aBuilder,
gfxContext* aCtx) override; gfxContext* aCtx) override;
NS_DISPLAY_DECL_NAME("MathMLMencloseNotation", TYPE_MATHML_MENCLOSE_NOTATION) NS_DISPLAY_DECL_NAME("MathMLMencloseNotation", TYPE_MATHML_MENCLOSE_NOTATION)

View File

@ -8,7 +8,6 @@
#define nsMathMLmencloseFrame_h___ #define nsMathMLmencloseFrame_h___
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/EnumSet.h"
#include "nsMathMLContainerFrame.h" #include "nsMathMLContainerFrame.h"
// //
@ -27,20 +26,20 @@
enum nsMencloseNotation enum nsMencloseNotation
{ {
NOTATION_LONGDIV, NOTATION_LONGDIV = 0x1,
NOTATION_RADICAL, NOTATION_RADICAL = 0x2,
NOTATION_ROUNDEDBOX, NOTATION_ROUNDEDBOX = 0x4,
NOTATION_CIRCLE, NOTATION_CIRCLE = 0x8,
NOTATION_LEFT, NOTATION_LEFT = 0x10,
NOTATION_RIGHT, NOTATION_RIGHT = 0x20,
NOTATION_TOP, NOTATION_TOP = 0x40,
NOTATION_BOTTOM, NOTATION_BOTTOM = 0x80,
NOTATION_UPDIAGONALSTRIKE, NOTATION_UPDIAGONALSTRIKE = 0x100,
NOTATION_DOWNDIAGONALSTRIKE, NOTATION_DOWNDIAGONALSTRIKE = 0x200,
NOTATION_VERTICALSTRIKE, NOTATION_VERTICALSTRIKE = 0x400,
NOTATION_HORIZONTALSTRIKE, NOTATION_HORIZONTALSTRIKE = 0x800,
NOTATION_UPDIAGONALARROW, NOTATION_UPDIAGONALARROW = 0x1000,
NOTATION_PHASORANGLE NOTATION_PHASORANGLE = 0x2000
}; };
class nsMathMLmencloseFrame : public nsMathMLContainerFrame { class nsMathMLmencloseFrame : public nsMathMLContainerFrame {
@ -102,10 +101,10 @@ protected:
void InitNotations(); void InitNotations();
// Description of the notations to draw // Description of the notations to draw
mozilla::EnumSet<nsMencloseNotation> mNotationsToDraw; uint32_t mNotationsToDraw;
bool IsToDraw(nsMencloseNotation notation) bool IsToDraw(nsMencloseNotation mask)
{ {
return mNotationsToDraw.contains(notation); return mask & mNotationsToDraw;
} }
nscoord mRuleThickness; nscoord mRuleThickness;

View File

@ -34,7 +34,7 @@ nsMathMLmsqrtFrame::Init(nsIContent* aContent,
{ {
nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow); nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
AllocateMathMLChar(NOTATION_RADICAL); AllocateMathMLChar(NOTATION_RADICAL);
mNotationsToDraw += NOTATION_RADICAL; mNotationsToDraw |= NOTATION_RADICAL;
} }
NS_IMETHODIMP NS_IMETHODIMP