New issue
Advanced search Search tips

Issue 687659 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 282134
Owner: ----
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

<span> may prevents the break opportunity before it

Reported by arthur20...@gmail.com, Feb 1 2017

Issue description

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

Example URL:
https://zh.wikipedia.org/w/index.php?oldid=42990868

Steps to reproduce the problem:
1. Open the page
2. Look for the list of drugs in the infobox to the right, starting with "benzquinamide、​LP-12、​LP-211、​LP-44" as of the time of reporting
3. count line lengths, and ask ...

(Reproduced with guest profile; output acceptable on Firefox and MS Edge)

What is the expected behavior?
There are a bunch of better opportunities for line-breaking then Chrome's current choice. The IDEOGRAPHIC COMMA (、) used for listings, for example, should be prioritized over both hyphens and breaking between CJK ideographs.

What went wrong?
Chrome picked some pretty bad locations for line-breaking.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 57.0.2987.19  Channel: dev
OS Version: 10.0
Flash Version: Shockwave Flash 24.0 r0

I actually tried adding <wbr> after these ideographic backward commas, but apparently it conveys no sense of priority.

 

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

Components: -Blink Blink>Layout

Comment 2 by e...@chromium.org, Feb 2 2017

Labels: -Type-Bug Type-Feature
Owner: kojii@chromium.org
Status: Assigned (was: Unconfirmed)
We might want to add IDEOGRAPHIC COMMA to the list of breakable characters.

Comment 3 by kojii@chromium.org, Feb 2 2017

Cc: kojii@chromium.org
Labels: -Pri-2 Pri-3
Owner: ----
Status: Available (was: Assigned)
Summary: Prioritized break opportunities (was: Bad line-breaking with )
I don't have Windows to test at this moment but Chrome and Firefox breaks the same way on Mac.

There are some discussion on implementing prioritized break opportunities, but no browsers have done it yet. That said, if you see differences between Chrome and Firefox/Edge, it's a coincidence. You will see opposite cases in other pages.
Ugh.. By the way I tried a &#8203; (ZWSP) instead of a <wbr>.
> I don't have Windows to test at this moment but Chrome and Firefox breaks the same way on Mac.

They render differently, but the difference is subtle in the page provided by the reporter.

The attached file is a minimum reproducible example of this issue. The punctuation itself doesn't matter, what matters here is that:
* there is a <span> or <a> or some inline element wrapping the text, and
* the punctuation connects a CJK character and a latin character.

(I can understand this kind of bug, because I know handling line breaking on boundary of inline element is indeed very tricky :)
test.html
130 bytes View Download

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

Attaching a screenshot from #5, this looks like a bug, where a Latin word followed by "no-break-before" character can overflow.

But is this what comment #0 talking about? I may misunderstand, but since #0 isn't talking about overflow, I guess #5 is different issue from #0.
crbug687659-c5.png
888 bytes View Download

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

Labels: -Type-Feature Type-Bug
Summary: <span> after IDEOGRAPHIC COMMA prevents the break opportunity (was: Prioritized break opportunities)
I think I understand the problem. The problem is common across platforms, but easier to see on Windows.

IE/Edge breaks after ")" even without a space following it. This makes "​7-hydroxy-2-(di-N-propylamino)tetralin" to break nicely on IE/Edge.

Other than that, further minimized test case from #5:
http://jsbin.com/dedimod/edit?html
The <span> should not affect line break in this case.

Comment 8 by kojii@chromium.org, Feb 5 2017

Summary: <span> may prevents the break opportunity before it (was: <span> after IDEOGRAPHIC COMMA prevents the break opportunity)
Can reproduce with &#8203; too.

Comment 9 by kojii@chromium.org, Feb 5 2017

Mergedinto: 282134
Status: Duplicate (was: Available)
Since Wikipedia permalinks can still change as transcluded templates change (and I may do some more poking around), here is an archive.is archive of the link provided above, generated just now: https://archive.fo/bKAAH
The duplicated issue was fixed, thank you for reporting this issue.

Sign in to add a comment