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

MathML Core #197

Closed
bkardell opened this issue Oct 11, 2022 · 4 comments
Closed

MathML Core #197

bkardell opened this issue Oct 11, 2022 · 4 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@bkardell
Copy link
Contributor

bkardell commented Oct 11, 2022

Description

(split from #147)

This focus-area would aim for improving test scores/support for MathML-Core Level 1 in all browsers.

MathML-Core is, itself, a specification about interoperability and providing a platform integrated definition (subset) of MathML to be supported by browsers. This focus area would specifically target the remaining integration gaps (some CSS integrations, for example) for Level 1.

Rationale

Despite its origins, the web has not prioritized the needs of integrating mathematical text into the platform. The situation has been complex for a long time. All browsers supported the integrations done with the HTML parser, and we had 2 implementations (WebKit and Gecko) with very rough edges, strange oddities and some guesswork where things were unclear. MathML-Core provides stricter definition, clarifies and explains platform integration (IDL/CSS, etc). There is an intent to ship in Chromium currently scheduled for release 109 and have been numerous PRs and work in other engines to align. Without good support, authors are left to rely on significantly large JavaScript libraries in order to render mathematical text, or use images. Neither is a solution that we would encourage for any other kind of text, and both disconnect from all of the other text, layout, scripting, accessibility and other integrations of the platform.

While many users will not encounter them in the 'waft and weft' of daily web use, support for it is critical and important. Students online need good math support. Our ability to share so many things is affected - there are millions of math equations in Wikipedia alone.

It is currently the 4th most starred Blink issue (up from 5th not long ago), see https://bugs.chromium.org/p/chromium/issues/list?can=2&q=component:Blink&sort=-stars&colspec=ID%20Stars%20Pri%20Status%20Component%20Opened%20Summary.

It would be ideal to make sure that in 2023 we focus on making this very highly interoperable.

Specification

W3C https://w3c.github.io/mathml-core/
Also a few bits in WHATWG https://html.spec.whatwg.org/
and https://www.w3.org/TR/css-fonts-4/

Tests

https://wpt.fyi/results/mathml?label=master&label=experimental&aligned&view=subtest&q=mathml
(note that at least a small number of these tests are testing things that were dropped from L1)

@bkardell bkardell added the focus-area-proposal Focus Area Proposal label Oct 11, 2022
@foolip foolip moved this to Proposed in Interop 2023 Oct 11, 2022
@NSoiffer
Copy link

Specific ask

To bridge the gap between full MathML and MathML Core, I have written a number of "polyfills". These polyfills assume MathML Core support exists in the browsers. Additionally, the MathML full spec (which we hope to advance to CR late next year), assumes MathML core is implemented in the browsers in which people read the spec. The spec uses the polyfills to illustrate the element.

One feature the transforms assume is that CSS support on MathML elements exists. However, Firefox and Safari are both missing that support.

The polyfill support for menclose heavily relies on CSS (example page).

Chrome

In Chrome, before clicking "apply transform", it looks like:
image

After clicking, it looks like:
image(1)

Firefox and Safari

Firefox and Safari implement a lot, but not all, of the MathML full menclose options. The polyfill tests for a number of features before running, so the before version doesn't look too bad. However, arrows (the second row) are not implemented. So in Firefox (Safari is similar), after clicking on "Apply Transform", you see:
image(3)

Notice the lack of arrows in the second row.

Specifics

The CSS used for menclose can be found at the start of the menclose JS file.

Elementary math also makes use of CSS. The CSS needed for that is at the start of the elementary math JS file.

There are some wpt tests for MathML CSS, but they don't cover all the uses found in the polyfills.

@fred-wang
Copy link

fred-wang commented Nov 3, 2022

The original report only mentions MathML tests, but we should really also include related CSS tests. The MathML Core spec actually uses a different link includes mathml, css and html folders. The HTML contains the majority of the tests (~21400) but most of them are just testing HTML entity names, so they are a bit overrepresented. Moreover, most of remaining failures in the HTML tests seem unrelated to MathML Core. I think we can focus on MathML and CSS tests instead.

html/canvas (2)

html/syntax (42)

  • 4 tests for speculative parsing of <math><script src=... and <math><font>... failing in Chrome/Safari (Chrome and Safari don't (fully) implement speculative parsing).

html/the-xhtml-syntax (21356)

  • Passing in Chrome/Safari/Firefox!

css/css-contain (1)

  • Passing in Chrome/Safari/Firefox!

css/css-content (1)

css/css-display (17)

  • 2 tests for computed display: math on ::before and ::after failing in Chrome (TODO: analyze why)
  • Many tests failing in Firefox/Safari (display: math is not implemented in Firefox and Safari)

css/css-fonts (28)

  • Many tests failing in Firefox/Safari (math-depth/math-style not fully implemented in Firefox and Safari)

css/css-text (19)

  • 17 tests failing in Chrome and 19 in Firefox/Safari (text-transform: math-* not fully implemented, blocked on CSSWG discussions)

mathml/crashtests (86)

  • Passing in Chrome/Firefox/Safari!

mathml/presentation-markup (699)

  • TODO

mathml/relations/css-styling (1214)

attribute-mapping-001.html (160)

  • 1 test failing in Firefox (probably bad default merror style)
  • 32 tests failing in Webkit (due legacy MathML3 attributes)

attribute-mapping-002.html (128)

  • 32 tests failing in Chrome because of incomplete mathvariant/text-transform implementation.
  • 96 tests failing in Sadari/Firefox because of incomplete mathvariant/text-transform and scriptlevel/math-depth implementations.

clip-* (2)

  • verify CSS clipping on MathML elements
  • Some tests failing in Safari/Firefox (TODO: analyze why)

color-* (5)

  • 2 tests failing in Firefox (TODO: analyze why, probably antialiasing artefacts)

default-font-family.html (1)

  • Test failing in Firefox/Safari because they don't implement font-family: math

default-properties-on-semantics-and-maction.html (2)

  • 2 Tests failing in Safari because of legacy semantics/maction implementation.

default-properties-on-the-math-root.html (8)

  • Some tests failing in Firefox and Safari, as they probably don't properly set the properties on the UA sheet.

display-2.html (17)

  • Verify that one can override the display of a MathML element.
  • All tests failing in Firefox/Safari, since they don't support display: math
  • 4 tests failing for ruby and column width in Chrome.

ignored-properties-001.html (298)

  • Verify style with ignored properties (per MathML Core) does not affect MathML layout.
  • Many tests failing in Chrome/Safari/Firefox.
  • See also width-height-001.html below.

lengths-*.html (7)

mathcolor-mathbackground-css.html (1)

  • Failing in Firefox because rgb(...) syntax not supported for mathcolor/mathbackground attributes.

mathsize* (3)

mathvariant-*.html (22)

  • This is related to text-transform above.
  • 20 tests failing in Chrome (mathvariant attribute not fully implemented)
  • 4 test failing in Safari (TODO: analyze why)

mi-fontstyle-fontweight.html (1)

  • Verify that fontstyle/fontweight don't cancel the mathvariant transform on single-char mi elements.
  • Failing in Safari (TODO: analyze why, probably due to legacy support)

not-participating-to-parent-layout.html (158)

  • Verify that display: none and out-of-flow positioned elements do not participate to layout of their parent.
  • Many tests failing in Firefox/Safari as they do not necessarily take these properties into account during layout.

padding-border-margin (208)

  • Verify padding/border/margin on MathML elements
  • All tests failing in Firefox and many in Safari, as these are not fully implemented.

presentational-hints-001.html (1)

  • Verify that local author style wins over presentation hints attributes for some global MathML attributes mapped to style.
  • Failing in Firefox/Safari (TODO: analyze why)

scriptlevel-001.html (15)

  • All tests failing in Safari since scriptlevel is not implemented.
  • 1 test checking dynamic/case-insensitive accent/accentunder failing in Firefox (TODO analyze why)

transform.html

  • Check whether CSS transform property works on MathML.
  • Failing in Firefox/Safari

width-height-001.html (48)

writing-mode (31)

  • A few RTL tests are failing in Firefox and Safari (TODO: analyze why)

mathml/relations/html5-tree (558)

mathml/relations/html5-tree

display-1.html (11)

  • 3 tests failing in Chrome/Firefox/Safari, due to width property affecting display=block math tags.

dynamic-childlist-* (69)

  • These dynamically modify DOM tree of some MathML elements by adding or removing children.
  • Some tests failing in Firefox and Safari.

href-* (3)

  • The 3 tests fail in Chrome, due to lack of support for the href attribute.

math-global-event-handlers.tentative.html

  • 2 tests failing in Chrome (onbeforematch not implemented yet)
  • several tests failing in Firefox/Safari due to (on* event attributes not implemented)

tabindex-*.html (64)

  • 14 tests failing in Chrome (probably due to lack of href)
  • Some tests failing in Safari/Firefox (TODO: analyze why)

mathml/relations/text-and-math (4)

basic-mathematical-alphanumeric-symbols-with-default-font.html

  • This test support for some Mathematical Alphanumeric Symbols with the system fonts.
  • This is failing in Chrome/Firefox because tests are running a Linux system without such fonts.

use-typo-metrics-1.html

  • Verify that the USE_TYPO_METRICS flag from the OS/2 table is taken into account to calculate line height.
  • Failing in Safari, which only takes it into account when a MATH table is present.

@bkardell
Copy link
Contributor Author

bkardell commented Nov 7, 2022

The href-* (3) and tabindex-.html (64) ones should not be part of this as they are not part of Level 1. Likewise the css/css-text (19) mathvariant-.html (22) as well - but the rest of this is the list I was suggesting that focus on MathML-Core L1.

@nairnandu
Copy link
Contributor

Thank you for proposing Math ML Core for inclusion in Interop 2023.

We wanted to let you know that this proposal was not selected to be part of Interop this year. We had many strong proposals, and could not accept them all. This should not be taken as a comment on the technology as a whole, and resubmitting a proposal for this feature as part of a future round of Interop would be welcome.

For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023!

Posted on behalf of the Interop team.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 4, 2023
Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
aarongable pushed a commit to chromium/chromium that referenced this issue Feb 9, 2023
Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Quick-Run: Rob Buis <rbuis@igalia.com>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1103391}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 9, 2023
Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Quick-Run: Rob Buis <rbuis@igalia.com>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1103391}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 9, 2023
Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Quick-Run: Rob Buis <rbuis@igalia.com>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1103391}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Feb 20, 2023
…S width/height are ignored, a=testonly

Automatic update from web-platform-tests
[mathml] Update WPT tests that assume CSS width/height are ignored

Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Quick-Run: Rob Buis <rbuis@igalia.com>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1103391}

--

wpt-commits: 9352b1202118d24b297659cd15dd92a5215a9c05
wpt-pr: 38361
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Feb 23, 2023
…S width/height are ignored, a=testonly

Automatic update from web-platform-tests
[mathml] Update WPT tests that assume CSS width/height are ignored

Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Quick-Run: Rob Buis <rbuis@igalia.com>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1103391}

--

wpt-commits: 9352b1202118d24b297659cd15dd92a5215a9c05
wpt-pr: 38361
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this issue Mar 28, 2023
Math WG decided that width/height should be taken into account on all
MathML elements [1]. This CL updates the following legacy tests that
assume the properties are actually ignored [2]:

* `ignored-properties-001.html`: This test was checking the properties
  are ignored. Remove these checks.

* `width-height-001.html`: This test was checking the elements keep the
  same dimension with or without specifying width, height, inline-size
  or block-size. Change it to actually verify it does take the specified
  dimensions.

* `display-1.html`: This test was checking that the content of a
   `<math display=block>` with a specified width is horizontally
   centered inside a parent div. Now that the width is no longer ignored,
   instead check that it is horizontally centered within the `math`
   element.

More tests will be added in follow-up CLs to further check the effect
of specifying width/height on elements.

[1] w3c/mathml-core#75
[2] web-platform-tests/interop#197 (comment)

Bug: 6606
Change-Id: I6ff46b7589f27cc16ba81db126a4ceaa3a31ef61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4221437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Quick-Run: Rob Buis <rbuis@igalia.com>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1103391}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
No open projects
Status: Proposed
Development

No branches or pull requests

4 participants