Open Bug 1670705 Opened 4 years ago Updated 3 years ago

[css-text] 'overflow-wrap: anywhere' should break between unbreakable inlines

Categories

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

defect

Tracking

()

People

(Reporter: leon, Unassigned)

References

Details

(Keywords: parity-chrome, testcase, Whiteboard: [layout:backlog:quality])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36

Steps to reproduce:

CSS (applies to both):

#inner {
  width: 300px;
  word-break: break-word;
}

.unit {
  white-space: nowrap;
}

HTML 1:

<div id="inner">
  <span class="unit">
    <span>Group One:</span>
    <span>One</span>
    <span>Two</span>
    <span>Three</span>
  </span>
  <span class="unit">
    <span>Group Two:</span>
    <span>Four</span>
    <span>Five</span>
    <span>Six</span>
  </span>
  <span class="unit">
    <span>Group Three:</span>
    <span>Seven</span>
    <span>Eight</span>
    <span>Nine</span>
  </span>
</div>

HTML 2:

<div id="inner"><span class="unit"><span>Group One:</span><span>One</span><span>Two</span><span>Three</span></span><span class="unit"><span>Group Two:</span><span>Four</span><span>Five</span><span>Six</span></span><span class="unit"><span>Group Three:</span><span>Seven</span><span>Eight</span><span>Nine</span></span></div>

Actual results:

They break out of their parent's container instead of being wrapped.

Expected results:

They only difference between the two code-examples is [HTML-Whitespace][1]-placement and they should, except for the whitespaces, render identically. While this is the case in Chrome, in Firefox they break out of their parent's container.

SO question: https://stackoverflow.com/q/64319943/7910454

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core
Attached file Testcase #1
Blocks: 1505786
Severity: -- → S2
Status: UNCONFIRMED → NEW
Component: Layout: Text and Fonts → Layout: Block and Inline
Ever confirmed: true
Keywords: testcase
OS: Unspecified → All
Priority: -- → P3
Hardware: Unspecified → All
Summary: Word-break property ignored when no HTML-whitespace is present → [css-text] 'overflow-wrap: anywhere' should break between unbreakable inlines
Version: Firefox 81 → Trunk

I think this is roughly the same bug as bug 1593385, because the spec says:

break-word: As for anywhere except that soft wrap opportunities introduced by break-word are not considered when calculating min-content intrinsic sizes.

https://drafts.csswg.org/css-text-3/#propdef-overflow-wrap
(so using break-word instead in Testcase #1, the second <div> should have all text on one line and it should fit that text, but the first <div> should layout the same.)

(Chrome has the correct rendering in both cases.)

See Also: → 1593385
Keywords: parity-chrome
Whiteboard: [layout:backlog:quality]
Severity: S2 → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: