Backed out changeset f39d284f4db7 (bug 1797012) for causing wpt failures on frac-1.html. CLOSED TREE

This commit is contained in:
Marian-Vasile Laza 2022-10-24 15:46:12 +03:00
Родитель 05c762525f
Коммит e80c0a7ce7
12 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@ -593,8 +593,8 @@ void MathMLElement::MapMathMLAttributesInto(
!aDecls.PropertyIsSet(eCSSProperty_math_style)) {
auto str = value->GetStringValue();
static const char displaystyles[][6] = {"false", "true"};
static const StyleMathStyle mathStyle[MOZ_ARRAY_LENGTH(displaystyles)] = {
StyleMathStyle::Compact, StyleMathStyle::Normal};
static const uint8_t mathStyle[MOZ_ARRAY_LENGTH(displaystyles)] = {
NS_STYLE_MATH_STYLE_COMPACT, NS_STYLE_MATH_STYLE_NORMAL};
for (uint32_t i = 0; i < ArrayLength(displaystyles); ++i) {
if (str.LowerCaseEqualsASCII(displaystyles[i])) {
aDecls.SetKeywordValue(eCSSProperty_math_style, mathStyle[i]);

Просмотреть файл

@ -362,7 +362,8 @@ nsresult nsMathMLmencloseFrame::PlaceInternal(DrawTarget* aDrawTarget,
if (delta) padding += onePixel - delta; // round up
if (IsToDraw(NOTATION_LONGDIV) || IsToDraw(NOTATION_RADICAL)) {
GetRadicalParameters(fm, StyleFont()->mMathStyle == StyleMathStyle::Normal,
GetRadicalParameters(fm,
StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_NORMAL,
mRadicalRuleThickness, leading, psi);
// make sure that the rule appears on on screen

Просмотреть файл

@ -43,7 +43,7 @@ eMathMLFrameType nsMathMLmfracFrame::GetMathMLFrameType() {
}
uint8_t nsMathMLmfracFrame::ScriptIncrement(nsIFrame* aFrame) {
if (StyleFont()->mMathStyle == StyleMathStyle::Compact && aFrame &&
if (StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_COMPACT && aFrame &&
(mFrames.FirstChild() == aFrame || mFrames.LastChild() == aFrame)) {
return 1;
}
@ -59,7 +59,7 @@ nsMathMLmfracFrame::TransmitAutomaticData() {
// If displaystyle is false, then scriptlevel is incremented, so notify the
// children of this.
if (StyleFont()->mMathStyle == StyleMathStyle::Compact) {
if (StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_COMPACT) {
PropagateFrameFlagFor(mFrames.FirstChild(),
NS_FRAME_MATHML_SCRIPT_DESCENDANT);
PropagateFrameFlagFor(mFrames.LastChild(),
@ -197,7 +197,7 @@ nsresult nsMathMLmfracFrame::PlaceInternal(DrawTarget* aDrawTarget,
CalcLineThickness(presContext, mComputedStyle, value, onePixel,
defaultRuleThickness, fontSizeInflation);
bool displayStyle = StyleFont()->mMathStyle == StyleMathStyle::Compact;
bool displayStyle = StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_NORMAL;
mLineRect.height = mLineThickness;

Просмотреть файл

@ -229,7 +229,8 @@ nsresult nsMathMLmmultiscriptsFrame::PlaceMultiScript(
// get sup script shift depending on current script level and display style
// Rule 18c, App. G, TeXbook
if (font->mMathDepth == 0 && font->mMathStyle == StyleMathStyle::Normal &&
if (font->mMathDepth == 0 &&
font->mMathStyle == NS_STYLE_MATH_STYLE_NORMAL &&
!NS_MATHML_IS_COMPRESSED(presentationData.flags)) {
// Style D in TeXbook
supScriptShift = supScriptShift1;

Просмотреть файл

@ -553,7 +553,7 @@ static uint32_t GetStretchHint(nsOperatorFlags aFlags,
// stretchy are true or false (see bug 69325).
// . largeopOnly is taken if largeop=true and stretchy=false
// . largeop is taken if largeop=true and stretchy=true
if (aStyleFont->mMathStyle == StyleMathStyle::Normal &&
if (aStyleFont->mMathStyle == NS_STYLE_MATH_STYLE_NORMAL &&
NS_MATHML_OPERATOR_IS_LARGEOP(aFlags)) {
stretchHint = NS_STRETCH_LARGEOP; // (largeopOnly, not mask!)
if (NS_MATHML_OPERATOR_IS_STRETCHY(aFlags)) {
@ -946,7 +946,7 @@ nsresult nsMathMLmoFrame::Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
Stretch() method.
*/
if (!aPlaceOrigin && StyleFont()->mMathStyle == StyleMathStyle::Normal &&
if (!aPlaceOrigin && StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_NORMAL &&
NS_MATHML_OPERATOR_IS_LARGEOP(mFlags) && UseMathMLChar()) {
nsBoundingMetrics newMetrics;
rv = mMathMLChar.Stretch(

Просмотреть файл

@ -228,7 +228,8 @@ void nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
nsLayoutUtils::GetFontMetricsForFrame(this, fontSizeInflation);
nscoord ruleThickness, leading, psi;
GetRadicalParameters(fm, StyleFont()->mMathStyle == StyleMathStyle::Normal,
GetRadicalParameters(fm,
StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_NORMAL,
ruleThickness, leading, psi);
// built-in: adjust clearance psi to emulate \mathstrut using '1' (TexBook,

Просмотреть файл

@ -57,7 +57,7 @@ nsMathMLmunderoverFrame::UpdatePresentationData(uint32_t aFlagsValues,
// disable the stretch-all flag if we are going to act like a
// subscript-superscript pair
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
StyleFont()->mMathStyle == StyleMathStyle::Compact) {
StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_COMPACT) {
mPresentationData.flags &= ~NS_MATHML_STRETCH_ALL_CHILDREN_HORIZONTALLY;
} else {
mPresentationData.flags |= NS_MATHML_STRETCH_ALL_CHILDREN_HORIZONTALLY;
@ -257,7 +257,7 @@ XXX The winner is the outermost setting in conflicting settings like these:
bool subsupDisplay =
NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
StyleFont()->mMathStyle == StyleMathStyle::Compact;
StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_COMPACT;
// disable the stretch-all flag if we are going to act like a superscript
if (subsupDisplay) {
@ -351,7 +351,7 @@ The REC says:
i.e.,:
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishDataflags) &&
StyleFont()->mMathStyle == StyleMathStyle::Compact) {
StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_COMPACT) {
// place like subscript-superscript pair
}
else {
@ -365,7 +365,7 @@ nsresult nsMathMLmunderoverFrame::Place(DrawTarget* aDrawTarget,
ReflowOutput& aDesiredSize) {
float fontSizeInflation = nsLayoutUtils::FontSizeInflationFor(this);
if (NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) &&
StyleFont()->mMathStyle == StyleMathStyle::Compact) {
StyleFont()->mMathStyle == NS_STYLE_MATH_STYLE_COMPACT) {
// place like sub sup or subsup
if (mContent->IsMathMLElement(nsGkAtoms::munderover_)) {
return nsMathMLmmultiscriptsFrame::PlaceMultiScript(

Просмотреть файл

@ -110,7 +110,6 @@ rusty-enums = [
"mozilla::StyleShapeSourceType",
"mozilla::StyleVisibility",
"mozilla::StyleBasicShapeType",
"mozilla::StyleMathStyle",
"nsStyleImageLayers_Size_DimensionType",
"mozilla::StyleBorderCollapse",
"mozilla::StyleBorderImageRepeat",

Просмотреть файл

@ -390,7 +390,8 @@ enum class StyleMathVariant : uint8_t {
};
// See nsStyleFont::mMathStyle
enum class StyleMathStyle : uint8_t { Compact = 0, Normal = 1 };
#define NS_STYLE_MATH_STYLE_COMPACT 0
#define NS_STYLE_MATH_STYLE_NORMAL 1
// See nsStyleDisplay.mPosition
enum class StylePositionProperty : uint8_t {

Просмотреть файл

@ -232,7 +232,7 @@ nsStyleFont::nsStyleFont(const Document& aDocument)
mFontPalette(StyleFontPalette::Normal()),
mMathDepth(0),
mMathVariant(StyleMathVariant::None),
mMathStyle(StyleMathStyle::Normal),
mMathStyle(NS_STYLE_MATH_STYLE_NORMAL),
mMinFontSizeRatio(100), // 100%
mExplicitLanguage(false),
mAllowZoomAndMinSize(true),

Просмотреть файл

@ -140,7 +140,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleFont {
// MathML mathvariant support
mozilla::StyleMathVariant mMathVariant;
// math-style support (used for MathML displaystyle)
mozilla::StyleMathStyle mMathStyle;
uint8_t mMathStyle;
// allow different min font-size for certain cases
uint8_t mMinFontSizeRatio; // percent * 100

Просмотреть файл

@ -269,7 +269,6 @@ ${helpers.single_keyword(
"math-style",
"normal compact",
engines="gecko",
gecko_enum_prefix="StyleMathStyle",
gecko_pref="layout.css.math-style.enabled",
spec="https://mathml-refresh.github.io/mathml-core/#the-math-style-property",
has_effect_on_gecko_scrollbars=False,