Bug 147976 - initial-letter fails to exclude text around glyph bounding box
Summary: initial-letter fails to exclude text around glyph bounding box
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.9
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-08-13 08:07 PDT by Dave Cramer
Modified: 2022-07-24 13:47 PDT (History)
9 users (show)

See Also:


Attachments
HTML file showing crash between italic initial letter and subsequent text. (594 bytes, text/html)
2015-08-13 08:07 PDT, Dave Cramer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Cramer 2015-08-13 08:07:32 PDT
Created attachment 258888 [details]
HTML file showing crash between italic initial letter and subsequent text.

If an initial letter is created using a glyph that extends beyond the em box, the initial letter may overlap document text. The spec says, "Text is therefore excluded around the glyph bounding boxes of the initial letters." [1] 

Testing with an italic initial letter can sometimes show this problem (test file attached). Some fonts (especially script fonts like Zapfino which may have negative side bearing) are also good test candidates. 

Dave

[1] https://drafts.csswg.org/css-inline/#initial-letter-exclusions
Comment 1 Radar WebKit Bug Importer 2015-09-29 12:22:37 PDT
<rdar://problem/22901550>
Comment 2 Ahmad Saleem 2022-07-24 11:20:39 PDT
If from above attached test case, I remove -webkit- then all browsers behave same but if I keep -webkit- then "J" initial letter is big italic and remaining characters 'udge' touches "J".

-webkit- removed JSFiddle - https://jsfiddle.net/5wsq6han/show/

I followed MDN article and also changed the size in fraction from 5 to 5.0 and then also added back -webkit-:

Link - https://jsfiddle.net/ohcuv580/show

But Safari and all other browser still differ, other browser don't support "initial-letter" as per - https://developer.mozilla.org/en-US/docs/Web/CSS/initial-letter

We are trying to aligning with any web-spec? Since other browsers don't even support it. Just wanted to to share update. Thanks!
Comment 3 Ryosuke Niwa 2022-07-24 13:47:51 PDT
I think this is config changed given the unprefixed version behaves correctly with other browsers.