Bug 41103 - Consider matching either Firefox or IE better in the characters that allow a linewrap
Summary: Consider matching either Firefox or IE better in the characters that allow a ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
Depends on: 20677 27074 27195
  Show dependency treegraph
Reported: 2010-06-23 14:44 PDT by Tab Atkins
Modified: 2012-08-23 15:42 PDT (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Tab Atkins 2010-06-23 14:44:01 PDT
Firefox 3.6 (and possibly earlier) treats the forward slash "/" as creating a linebreak opportunity for the linewrap algorithm.  IE8 (and possibly earlier) treats the open square bracket "[" as creating a linebreak opportunity for the linewrap algorithm.  Webkit does neither.  This causes the PCWorld page at http://www.pcworld.com/article/168658/seven_reasons_microsofts_profits_are_tanking.html to break, as a comment at the bottom of the page contains a very long line with no spaces, but several forward slashes and square brackets.

We should match either Firefox or IE here, or perhaps both, in their linebreak-opportunity seeking.

Minimal test case:

Expected Result: The long line breaks before the second and fourth forward slashes, and doesn't stretch the left float.  (This works as expected in Firefox.  Replace the / with [ for it to work as expected in IE.)
Actual Result: The long line doesn't break at all, stretching the left float underneath the right float and off the side of the monitor for most people.
Comment 1 Aryeh Gregor 2010-06-23 15:30:34 PDT
This is covered by Unicode TR14:


I don't think any browser fully implements that (why not?).  It appears to say that breaks are prohibited before class SY, which contains U+002F SOLIDUS (LB13), and prohibited after SY if it's followed by a digit (LB25), but otherwise permitted (LB31).  Breaks between alphanumerics (AL and NU) and opening punctuation like [ (OP) are prohibited by LB30, contradicting IE's behavior.

It would be cool if the full algorithm were implemented.  It contains a lot of useful advice, like "don't break before '!', even after a space" (common in French).  It doesn't seem complicated at all to implement -- does it have major problems?
Comment 2 Eric Seidel (no email) 2010-10-20 10:39:44 PDT
bug 25638 may also be related.
Comment 3 Eric Seidel (no email) 2010-10-20 10:40:45 PDT
Simple reduction:
<div style="width: 10px">
Comment 4 Eric Seidel (no email) 2010-10-20 10:41:13 PDT
Several dups in Chromium: