Bug 1783998 - Remove MathML preference script_shift_attributes. r=emilio

- Remove script_shift_attributes preference and related test, warning
  message and parsing.
- Do not remove subscriptshift/supscripshift atoms, since they are
  still needed for nsTreeSanitizer.

Differential Revision: https://phabricator.services.mozilla.com/D154195
This commit is contained in:
Frederic Wang 2022-08-25 09:03:58 +00:00
Родитель f832ff9ad3
Коммит 79e3532d7f
7 изменённых файлов: 1 добавлений и 115 удалений

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

@ -52,7 +52,6 @@ DEPRECATED_OPERATION(MathML_DeprecatedLineThicknessValue)
DEPRECATED_OPERATION(MathML_DeprecatedMathSizeValue)
DEPRECATED_OPERATION(MathML_DeprecatedMathSpaceValue)
DEPRECATED_OPERATION(MathML_DeprecatedMfencedElement)
DEPRECATED_OPERATION(MathML_DeprecatedScriptShiftAttributes)
DEPRECATED_OPERATION(MathML_DeprecatedStyleAttribute)
DEPRECATED_OPERATION(MathML_DeprecatedStixgeneralOperatorStretching)
DEPRECATED_OPERATION(MathML_DeprecatedScriptminsizeAttribute)

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

@ -386,8 +386,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 MathML or mfenced.
MathML_DeprecatedMfencedElement=MathML element mfenced is deprecated 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 STIXGeneral. %S is a documentation URL.

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

@ -99,47 +99,6 @@ 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::DeprecatedOperations::eMathML_DeprecatedScriptShiftAttributes);
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::DeprecatedOperations::eMathML_DeprecatedScriptShiftAttributes);
ParseNumericValue(value, &supScriptShift, 0, PresContext(),
mComputedStyle, fontSizeInflation);
}
}
return PlaceMultiScript(PresContext(), aDrawTarget, aPlaceOrigin,
aDesiredSize, this, subScriptShift, supScriptShift,
fontSizeInflation);

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

@ -6,7 +6,6 @@ support-files =
[test_bug553917.html]
[test_bug706406.html]
[test_bug827713-2.html]
[test_bug827713.html]
[test_bug975681.html]
[test_disabled.html]
[test_opentype-axis-height.html]

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

@ -1,63 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=706406
-->
<head>
<title>Test for Bug 706406</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=827713">Mozilla Bug 827713</a>
<p id="display"></p>
<p><math>
<msub subscriptshift="50px">
<mspace width="50px" height="25px" depth="25px" mathbackground="blue" id ="subbase"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="red" id="subsub"></mspace>
</msub>
</math></p>
<p><math>
<msup superscriptshift="50px">
<mspace width="50px" height="25px" depth="25px" mathbackground="blue" id="supbase"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="green" id="supsup"></mspace>
</msup>
</math></p>
<p><math>
<msubsup subscriptshift="50px" superscriptshift="50px">
<mspace width="50px" height="25px" depth="25px" mathbackground="blue" id="ssbase"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="red" id="sssub"></mspace>
<mspace width="50px" height="25px" depth="25px" mathbackground="green" id="sssup"></mspace>
</msubsup>
</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");
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");
}
SimpleTest.finish();
</script>
</pre>
</body>
</html>

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

@ -8729,12 +8729,6 @@
value: true
mirror: always
# Whether to disable subscriptshift and superscriptshift attributes.
- name: mathml.script_shift_attributes.disabled
type: bool
value: true
mirror: always
# Whether to disable the scriptminsize attribute.
# Note that this only disables parsing, not the default effect when no attribute
# is unspecified.

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

@ -1 +1 @@
prefs: [mathml.scriptsizemultiplier_attribute.disabled: true, mathml.scriptminsize_attribute.disabled: true, mathml.mathspace_names.disabled: true, mathml.mfrac_linethickness_names.disabled:true, mathml.deprecated_alignment_attributes.disabled: true, mathml.script_shift_attributes.disabled: true, mathml.mfrac_bevelled_attribute.disabled: true, mathml.mfenced_element.disabled: true, layout.css.math-style.enabled: true]
prefs: [mathml.scriptsizemultiplier_attribute.disabled: true, mathml.scriptminsize_attribute.disabled: true, mathml.mathspace_names.disabled: true, mathml.mfrac_linethickness_names.disabled:true, mathml.deprecated_alignment_attributes.disabled: true, mathml.mfrac_bevelled_attribute.disabled: true, mathml.mfenced_element.disabled: true, layout.css.math-style.enabled: true]