Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"small" "normal" "big" values of mathsize #7

Closed
fred-wang opened this issue Feb 14, 2019 · 14 comments
Closed

"small" "normal" "big" values of mathsize #7

fred-wang opened this issue Feb 14, 2019 · 14 comments
Labels
compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes need specification update Issues requiring specification changes

Comments

@fred-wang
Copy link

fred-wang commented Feb 14, 2019

The proposal is to remove/deprecate these attribute values.

In any case "small" and "big" values are NOT accurately specified:
"The values "small" and "big" choose a size smaller or larger than the current font size, but leave the exact proportions unspecified; "normal" is allowed for completeness, but since it is equivalent to "100%" or "1em", it has no effect. "

@physikerwelt
Copy link
Member

See also #4

@fred-wang fred-wang added MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification labels Feb 22, 2019
@fred-wang
Copy link
Author

MathML Core does not really define mathsize yet, but the schema currently mentions these values.

@fred-wang fred-wang added the css / html5 Issues related to CSS or HTML5 interoperability label Feb 22, 2019
@fred-wang
Copy link
Author

fred-wang commented Mar 14, 2019

cc @rwlbuis, @emilio :

The values were removed from the MathML schema in w3c/mathml-core@bbc0f8a ; we agreed not to add them back to core.

I'm leaving this open because it still remains to:

  • Remove WPT tests if any.
  • Send intent-to-remove to mozilla/webkit-dev mailing lists (maybe old Math WG too?).
  • Remove browser implementation.
  • Decide what to do for the full MathML spec (remove values? deprecate them? specify explicit numbers?).
  • Add polyfill to https://github.com/mathml-refresh/mathml-polyfills (e.g. convert to mathsize="NUMBER%").

@fred-wang fred-wang added the compatibility Issues affecting backward compatibility label Mar 20, 2019
@fred-wang
Copy link
Author

Decision is to keep in MathML full but note in main spec that non core features will require polyfills so you may not want to use them. https://lists.w3.org/Archives/Public/public-mathml4/2019Mar/0026.html

@fred-wang
Copy link
Author

Resolution:

Specification:

  • Add a deprecation warning in Full?

Implementation:

Polyfill:

  • Map them to numeric lengths.
  • Maybe use CSS variables for user customization?

Tests:

  • Remove WPT tests or check that these values are not supported.

@fred-wang fred-wang added need implementation update need polyfill Issues requiring implementation changes need specification update Issues requiring specification changes need tests Issues related to writing WPT tests labels May 16, 2019
@NSoiffer
Copy link
Contributor

NSoiffer commented May 20, 2019

MathPlayer uses the values: 0.8, 1.0, 1.25 for small, normal, big, respectively.

Note: specification of mathsize takes priority over fontsize.

@fred-wang
Copy link
Author

These are not in core ( #7 (comment) ) ; @davidcarlisle can you please check full and update it if needed?

@fred-wang fred-wang removed the need specification update Issues requiring specification changes label Jun 5, 2019
@NSoiffer
Copy link
Contributor

MathJax uses the values 0.71, 1, 2 for small, normal, big, respectively.

@fred-wang
Copy link
Author

WebKit uses values 0.75em, 1em and 1.5em:
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/mathml/MathMLElement.cpp#L101

Firefox uses the keyword "small", "medium", "large":
https://searchfox.org/mozilla-central/source/dom/mathml/nsMathMLElement.cpp#553
which at the end uses scaling factor 8/9, 1, 6/5:
https://searchfox.org/mozilla-central/source/servo/components/style/values/specified/font.rs#692

As specified in https://drafts.csswg.org/css-fonts-3/#font-size-prop

I think it makes sense for a CSS-based polyfill to use font-size keyword "small", "medium", "large" so that the scaling factor is up to the browser and consistent with CSS.

@samdooley
Copy link
Contributor

Here are the values I used the last time I looked at this (pre-2011, at least)
"xx-small": "60%", //
"x-small": "75%", //
"small": "80%", //
"medium": "100%", //
"large": "120%", //
"x-large": "150%", //
"xx-large": "200%", //
"xxx-large": "300%", //
I do not know what source I used to choose these values.

@fred-wang
Copy link
Author

The proposal we had in previous meeting was to set this in MathML full:

  • Map small to CSS x-small ( 3/4 )
  • Map normal to CSS medium ( 1)
  • Map big to CSS x-large ( 3/2 )

@fred-wang
Copy link
Author

https://lists.w3.org/Archives/Public/public-mathml4/2019Jun/0013.html

ADOPTED Mapping to CSS’s values for x-small (¾), medium (1), and x-large
(3/2)

fred-wang added a commit to web-platform-tests/wpt that referenced this issue Jul 24, 2019
These values have been removed from MathML Core ( w3c/mathml#7 )
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Jul 29, 2019
These values have been removed from MathML Core ( w3c/mathml#7 )
@fred-wang fred-wang removed the need tests Issues related to writing WPT tests label Jul 30, 2019
@fred-wang
Copy link
Author

Test landed: web-platform-tests/wpt#18037

I'm closing this since the remaining work is in implementation (native or polyfill)

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 5, 2019
…ze values, a=testonly

Automatic update from web-platform-tests
MathML: Add tests to check legacy mathsize values (#18037)

These values have been removed from MathML Core ( w3c/mathml#7 )
--

wpt-commits: 54f7b9af46a8a8b6e9d43907d19d3250cbfbc83e
wpt-pr: 18037
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Aug 5, 2019
…ze values, a=testonly

Automatic update from web-platform-tests
MathML: Add tests to check legacy mathsize values (#18037)

These values have been removed from MathML Core ( w3c/mathml#7 )
--

wpt-commits: 54f7b9af46a8a8b6e9d43907d19d3250cbfbc83e
wpt-pr: 18037
@fred-wang
Copy link
Author

fred-wang commented Aug 18, 2019

Polyfill:

window.addEventListener("load", function() {
    const namespaceURI = "http://www.w3.org/1998/Math/MathML";
    Array.from(document.body.
               getElementsByTagNameNS(namespaceURI, "*")).
        forEach(element => {
            if (!element.hasAttribute("mathsize"))
                return;
            var value = element.getAttribute("mathsize").
                replace(/small|normal|big/, match => {
                    switch (match) {
                    case "small": return "75%";
                    case "normal": return "100%";
                    case "big": return "150%";
                    }
                });
            element.setAttribute("mathsize", value);
        });
});

moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 19, 2019
See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1548527
gecko-commit: 3bfee29aef8e9babb5a6c1cb02a78a32a68f9b0c
gecko-integration-branch: autoland
gecko-reviewers: emilio
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 20, 2019
…thsize attribute. r=emilio

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

--HG--
extra : moz-landing-system : lando
fred-wang pushed a commit to web-platform-tests/wpt that referenced this issue Aug 20, 2019
…te. (#18553)

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1548527
gecko-commit: 3bfee29aef8e9babb5a6c1cb02a78a32a68f9b0c
gecko-integration-branch: autoland
gecko-reviewers: emilio
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Aug 20, 2019
…thsize attribute. r=emilio

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

Differential Revision: https://phabricator.services.mozilla.com/D42426
natechapin pushed a commit to natechapin/wpt that referenced this issue Aug 23, 2019
natechapin pushed a commit to natechapin/wpt that referenced this issue Aug 23, 2019
…te. (web-platform-tests#18553)

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1548527
gecko-commit: 3bfee29aef8e9babb5a6c1cb02a78a32a68f9b0c
gecko-integration-branch: autoland
gecko-reviewers: emilio
@fred-wang fred-wang added the need specification update Issues requiring specification changes label Sep 16, 2019
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…ze values, a=testonly

Automatic update from web-platform-tests
MathML: Add tests to check legacy mathsize values (#18037)

These values have been removed from MathML Core ( w3c/mathml#7 )
--

wpt-commits: 54f7b9af46a8a8b6e9d43907d19d3250cbfbc83e
wpt-pr: 18037

UltraBlame original commit: 5bab6e8de4f5cb67ea8763ca35676595070b97d7
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…thsize attribute. r=emilio

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

UltraBlame original commit: 3bfee29aef8e9babb5a6c1cb02a78a32a68f9b0c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…ze values, a=testonly

Automatic update from web-platform-tests
MathML: Add tests to check legacy mathsize values (#18037)

These values have been removed from MathML Core ( w3c/mathml#7 )
--

wpt-commits: 54f7b9af46a8a8b6e9d43907d19d3250cbfbc83e
wpt-pr: 18037

UltraBlame original commit: 5bab6e8de4f5cb67ea8763ca35676595070b97d7
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…ze values, a=testonly

Automatic update from web-platform-tests
MathML: Add tests to check legacy mathsize values (#18037)

These values have been removed from MathML Core ( w3c/mathml#7 )
--

wpt-commits: 54f7b9af46a8a8b6e9d43907d19d3250cbfbc83e
wpt-pr: 18037

UltraBlame original commit: 5bab6e8de4f5cb67ea8763ca35676595070b97d7
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…thsize attribute. r=emilio

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

UltraBlame original commit: 3bfee29aef8e9babb5a6c1cb02a78a32a68f9b0c
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…thsize attribute. r=emilio

See w3c/mathml#7
    and https://groups.google.com/forum/#!topic/mozilla.dev.platform/kyB34PjYXek

    This commit introduces a new preference option
    mathml.mathsize_names.disabled to disable mathsize keyword values. For
    now, these are only disabled in Nightly builds.

    * test_bug553917.html is updated to check that these values now cause an
      error message to be logged into the console when mathsize names are used
      and the feature disabled.
    * The old test 355548-3.xml checks support for mathsize names and also uses
      several features that are going to be deprecated. So it is just run with
      the proper preference adjustment.
    * mathml/relations/css-styling/mathsize-attribute-legacy-values.html passes
      after this change so the test is run with the mathsize names disabled too
      and the failure expectation is removed.
    * mathml/relations/css-styling/mathsize-attribute-css-keywords.html is added
      to check that CSS keywords won't be supported when we switch to using the
      CSS parser in the future. This test passes now when the "small" keyword
      is not accepted so it is run with the mathsize names disabled too.

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

UltraBlame original commit: 3bfee29aef8e9babb5a6c1cb02a78a32a68f9b0c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes need specification update Issues requiring specification changes
Projects
None yet
Development

No branches or pull requests

4 participants