Backed out changeset 972db326c375 (bug 1587570) for causing wr failures on subsup-legacy-scriptshift-attributes-001.tentative.html

This commit is contained in:
Cosmin Sabou 2019-10-16 14:19:24 +03:00
Родитель 4c99a834d0
Коммит e37b7b8834
5 изменённых файлов: 45 добавлений и 59 удалений

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

@ -51,6 +51,5 @@ DEPRECATED_OPERATION(MathML_DeprecatedLineThicknessValue)
DEPRECATED_OPERATION(MathML_DeprecatedMathSizeValue)
DEPRECATED_OPERATION(MathML_DeprecatedMathSpaceValue)
DEPRECATED_OPERATION(MathML_DeprecatedMencloseNotationRadical)
DEPRECATED_OPERATION(MathML_DeprecatedScriptShiftAttributes)
DEPRECATED_OPERATION(MathML_DeprecatedStyleAttribute)
DEPRECATED_OPERATION(MathML_DeprecatedXLinkAttribute)

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

@ -375,8 +375,6 @@ MathML_DeprecatedMathSizeValueWarning=“small”, “normal” and “big” ar
MathML_DeprecatedMathSpaceValueWarning=“veryverythinmathspace”, “verythinmathspace”, “thinmathspace”, “mediummathspace”, “thickmathspace”, “verythickmathspace” and “veryverythickmathspace” are deprecated values for MathML lengths and will be removed at a future date.
# LOCALIZATION NOTE: Do not translate radical, notation and menclose.
MathML_DeprecatedMencloseNotationRadical=The “radical” value is deprecated for the “notation” attribute of the <menclose> element and will be removed at a future date.
# LOCALIZATION NOTE: Do not translate MathML, subscriptshift and superscriptshift.
MathML_DeprecatedScriptShiftAttributes=MathML attributes “subscriptshift” and “superscriptshift” are deprecated and may be removed at a future date.
# LOCALIZATION NOTE: Do not translate MathML, background, color, fontfamily, fontsize, fontstyle and fontweight.
MathML_DeprecatedStyleAttributeWarning=MathML attributes “background”, “color”, “fontfamily”, “fontsize”, “fontstyle” and “fontweight” are deprecated and will be removed at a future date.
# LOCALIZATION NOTE: Do not translate MathML and XLink.

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

@ -7,7 +7,6 @@
#include "nsMathMLmmultiscriptsFrame.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_mathml.h"
#include "nsPresContext.h"
#include <algorithm>
#include "gfxContext.h"
@ -95,43 +94,41 @@ nsresult nsMathMLmmultiscriptsFrame::Place(DrawTarget* aDrawTarget,
nscoord supScriptShift = 0;
float fontSizeInflation = nsLayoutUtils::FontSizeInflationFor(this);
if (!StaticPrefs::mathml_script_shift_attributes_disabled()) {
// subscriptshift
//
// "Specifies the minimum amount to shift the baseline of subscript down;
// the default is for the rendering agent to use its own positioning rules."
//
// values: length
// default: automatic
//
// We use 0 as the default value so unitless values can be ignored.
// As a minimum, negative values can be ignored.
//
nsAutoString value;
if (!mContent->IsMathMLElement(nsGkAtoms::msup_) &&
mContent->AsElement()->GetAttr(kNameSpaceID_None,
nsGkAtoms::subscriptshift_, value)) {
mContent->OwnerDoc()->WarnOnceAbout(
dom::Document::eMathML_DeprecatedScriptShiftAttributes);
// subscriptshift
//
// "Specifies the minimum amount to shift the baseline of subscript down; the
// default is for the rendering agent to use its own positioning rules."
//
// values: length
// default: automatic
//
// We use 0 as the default value so unitless values can be ignored.
// As a minimum, negative values can be ignored.
//
nsAutoString value;
if (!mContent->IsMathMLElement(nsGkAtoms::msup_)) {
mContent->AsElement()->GetAttr(kNameSpaceID_None,
nsGkAtoms::subscriptshift_, value);
if (!value.IsEmpty()) {
ParseNumericValue(value, &subScriptShift, 0, PresContext(),
mComputedStyle, fontSizeInflation);
}
// superscriptshift
//
// "Specifies the minimum amount to shift the baseline of superscript up;
// the default is for the rendering agent to use its own positioning rules."
//
// values: length
// default: automatic
//
// We use 0 as the default value so unitless values can be ignored.
// As a minimum, negative values can be ignored.
//
if (!mContent->IsMathMLElement(nsGkAtoms::msub_) &&
mContent->AsElement()->GetAttr(kNameSpaceID_None,
nsGkAtoms::superscriptshift_, value)) {
mContent->OwnerDoc()->WarnOnceAbout(
dom::Document::eMathML_DeprecatedScriptShiftAttributes);
}
// superscriptshift
//
// "Specifies the minimum amount to shift the baseline of superscript up; the
// default is for the rendering agent to use its own positioning rules."
//
// values: length
// default: automatic
//
// We use 0 as the default value so unitless values can be ignored.
// As a minimum, negative values can be ignored.
//
if (!mContent->IsMathMLElement(nsGkAtoms::msub_)) {
mContent->AsElement()->GetAttr(kNameSpaceID_None,
nsGkAtoms::superscriptshift_, value);
if (!value.IsEmpty()) {
ParseNumericValue(value, &supScriptShift, 0, PresContext(),
mComputedStyle, fontSizeInflation);
}

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

@ -34,26 +34,24 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=706406
</math></p>
<pre id="test">
<script type="application/javascript">
/** Test for the scriptshift aspect of bug 827713 **/
SimpleTest.waitForExplicitFinish();
if (SpecialPowers.getBoolPref('mathml.script_shift_attributes.disabled')) {
ok(true, "Script shifts disabled");
} else {
subBaseRect = $("subbase").getBoundingClientRect();
subSubRect = $("subsub").getBoundingClientRect();
is(subBaseRect.bottom, subSubRect.top, "Bad subscript shift for msub");
subBaseRect = $("subbase").getBoundingClientRect();
subSubRect = $("subsub").getBoundingClientRect();
is(subBaseRect.bottom, subSubRect.top, "Bad subscript shift for msub");
supBaseRect = $("supbase").getBoundingClientRect();
supSupRect = $("supsup").getBoundingClientRect();
is(supBaseRect.top, supSupRect.bottom, "Bad superscript shift for msup");
supBaseRect = $("supbase").getBoundingClientRect();
supSupRect = $("supsup").getBoundingClientRect();
is(supBaseRect.top, supSupRect.bottom, "Bad superscript shift for msup");
ssBaseRect = $("ssbase").getBoundingClientRect();
ssSubRect = $("sssub").getBoundingClientRect();
ssSupRect = $("sssup").getBoundingClientRect();
is(ssBaseRect.bottom, ssSubRect.top, "Bad subscript shift for msubusp");
is(ssBaseRect.top, ssSupRect.bottom, "Bad superscript shift for msubusp");
ssBaseRect = $("ssbase").getBoundingClientRect();
ssSubRect = $("sssub").getBoundingClientRect();
ssSupRect = $("sssup").getBoundingClientRect();
is(ssBaseRect.bottom, ssSubRect.top, "Bad subscript shift for msubusp");
is(ssBaseRect.top, ssSupRect.bottom, "Bad superscript shift for msubusp");
}
SimpleTest.finish();

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

@ -5364,12 +5364,6 @@
value: @IS_NIGHTLY_BUILD@
mirror: always
# Whether to disable subscriptshift and superscriptshift attributes.
- name: mathml.script_shift_attributes.disabled
type: bool
value: @IS_NIGHTLY_BUILD@
mirror: always
# Whether to disable support for XLink on MathML elements.
- name: mathml.xlink.disabled
type: bool