Skip to content

Commit

Permalink
Remove attributes deprecated from MathML3.
Browse files Browse the repository at this point in the history
See w3c/mathml#5 (comment)
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kl5c87mBlO0

This patch introduces a new preference
mathml.deprecated_style_attributes.disabled in order to disable legacy support
for attributes background, color, fontfamily, fontsize, fontstyle and
fontweight. Note that xlink:href will be handled separately in bug 1575870.

* A new counter and deprecation message is introduced for these attributes.
  In nsMathMLElement, the old WarnDeprecated calls are replaced with a single
  call to WarnOnceAbout for the deprecate attributes. Notice that for some
  reason, the color attribute used to send warning in both ParseAttribute and
  MapMathMLAttributesInto.
* sMtableStyles is removed and replaced with a simple comparison.
* sMathML3Attributes is split into two tables: one for script attributes which
  will be handled in bug 1548471 and one for style attributes, handled here.
  The attributes in this second table is now ignored when the feature flag is
  disabled.
* test_bug553917.html is updated so that it no longer checks the old warning
  messages for these attributes. New warning messages have been verified
  manually.
* Reftests checking support for these attributes are run with the support
  enabled.
* Finally, WPT tests are run with the support disabled and a new test
  is added to verify that these attributes are no longer mapped to CSS.

Differential Revision: https://phabricator.services.mozilla.com/D43111

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1548524
gecko-commit: 69105b8565ce19ceb8c26757d0a81138854f1d13
gecko-integration-branch: autoland
gecko-reviewers: emilio
  • Loading branch information
fred-wang authored and moz-wptsync-bot committed Aug 28, 2019
1 parent 5203de1 commit a7cc505
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion mathml/relations/css-styling/attribute-mapping-001.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Attribute mapping</title>
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#legacy-mathml-style-attributes">
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#attributes-common-to-html-and-mathml-elements">
<meta name="assert" content="Verify that dir, mathcolor, mathbackground and mathsize are mapped to CSS">
<meta name="assert" content="Verify that dir, mathcolor, mathbackground and mathsize are mapped to CSS but that deprecated MathML3 attributes are not.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/mathml/support/mathml-fragments.js"></script>
Expand Down Expand Up @@ -70,6 +70,23 @@
element.setAttribute("mathsize", "30Px");
assert_equals(style.getPropertyValue("font-size"), "30px", "case insensitive");
}, `mathsize on the ${tag} element is mapped to CSS font-size`);

test(function() {
var properties = ["background-color", "color", "fontfamily", "font-size", "font-style", "font-weight"];
var oldStyle = {};
properties.forEach(property => {
oldStyle[property] = style.getPropertyValue(property);
});
element.setAttribute("background", "red");
element.setAttribute("color", "blue");
element.setAttribute("fontfamily", "monospace");
element.setAttribute("fontsize", "50px");
element.setAttribute("fontstyle", "italic");
element.setAttribute("fontweight", "bold");
properties.forEach(property => {
assert_equals(style.getPropertyValue(property), oldStyle[property], `${property}`);
});
}, `deprecated MathML3 attributes on the ${tag} element are not mapped to CSS`);
});

done();
Expand Down

0 comments on commit a7cc505

Please sign in to comment.