Bug 156839

Summary: Resetting CSS properties on the <math> element
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 155433, 156840, 160074    
Bug Blocks: 195797    

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:

https://dxr.mozilla.org/mozilla-central/source/layout/mathml/mathml.css#16

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):

https://dxr.mozilla.org/mozilla-central/source/modules/libpref/init/all.js
Comment 1 Frédéric Wang (:fredw) 2022-11-10 09:13:09 PST
Let's make it a duplicate of bug 247738.

We should just align with MathML Core here.

*** This bug has been marked as a duplicate of bug 247738 ***