Closed Bug 1554998 Opened 7 months ago Closed 7 months ago

CSS word-break: break-all is ignored with numeric string


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

67 Branch



Tracking Status
firefox-esr60 --- unaffected
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- fixed
firefox69 --- fixed


(Reporter: websec02.g02, Assigned: jfkthame)




(Keywords: parity-chrome, parity-safari, regression)


(1 file)

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

Steps to reproduce:

Visit the following jsfiddle URL.

Actual results:

The long numeric-looking strings are not wrapped though "word-break: break-all" and "white-space: pre-wrap" are there.

Expected results:

The strings should be wrapped.

Firefox 67.0 ... NOT wrapped
Firefox 56.0.2 ... wrapped
Chrome 74.0.3729.169 ... wrapped
Safari 12.0.3 ... wrapped

The bug can be reproduce only with numeric-looking string.

Regression window:

Regressed by: a93501fc792253187394e8cf8c1cfd18fcee88ff Jonathan Kew — Bug 1358019 - Reimplement word-break:break-all to better match the CSS Text spec. r=masayuki

Component: Untriaged → Layout: Text and Fonts
Ever confirmed: true
Product: Firefox → Core
Regressed by: 1358019

Interesting: it appears to be the presence of the commas in the numeric strings here that results in the problem; with the commas removed, so that the strings are purely digits, it wraps as expected:

Priority: -- → P3

The problem here occurs because I missed handling CLASS_NUMERIC characters appropriately in bug 1358019; adding that fixes the issue.

(While here, I also noticed that the numeric class is not mapped appropriately in sUnicodeLineBreakToClass, so let's fix that -- although currently the digits will be handled by the old gLBClassXX tables, so we're not actually using that mapping.)

Pushed by
Fix the handling of numeric characters by word-break:break-all. r=masayuki
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Assignee: nobody → jfkthame

Worth to fix in beta 68 for ESR and Fennec?

For comment 7.

Flags: needinfo?(jfkthame)

Yes, I think this would be worth uplifting; although the scenario probably isn't common, it's a trivial fix for a regression that could disrupt layout in some cases.

Flags: needinfo?(jfkthame)

Comment on attachment 9068304 [details]
Bug 1554998 - Fix the handling of numeric characters by word-break:break-all. r=masayuki

Beta/Release Uplift Approval Request

  • User impact if declined: Regression in line-wrapping behavior when word-break:break-all is used, can disrupt layout that depends on shrink-wrapping (e.g. table cells, floats)
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): trivial fix to add a missing character class to conditionals
  • String changes made/needed: n/a
Attachment #9068304 - Flags: approval-mozilla-beta?

Comment on attachment 9068304 [details]
Bug 1554998 - Fix the handling of numeric characters by word-break:break-all. r=masayuki

line breaking tweak for 68.0b7

Attachment #9068304 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.