Closed Bug 2067858 Opened 2 months ago Closed 2 months ago

text-box + text-decoration

Categories

(Core :: Layout: Block and Inline, defect)

Firefox 154
defect

Tracking

()

RESOLVED FIXED
157 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox-esr153 --- unaffected
firefox155 --- wontfix
firefox156 --- wontfix
firefox157 --- fixed

People

(Reporter: nileshprajapati, Assigned: sajidanwar)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 external file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.6.2 Safari/605.1.15

Steps to reproduce:

Codepen: https://codepen.io/editor/nileshprajapati/pen/01a0588a-d268-7c4f-a211-0c47f16f669a

  1. Open the Codepen link in a new window.
  2. When comparing Firefox and both Chrome and Safari, the underline bleeds into the second row of the heading when a text box is applied.

Actual results:

The underline adds extra spacing, causing the text to bleed into the second line of the heading.

Expected results:

When the text box is applied, the underline shouldn’t extend into the second row of the heading or cause extra spacing.

Summary: text-box text-decoration → text-box + text-decoration

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Block and Inline' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Block and Inline
Product: Firefox → Core

:sajidanwar, since you are the author of the regressor, bug 2050138, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(sajidanwar94)

Thank you for the report! Looks like text-box-trim when applied on inline elements is shifting the inline content up but not affecting the position of the text decorations (which are in the exact same position as if text-box-trim is not applied).

I should note that this doesn't seem to be an issue if text-box-trim is on the block parent and not on the inline element that has text-decoration: https://codepen.io/editor/kbhomes/pen/01a05ae1-a817-71cf-b483-0852c9dc7e3c. I think this might slightly reduce the severity of the bug, since text-box-trim is not supported on inline elements in Chrome. I suspect the most common scenario where text-box-trim and text-decoration will overlap is going to be with trim on the block and decoration on either the block or a non-trimmed inline child.

Adding myself as needinfo until I can get a patch ready to fix this. Will need to also add WPTs for the combination of text-box-trim and text-decoration as part of that.

Compared to Chrome, the spacing between the text and the underline on each line in Firefox is significantly wider.
However, it appears that the overlap between the text on the second line and the underline on the first line has been resolved.

Fixed range:
https://hg-edge.mozilla.org/integration/autoland/pushloghtml?fromchange=45a2a02d927658999fc97f81588885aedc24869e&tochange=6d85bef9801c986412443ea2fbb3d10aa0915eaf

Depends on: 2063909
Assignee: nobody → sajidanwar94
Status: NEW → ASSIGNED
Flags: needinfo?(sajidanwar94)
Pushed by sajidanwar94@gmail.com: https://github.com/mozilla-firefox/firefox/commit/9bbefdc724d4 https://hg.mozilla.org/integration/autoland/rev/51e42ab44444 Fix text-decoration on inline boxes when text-box-trim is applied. r=layout-reviewers,emilio
Pushed by imoraru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ba8ed7fbbb6f https://hg.mozilla.org/integration/autoland/rev/a1ea13c85af7 Revert "Bug 2067858 - Fix text-decoration on inline boxes when text-box-trim is applied. r=layout-reviewers,emilio" for causing wr failures on text-box-trim-inline-box-text-decoration-002.html.

Revert for causing wr failures on text-box-trim-inline-box-text-decoration-002.html.

Flags: needinfo?(sajidanwar94)
Pushed by sajidanwar94@gmail.com: https://github.com/mozilla-firefox/firefox/commit/9c41da3047b1 https://hg.mozilla.org/integration/autoland/rev/138de394cca8 Fix text-decoration on inline boxes when text-box-trim is applied. r=layout-reviewers,emilio

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/62402 for changes under testing/web-platform/tests

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 157 Branch
Flags: needinfo?(sajidanwar94) → in-testsuite+

The patch landed in nightly and beta is affected.
:sajidanwar, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(sajidanwar94)

Upstream PR merged by moz-wptsync-bot

Flags: needinfo?(sajidanwar94)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: