Bug 156839 - Resetting CSS properties on the <math> element
Summary: Resetting CSS properties on the <math> element
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on: 155433 156840 160074
  Show dependency treegraph
Reported: 2016-04-21 02:11 PDT by Frédéric Wang (:fredw)
Modified: 2016-07-21 23:11 PDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2016-04-21 02:11:01 PDT
Some of this was already done in bug 155433 and we also have been setting font-family to a fixed list of math fonts for a long time. I'm opening this for the record, although I believe we should fix it when they address a real use case as it was the case for CSS spacing and for the need for math fonts.

It may arguable whether we want to reset or not a specific property. For example, someone might want to do <p style="font-weight: bold;">this is a formula <math><mi>x</mi><mo>+</mo><mi>y</mi></math></p> and expects that the formula is bold. However, math formulas use their own italic, bold etc unicode code points (see bug 108778) and math font families are generally not designed to have italic, bold fonts so that would give poor result (see for example https://github.com/khaledhosny/libertinus/issues/20 for a discussion)

As a comparison, Gecko resets more rules like writing-mode or font-style:


Note that font-family in Gecko is reset to serif (btw, math fonts are generally serif and sans-serif unicode code points are reserved for special characters, see bug 108778 again) and the actual selection of the default math font and fallback are listed in font.name.serif.x-math and font.name-list.serif.x-math configurations (accessible from the font preference menu of Firefox):