Closed Bug 1788785 Opened 3 years ago Closed 3 years ago

::first-letter font-size seems to be ignored when there is also a ::before, breaking a dropcap effect

Categories

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

defect

Tracking

()

RESOLVED FIXED
106 Branch
Webcompat Priority P3
Tracking Status
firefox106 --- fixed

People

(Reporter: twisniewski, Assigned: emilio)

References

()

Details

Attachments

(2 files)

Attached file testcase.html

See the attached test-case. The first-letter's size seems to be being ignored in Firefox, but not in Chrome or Safari.

This is currently breaking the drop-cap effect at Reuters on Firefox, overlapping the text.

It's not specifically the use of ::before that is the root of the problem here, but rather that the ::before content has position: absolute, which removes it from the flow and should allow ::first-letter to "capture" the following letter L. (Otherwise, ::first-letter would apply to the first letter of the ::before content itself.)

Example using only position: absolute to reproduce the failure of ::first-letter:

data:text/html,<style>p::first-letter{font-size:2em;color:red}</style><p><span style="position:absolute;top:100px">foo</span>bar

Here, Safari and Chrome apply the ::first-letter styling to the "b", but in Firefox no content gets the ::first-letter style.

Tests incoming (if this doesn't cause any existing test to pass).

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/28008334e7f0 Skip placeholders for first-letter-finding code. r=jfkthame
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35768 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: