Bug 156840

Summary: More improvements and explanations regarding resetting CSS properties on the <math> element
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Frédéric Wang (:fredw) <fred.wang>
Status: RESOLVED FIXED    
Severity: Normal CC: alex, darin
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 133603    
Bug Blocks: 156837, 156839    
Attachments:
Description Flags
WIP Patch (for EWS testing)
none
Patch darin: review+

Description Frédéric Wang (:fredw) 2016-04-21 02:22:20 PDT
See bug comment 18. This will address:

(In reply to comment #18)
> 1) Indenting.

Will be done here.

> 
> 2) Continuing to use a different list on iOS than on every other platform

ifdef will be removed.

> 3) Removal of many of the font names that were already listed
> 4) Is it really OK to set the font-family without taking font size into
> consideration.
> I don’t think the comment about the wish to have more built-in fonts on OS X
> and iOS adds much here.> 
> Is the change in behavior on OS X really carefully considered? Seems that it
> will now use "serif" and before would have used "Lucida Grande" or maybe
> "Arial Unicode MS"?

I already explained these in bug 133603 comment 19, but I'll update the comment in the CSS refer to

http://trac.webkit.org/wiki/MathML/Fonts

explaining why fonts are necessary, problems with obsolete fonts and importance of customization for consistent rendering (not just the font-size).

> 5) Overriding the font-family but still inheriting the many other
> font-related properties.

I'll add a link to bug 156839.




Additionally, I think I can use @font-face and Ahem to provide a pixel tests checking math font selection.
Comment 1 Frédéric Wang (:fredw) 2016-04-21 04:17:34 PDT
Created attachment 276907 [details]
WIP Patch (for EWS testing)
Comment 2 Frédéric Wang (:fredw) 2016-04-21 05:07:00 PDT
Created attachment 276910 [details]
Patch
Comment 3 Darin Adler 2016-04-21 18:52:26 PDT
Comment on attachment 276910 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=276910&action=review

Seems OK.

It seems really peculiar to list fonts that are almost all available together. Given the discussion here there is clearly a call, longer term, for some clever system to choose which font to use based on which non-math font is being used in the surrounding content.

> Source/WebCore/css/mathml.css:73
> +       We put Cambria Math first since it is pre-installed on Windows 7 and higher.

Not sure I understand the logic here. No reason I can think of to put more-often-installed fonts first.
Comment 4 Frédéric Wang (:fredw) 2016-04-21 22:48:54 PDT
(In reply to comment #3)
> It seems really peculiar to list fonts that are almost all available
> together. Given the discussion here there is clearly a call, longer term,
> for some clever system to choose which font to use based on which non-math
> font is being used in the surrounding content.

Definitely. For now, the idea is to not miss any math font that can be installed on the system.

> > Source/WebCore/css/mathml.css:73
> > +       We put Cambria Math first since it is pre-installed on Windows 7 and higher.
> 
> Not sure I understand the logic here. No reason I can think of to put
> more-often-installed fonts first.

As I said on bug 133603, this is a bit arbitrary... Maybe a better reason is because Cambria Math is pre-installed it has been more tested than the two others.
Comment 5 Frédéric Wang (:fredw) 2016-04-21 22:56:28 PDT
Committed r199869: <http://trac.webkit.org/changeset/199869>
Comment 6 Frédéric Wang (:fredw) 2016-04-24 07:34:33 PDT
(In reply to comment #3)
> It seems really peculiar to list fonts that are almost all available
> together. Given the discussion here there is clearly a call, longer term,
> for some clever system to choose which font to use based on which non-math
> font is being used in the surrounding content.

For the record and future discussions, I've opened an issue in the MathML in HTML5 implementation note:

https://github.com/MathML/MathMLinHTML5/issues/26

Ideally, I'd like CSS properties/keywords that could just be used in the default user agent stylesheet to tell the web engine to perform such clever trick. That way users won't be surprised by a non-CSS compatible behavior or can at least override that behavior if they don't like it.