diff --git a/dom/base/nsDeprecatedOperationList.h b/dom/base/nsDeprecatedOperationList.h index 7787579d5f09..2f9d55e39701 100644 --- a/dom/base/nsDeprecatedOperationList.h +++ b/dom/base/nsDeprecatedOperationList.h @@ -53,4 +53,5 @@ DEPRECATED_OPERATION(MathML_DeprecatedAlignmentAttributes) DEPRECATED_OPERATION(MathML_DeprecatedLineThicknessValue) DEPRECATED_OPERATION(MathML_DeprecatedMathSizeValue) DEPRECATED_OPERATION(MathML_DeprecatedMathSpaceValue) +DEPRECATED_OPERATION(MathML_DeprecatedMencloseNotationRadical) DEPRECATED_OPERATION(MathML_DeprecatedStyleAttribute) diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index dfc213064c85..667121095f52 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -378,5 +378,7 @@ MathML_DeprecatedMathSizeValueWarning=“small”, “normal” and “big” ar # LOCALIZATION NOTE: Do not translate veryverythinmathspace, verythinmathspace, # thinmathspace, mediummathspace, thickmathspace, verythickmathspace, veryverythickmathspace and MathML. 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 element and will 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. diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp index a84c790aa5ff..063d62a63ce7 100644 --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -9,6 +9,7 @@ #include "gfx2DGlue.h" #include "gfxUtils.h" #include "mozilla/PresShell.h" +#include "mozilla/StaticPrefs_mathml.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/PathHelpers.h" #include "nsPresContext.h" @@ -105,9 +106,12 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation) { mNotationsToDraw += NOTATION_RIGHT; mNotationsToDraw += NOTATION_TOP; } else if (aNotation.EqualsLiteral("radical")) { - rv = AllocateMathMLChar(NOTATION_RADICAL); - NS_ENSURE_SUCCESS(rv, rv); - mNotationsToDraw += NOTATION_RADICAL; + if (!StaticPrefs::mathml_deprecated_menclose_notation_radical_disabled()) { + mContent->OwnerDoc()->WarnOnceAbout(dom::Document::eMathML_DeprecatedMencloseNotationRadical); + rv = AllocateMathMLChar(NOTATION_RADICAL); + NS_ENSURE_SUCCESS(rv, rv); + mNotationsToDraw += NOTATION_RADICAL; + } } else if (aNotation.EqualsLiteral("box")) { mNotationsToDraw += NOTATION_LEFT; mNotationsToDraw += NOTATION_RIGHT; diff --git a/layout/mathml/nsMathMLmsqrtFrame.h b/layout/mathml/nsMathMLmsqrtFrame.h index 78197ecabda3..2b0529ccae9e 100644 --- a/layout/mathml/nsMathMLmsqrtFrame.h +++ b/layout/mathml/nsMathMLmsqrtFrame.h @@ -33,6 +33,9 @@ class PresShell; + + + diff --git a/layout/reftests/mathml/reftest.list b/layout/reftests/mathml/reftest.list index 6659b6f75b24..721a1f876461 100644 --- a/layout/reftests/mathml/reftest.list +++ b/layout/reftests/mathml/reftest.list @@ -17,7 +17,7 @@ fuzzy-if(skiaContent,0-2,0-529) == 393760-2.xml 393760-2-ref.xml == dir-1.html dir-1-ref.html pref(mathml.deprecated_alignment_attributes.disabled,false) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == dir-2.html dir-2-ref.html # Bug 1392106 random-if(gtkWidget) == dir-3.html dir-3-ref.html # bug 1309426 -== dir-4.html dir-4-ref.html +pref(mathml.deprecated_menclose_notation_radical.disabled,false) == dir-4.html dir-4-ref.html == dir-5.html dir-5-ref.html fuzzy-if(cocoaWidget,0-135,0-56) == dir-6a.html dir-6a-ref.html == css-spacing-1.html css-spacing-1-ref.html @@ -207,7 +207,7 @@ fuzzy-if(skiaContent,0-1,0-80) fuzzy-if(Android,0-255,0-105) skip-if(winWidget) == mathml-mmultiscript-mprescript.html mathml-mmultiscript-mprescript-ref.html != menclose-1a.html menclose-1-ref.html != menclose-1b.html menclose-1-ref.html -!= menclose-1c.html menclose-1-ref.html +pref(mathml.deprecated_menclose_notation_radical.disabled,false) != menclose-1c.html menclose-1-ref.html != menclose-1d.html menclose-1-ref.html != menclose-1e.html menclose-1-ref.html != menclose-1f.html menclose-1-ref.html @@ -240,7 +240,7 @@ random-if(gtkWidget) == menclose-2-roundedbox.html menclose-2-roundedbox-ref.htm == menclose-2-phasorangle.html menclose-2-phasorangle-ref.html == menclose-3-box.html menclose-3-box-ref.html == menclose-3-madruwb.html menclose-3-madruwb-ref.html -fails-if(Android) == menclose-3-radical.html menclose-3-radical-ref.html # Bug 973917 +pref(mathml.deprecated_menclose_notation_radical.disabled,false) fails-if(Android) == menclose-3-radical.html menclose-3-radical-ref.html # Bug 973917 == menclose-3-default.html menclose-3-default-ref.html == menclose-3-invalid.html menclose-3-invalid-ref.html == menclose-3-multiple.html menclose-3-multiple-ref.html @@ -255,7 +255,7 @@ fuzzy-if(d2d,0-7,0-1) == menclose-5-downdiagonalstrike.html menclose-5-downdiago == menclose-5-left.html menclose-5-left-ref.html == menclose-5-longdiv.html menclose-5-longdiv-ref.html == menclose-5-madruwb.html menclose-5-madruwb-ref.html -== menclose-5-radical.html menclose-5-radical-ref.html +pref(mathml.deprecated_menclose_notation_radical.disabled,false) == menclose-5-radical.html menclose-5-radical-ref.html == menclose-5-right.html menclose-5-right-ref.html fuzzy-if(skiaContent,0-5,0-5) == menclose-5-roundedbox.html menclose-5-roundedbox-ref.html == menclose-5-top.html menclose-5-top-ref.html @@ -272,7 +272,7 @@ fuzzy-if(d2d,0-7,0-1) == menclose-6-downdiagonalstrike.html menclose-6-ref.html == menclose-6-left.html menclose-6-ref.html == menclose-6-longdiv.html menclose-6-ref.html == menclose-6-madruwb.html menclose-6-ref.html -== menclose-6-radical.html menclose-6-ref.html +pref(mathml.deprecated_menclose_notation_radical.disabled,false) == menclose-6-radical.html menclose-6-ref.html == menclose-6-right.html menclose-6-ref.html fuzzy-if(skiaContent,0-2,0-3) == menclose-6-roundedbox.html menclose-6-ref.html == menclose-6-top.html menclose-6-ref.html diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 6c046978e018..36287a209d2e 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -5301,6 +5301,12 @@ value: @IS_NIGHTLY_BUILD@ mirror: always +# Whether to disable deprecated "radical" notation for the menclose element. +- name: mathml.deprecated_menclose_notation_radical.disabled + type: bool + value: @IS_NIGHTLY_BUILD@ + mirror: always + # Whether to disable legacy MathML number values that are not valid CSS numbers # (e.g. "1234.") - name: mathml.legacy_number_syntax.disabled diff --git a/testing/web-platform/meta/mathml/__dir__.ini b/testing/web-platform/meta/mathml/__dir__.ini index 045a97ebf216..ac615b787b0e 100644 --- a/testing/web-platform/meta/mathml/__dir__.ini +++ b/testing/web-platform/meta/mathml/__dir__.ini @@ -1 +1 @@ -prefs: [mathml.deprecated_style_attributes.disabled: true, mathml.legacy_number_syntax.disabled: true, mathml.mathsize_names.disabled:true, mathml.mathspace_names.disabled: true, mathml.mfrac_linethickness_names.disabled:true, mathml.nonzero_unitless_lengths.disabled:true, mathml.deprecated_alignment_attributes.disabled: true] +prefs: [mathml.deprecated_style_attributes.disabled: true, mathml.deprecated_menclose_notation_radical.disabled: true, mathml.legacy_number_syntax.disabled: true, mathml.mathsize_names.disabled:true, mathml.mathspace_names.disabled: true, mathml.mfrac_linethickness_names.disabled:true, mathml.nonzero_unitless_lengths.disabled:true, mathml.deprecated_alignment_attributes.disabled: true] \ No newline at end of file diff --git a/testing/web-platform/meta/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html.ini b/testing/web-platform/meta/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html.ini deleted file mode 100644 index 2a204149a1e3..000000000000 --- a/testing/web-platform/meta/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[legacy-menclose-radical-notation.html] - expected: FAIL diff --git a/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation-ref.html b/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation-ref.html index f0b5bdd9f04e..b03b1b544ef3 100644 --- a/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation-ref.html +++ b/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation-ref.html @@ -15,6 +15,9 @@ 123 + + 123 + diff --git a/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html b/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html index d7f0627059ad..9b71389e74dd 100644 --- a/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html +++ b/testing/web-platform/tests/mathml/presentation-markup/menclose/legacy-menclose-radical-notation.html @@ -5,7 +5,7 @@ Legacy menclose radical notation - +