Bug 155879

Summary: Use LayoutUnit values for MathML ascent
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: distler, jfernandez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 161127, 161136, 180151    
Bug Blocks: 132009    
Attachments:
Description Flags
WIP Patch
none
WIP Patch none

Description Frédéric Wang (:fredw) 2016-03-25 03:48:29 PDT
During its layout, MathML renderers use the int value provided by firstLineBaseline to determine the ascent of boxes. For better accuracy, it should use a LayoutUnit value. We can actually do that by introducing a m_ascent member which should help to share code between all the MathML renderer.
Comment 1 Frédéric Wang (:fredw) 2016-03-25 03:49:38 PDT
Created attachment 274897 [details]
WIP Patch
Comment 2 Frédéric Wang (:fredw) 2016-03-25 08:11:11 PDT
Created attachment 274907 [details]
WIP Patch
Comment 3 Frédéric Wang (:fredw) 2016-07-11 22:12:14 PDT
Most of the code use LayoutUnit when calculating the firstLineBaseline but I guess it is still possible to improve that a bit. The WIP patch is probably obsolete but at least it provides an idea.
Comment 4 Frédéric Wang (:fredw) 2016-08-24 07:00:59 PDT
I'm not exactly sure why firstLineBaseline() must return an (Optional) int for MathML (besides the fact that MathML renderer classes used to derive from flexboxes). I think we want to use LayoutUnit as much as possible.

I'm making this depends on bug 161136 and bug 161127 which allow to implement firstLineBaseline() without having to store LayoutUnit members and keep them updated. In general, it seems that performing a simple computation is always better than having to use a (possible not up-to-date class member).

I'm cc'int Jacques Distler as he reported an issue with the alignment of attachment 286836 [details] that I suspect is due to this bug (but I was not able to reproduce it).