New issue
Advanced search Search tips

Issue 687338 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Min-content width for 'word-break: break-word' should not be the same as 'break-all'

Reported by jesssto...@fastmail.com, Jan 31 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8

Example URL:
https://jsfiddle.net/ticky/n2my41q5/

Steps to reproduce the problem:
1. Have a table cell element with nested non-text content nominally wider than the requested width of the table, and the following CSS styles applied to the cell;
{
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

-or-

1. go to https://jsfiddle.net/ticky/n2my41q5/

What is the expected behavior?
The text should be forcibly wrapped, and the table thus capped at 900px wide.

What went wrong?
The text fails to wrap until the penultimate character, at which point the table is over ten times the requested width.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes 55.0.2883.95

Does this work in other browsers? Yes

Chrome version: 56.0.2924.76 (Official Build) (64-bit)  Channel: stable
OS Version: OS X 10.12.3
Flash Version: 

This is inconsistent with the behaviour of all other browsers, and previous Chrome versions, including latest versions of Safari (and the current Developer Preview) and Opera. In Firefox, similar behaviour is achieved using “break-all” instead of “break-word,” though neither work correctly in Chrome.

Chrome 56.0.2924.76 fails this test!
Chrome 58.0.2998.0 canary fails this test!
Chrome 55.0.2883.95 passes this test.
Opera 42.0.2393.517 passes this test.
Safari 10.0.3 passes this test.
Safari Technology Preview (Release 22 (Safari 10.2, WebKit 12604.1.4.2)) passes this test.

 

Comment 1 by woxxom@gmail.com, Feb 1 2017

Bisect:
426945 (good) - 426949 (bad), 56.0.2899.0
https://chromium.googlesource.com/chromium/src/+log/e3a2cd35..a1fc3eb5?pretty=fuller
Suspecting r426946 "Fix max preferred width for LayoutText when break-all" - see  issue 655590 

Comment 2 by bokan@chromium.org, Feb 1 2017

Cc: bokan@chromium.org
Labels: -Type-Bug Type-Bug-Regression
Owner: kojii@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the bisect. Over to kojii@ to decide where to go from here

Comment 3 by bokan@chromium.org, Feb 1 2017

Components: -Blink Blink>Layout

Comment 4 by kojii@chromium.org, Feb 7 2017

Labels: OS-Android OS-Chrome OS-Linux OS-Windows
Status: Started (was: Assigned)
Summary: Min-content width for 'word-break: break-word' should not be the same as 'break-all' (was: Regression in `word-break` behaviour in Chrome 56)
Project Member

Comment 5 by bugdroid1@chromium.org, Feb 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eb5a8c59e9f3121d5c0dc92b2539f86f847eb295

commit eb5a8c59e9f3121d5c0dc92b2539f86f847eb295
Author: kojii <kojii@chromium.org>
Date: Tue Feb 07 22:27:18 2017

Fix min-content sizing for 'word-break: break-word'

This patch fixes min-content[1] sizing for 'word-break: break-word'.

The fix for  crbug.com/655590  computes min-content sizing for
'break-word' the same as 'break-all', even though these two values have
different break opportunities as per the spec[2].

Due to this, when 'break-word' is applied to text which 'break-all' does
not allow break, such as a long sequence of '.' (FULL STOP, a.k.a.
period,) the min-content becomes too long.

[1] https://drafts.csswg.org/css-sizing/#min-content
[2] https://drafts.csswg.org/css-text-3/#word-break-property

BUG= 687338 

Review-Url: https://codereview.chromium.org/2681633002
Cr-Commit-Position: refs/heads/master@{#448744}

[add] https://crrev.com/eb5a8c59e9f3121d5c0dc92b2539f86f847eb295/third_party/WebKit/LayoutTests/fast/css3-text/css3-word-break/word-break-break-word-fit-content-expected.html
[add] https://crrev.com/eb5a8c59e9f3121d5c0dc92b2539f86f847eb295/third_party/WebKit/LayoutTests/fast/css3-text/css3-word-break/word-break-break-word-fit-content.html
[modify] https://crrev.com/eb5a8c59e9f3121d5c0dc92b2539f86f847eb295/third_party/WebKit/Source/core/layout/LayoutText.cpp

Comment 6 by kojii@chromium.org, Feb 7 2017

Status: Fixed (was: Started)
Thank you for reporting this issue to us.

Sign in to add a comment