Created attachment 368592 [details] Test case to reproduce the issue What steps will reproduce the problem? (1) Load the attached test case What is the expected result? The line is broken before the last letter before the slash "X|X/X" (see expected.png) What happens instead? The line is broken before the slash character "XX|/X" (see actual.png)
Created attachment 368595 [details] Test case to reproduce the issue
Created attachment 368597 [details] Actual result
Created attachment 368598 [details] Expected result
According to the unicode rules UAX#14 breaking opportunities around slash characters are only possible after, not before, the character. https://www.unicode.org/reports/tr14/#SY "The SY line breaking property is intended to provide a break opportunity after, except in front of digits, so as to not break “1/2” or “06/07/99”."
Looks like our behavior matches Chrome's but not Firefox's.
(In reply to Myles C. Maxfield from comment #5) > Looks like our behavior matches Chrome's but not Firefox's. Whoops, I was mixed up. Our behavior matches Firefox's but not Chrome's.
There's a big comment about this in the table in BreakLines.cpp that refers to https://bugs.webkit.org/show_bug.cgi?id=37698
(In reply to Myles C. Maxfield from comment #7) > There's a big comment about this in the table in BreakLines.cpp that refers > to https://bugs.webkit.org/show_bug.cgi?id=37698 I still think Chrome's behavior is correct and this bug report is valid, but admit I've got doubts, so I'd appreciate any feedback you can provide so that I can understand the issue better. I could try to file a bug in Firefox, if there isn't any already, so that we can gather feedback. It'd be good to improve interoperability in these kind of cases.
Looks like Chrome has the same table that we do, except for a difference in one line: https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/rendering/BreakLines.cpp#L53 https://github.com/chromium/chromium/blob/master/third_party/blink/renderer/platform/text/text_break_iterator.cc#L124 The line that's different is: { B(1, 1, 1, 1, 1, 1, 1, 1), B(1, 1, 1, 0, 1, 0, 1, 0), 0, B(0, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1) }, // - Note: breaking before '0'-'9' is handled hard-coded in shouldBreakAfter(). vs { B(0, 1, 1, 0, 1, 1, 1, 1), B(0, 1, 1, 0, 1, 0, 0, 0), 0, B(0, 0, 0, 1, 1, 1, 0, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 1) }, // - Note: breaking before '0'-'9' is handled hard-coded in shouldBreakAfter(). It looks like the Chrome line was modified in: https://codereview.chromium.org/2490153002 https://codereview.chromium.org/1370203005 and the WebKit line was modified in: https://bugs.webkit.org/show_bug.cgi?id=185899