Intent to prototype: math-style property

90 views
Skip to first unread message

Frédéric Wang

unread,
Sep 19, 2020, 12:36:28 AM9/19/20
to
Summary: Implements the math-style property which indicates whether
MathML equations should render with normal or compact height (this
is similar to TeX's \displaystyle concept). This is already possible
with the MathML's displaystyle attribute but exposing the magic to CSS
provides more flexibility to users. This is already implemented as an
internal -moz-math-display property, so we essentially just need to
rename and expose it.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1665975

Standard:

* https://mathml-refresh.github.io/mathml-core/#the-math-style-property
* https://github.com/w3c/csswg-drafts/issues/5387

Platform coverage: All

Preference: layout.css.math-style.enabled

Devtools bug: N/A: no extra work is required for devtools.

Other browsers:

* Safari: considering ( https://bugs.webkit.org/show_bug.cgi?id=216702
), the MathML displaystyle inheritance was implemented via an internal
structure (when WebKit didn't support internal CSS property), this can
be easily rewritten by implementing the CSS math-style property.

* Chrome: shipped behind the MathMLCore flag (patch landed in
https://chromium-review.googlesource.com/c/chromium/src/+/2100787 ) but
the values must be fixed to match the spec.

web-platform-tests:

- Existing tests use Chromium's values and must be fixed to match the
spec.
- Most of the effects are specific to MathML layout and tested by
https://w3c-test.org/mathml/ (displaystyle mapping to math-style and
effect of displaystyle on MathML layout)
- Tentative CSS tests are available in
https://w3c-test.org/css/css-fonts/math-script-level-and-math-style but
the interaction with the math-level/font-size won't be testable until we
expose -moz-script-level too.

Secure contexts: Like all other CSS selectors these are not restricted
to secure contexts.

Is this feature enabled by default in sandboxed iframes?: Yes


--
Frédéric Wang

Frédéric Wang

unread,
Sep 19, 2020, 12:49:26 AM9/19/20
to
On 19/09/2020 06:36, Frédéric Wang wrote:
> This is already possible
> with the MathML's displaystyle attribute but exposing the magic to CSS
> provides more flexibility to users.

As an example, consider the continued fraction of test 6 in

https://mdn.mozillademos.org/en-US/docs/Mozilla/MathML_Project/MathML_Torture_Test$samples/MathML_Torture_Test

in order to avoid that it behaves like test 7, a displaystyle="true" is
attached on each <mfrac> element. Using a CSS selector to force
math-style: normal; on all the mfrac descendants would be more convenient.

--
Frédéric Wang
Reply all
Reply to author
Forward
0 new messages