diff --git a/browser/base/content/test/static/browser_misused_characters_in_strings.js b/browser/base/content/test/static/browser_misused_characters_in_strings.js index b8da986d2f63..4191cc966e4c 100644 --- a/browser/base/content/test/static/browser_misused_characters_in_strings.js +++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js @@ -57,6 +57,17 @@ let gExceptionsList = [ key: "ImportMapExternalNotSupported", type: "single-quote", }, + { + file: "dom.properties", + key: "MathML_DeprecatedMathVariantWarning", + type: "single-quote", + }, + // dom.properties is packaged twice so we need to have two exceptions for this string. + { + file: "dom.properties", + key: "MathML_DeprecatedMathVariantWarning", + type: "single-quote", + }, ]; /** diff --git a/dom/base/nsDeprecatedOperationList.h b/dom/base/nsDeprecatedOperationList.h index 61b587e90c24..56178fa7a131 100644 --- a/dom/base/nsDeprecatedOperationList.h +++ b/dom/base/nsDeprecatedOperationList.h @@ -48,6 +48,7 @@ DEPRECATED_OPERATION(MozInputSource) DEPRECATED_OPERATION(InitMouseEvent) DEPRECATED_OPERATION(InitNSMouseEvent) DEPRECATED_OPERATION(MathML_DeprecatedMathSpaceValue) +DEPRECATED_OPERATION(MathML_DeprecatedMathVariant) DEPRECATED_OPERATION(MathML_DeprecatedStixgeneralOperatorStretching) DEPRECATED_OPERATION(FormSubmissionUntrustedEvent) DEPRECATED_OPERATION(ElementSetCapture) diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index bfb4a2160980..5b6114b22b7b 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -389,6 +389,8 @@ InitNSMouseEventWarning=initNSMouseEvent() is deprecated. Use the MouseEvent() c # 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 mathvariant or MathML. %S is the deprecated value of the mathvariant attribute. +MathML_DeprecatedMathVariantWarning=“mathvariant='%S'” on MathML elements is deprecated and will be removed at a future date. # LOCALIZATION NOTE: Do not translate MathML and STIXGeneral. %S is a documentation URL. MathML_DeprecatedStixgeneralOperatorStretchingWarning=Support for rendering stretched MathML operators with STIXGeneral fonts is deprecated and may be removed at a future date. For details about newer fonts that will continue to be supported, see %S FormSubmissionUntrustedEventWarning=Form submission via untrusted submit event is deprecated and will be removed at a future date. diff --git a/dom/mathml/MathMLElement.cpp b/dom/mathml/MathMLElement.cpp index a46ee33ece5f..08b7571f26a1 100644 --- a/dom/mathml/MathMLElement.cpp +++ b/dom/mathml/MathMLElement.cpp @@ -519,6 +519,20 @@ void MathMLElement::MapGlobalMathMLAttributesInto( StyleMathVariant::Stretched}; for (uint32_t i = 0; i < ArrayLength(sizes); ++i) { if (str.LowerCaseEqualsASCII(sizes[i])) { + if (values[i] != StyleMathVariant::Normal) { + // Warn about deprecated mathvariant attribute values. Strictly + // speaking, we should also warn about mathvariant="normal" if the + // element is not an . However this would require exposing the + // tag name via aBuilder. Moreover, this use case is actually to + // revert the effect of a non-normal mathvariant value on an + // ancestor element, which should consequently have already + // triggered a warning. + AutoTArray params; + params.AppendElement(str); + aBuilder.Document().WarnOnceAbout( + dom::DeprecatedOperations::eMathML_DeprecatedMathVariant, false, + params); + } aBuilder.SetKeywordValue(eCSSProperty__moz_math_variant, values[i]); break; } diff --git a/layout/mathml/tests/mochitest.ini b/layout/mathml/tests/mochitest.ini index ad0b78f08f16..6ac097c46eed 100644 --- a/layout/mathml/tests/mochitest.ini +++ b/layout/mathml/tests/mochitest.ini @@ -2,6 +2,7 @@ support-files = file_disabled_iframe.html +[test_bug1845461.html] [test_bug330964.html] [test_bug553917.html] [test_bug827713-2.html] diff --git a/layout/mathml/tests/test_bug1845461.html b/layout/mathml/tests/test_bug1845461.html new file mode 100644 index 000000000000..26076602c1e0 --- /dev/null +++ b/layout/mathml/tests/test_bug1845461.html @@ -0,0 +1,36 @@ + + + + + Test for Bug 1845461 + + + + + + + Mozilla Bug 1845461 + A + A + +