Closed Bug 1674839 Opened 5 years ago Closed 5 years ago

Trimmable line-initial space is not ignored when computing min-width

Categories

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

defect

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(2 files)

Attached file white-space-3.html —

See attached testcase (based on an element of the existing white-space-2 reftest). Note that the table cell should shrink-wrap its contents.

There are two spaces between the words "Hi" and "Kitty". The first has white-space:pre-wrap, and the second has white-space:nowrap. We break the line after the first space (we can't break after the second one because of nowrap), so the second space is at the beginning of the second line.

Being line-initial whitespace (and not white-space:pre) it is trimmed for rendering, so the word "Kitty" appears left-aligned. However, we fail to ignore the width of the space when computing the minimum inline-size of the line, and therefore the table cell ends up wider than necessary, with spurious blank space after "Kitty".

FWIW, Chrome gets this right. (Safari gets it wrong, although in a different way than we do.)

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b1e9eae14a74 Skip trimmable whitespace after a line-break when computing min inline-width for a textframe. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: