Bug 131946

Summary: Bounding box is wrong for texts with leading
Product: WebKit Reporter: abaldeva
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
two sample html reproducing the bugs none

Description abaldeva 2014-04-21 13:06:58 PDT
Hi,

It seems like bounding box for the text is not correct when the text is using a font with high leading value. This can be reproduced in Safari 6.x/7.x on Mac. I have attached two sample cases. In fontleading1.html, you'll find that the accent on the character goes over the border. In the 2nd, the ascent goes beyond the grey background.

Upon my investigation, the WinCairo port does not suffer from this problem. I noted that the TextMetric returned by windows system API returned 0 for external leading and ascent value appeared as if it already included the external leading into it (so turns out to be normal baseline value). I'd also like to note that the Chrome on PC does not exhibit the bug but Chrome on OS X exhibits the same issue. So it could be an issue of system level API. Normally, the external leading on Windows is not included in ascent calculation however seems like it does in case of this particular font (based on watching values in debugger). 

--Arpit
Comment 1 abaldeva 2014-04-21 13:07:46 PDT
Created attachment 229823 [details]
two sample html reproducing the bugs
Comment 2 abaldeva 2014-04-21 14:17:05 PDT
On 2nd thoughts, this appears to be a data bug which Windows API is able to fix internally. 

Marking the bug as invalid.