Closed Bug 1552731 Opened 5 years ago Closed 5 years ago

::first-letter box + float has a higher height than in Chrome/Safari.

Categories

(Core :: Layout: Text and Fonts, defect, P3)

68 Branch
Unspecified
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 290125
Webcompat Priority ?
Tracking Status
firefox68 --- affected

People

(Reporter: karlcow, Unassigned)

References

()

Details

Attachments

(1 file)

Initially reported on https://webcompat.com/issues/30291

Created this test case to reproduce the issue.
https://codepen.io/webcompat/pen/rgzrEL

::first-letter + float create a "different" box height in Safari/Chrome vs Firefox.

I'm not sure who's right there.

Probably a duplicate of previous issues.

See Also: → 415506, 1244447

Yeah, this is a known issue; basically, the long-standing spec for ::first-letter (e.g. see https://drafts.csswg.org/selectors-3/#first-letter) does not precisely specify the result here, it explicitly allows the possibility of making the floated box fit the actual size of the character (as Firefox does) rather than being based on the overall font metrics (as Safari and Chrome do).

In this particular example, I think the Firefox result is visually much better, and illustrates why such behavior is desirable; but unfortunately it's not interoperable, and when authors write their content targeting the Chrome behavior (e.g. by adding negative margins to get rid of the excess whitespace), the result looks poor in Firefox (overlapped text).

The "proper" solution to styling things like this will be the new initial-letter property, but that's not widely implemented yet.

Pretty sure there are existing bugs where this is discussed similarly.

Keywords: dupeme
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: