mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-05-13 08:57:27 +00:00
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:
parent
3ab3b25fad
commit
d389170f49
@ -328,8 +328,8 @@ nsMathMLFrame::DisplayBoundingMetrics(nsDisplayListBuilder* aBuilder,
|
||||
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
|
||||
@ -338,16 +338,11 @@ public:
|
||||
}
|
||||
#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,
|
||||
@ -367,13 +362,12 @@ void nsDisplayMathMLBar::Paint(nsDisplayListBuilder* aBuilder,
|
||||
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
|
||||
|
@ -363,8 +363,7 @@ protected:
|
||||
*/
|
||||
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;
|
||||
|
@ -47,7 +47,7 @@ NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* 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)
|
||||
{
|
||||
@ -99,47 +99,42 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation)
|
||||
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;
|
||||
@ -150,7 +145,7 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation)
|
||||
*/
|
||||
void nsMathMLmencloseFrame::InitNotations()
|
||||
{
|
||||
mNotationsToDraw.clear();
|
||||
mNotationsToDraw = 0;
|
||||
mLongDivCharIndex = mRadicalCharIndex = -1;
|
||||
mMathMLChar.Clear();
|
||||
|
||||
@ -168,13 +163,13 @@ void nsMathMLmencloseFrame::InitNotations()
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,7 +220,7 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
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)) {
|
||||
@ -239,29 +234,29 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
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)) {
|
||||
@ -292,13 +287,13 @@ nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -761,10 +756,6 @@ public:
|
||||
}
|
||||
#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)
|
||||
|
@ -8,7 +8,6 @@
|
||||
#define nsMathMLmencloseFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/EnumSet.h"
|
||||
#include "nsMathMLContainerFrame.h"
|
||||
|
||||
//
|
||||
@ -27,20 +26,20 @@
|
||||
|
||||
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 {
|
||||
@ -102,10 +101,10 @@ protected:
|
||||
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;
|
||||
|
@ -34,7 +34,7 @@ nsMathMLmsqrtFrame::Init(nsIContent* aContent,
|
||||
{
|
||||
nsMathMLContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
AllocateMathMLChar(NOTATION_RADICAL);
|
||||
mNotationsToDraw += NOTATION_RADICAL;
|
||||
mNotationsToDraw |= NOTATION_RADICAL;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
Loading…
x
Reference in New Issue
Block a user