RESOLVED FIXED 17475
Error with line break inside ?» pair of characters.
https://bugs.webkit.org/show_bug.cgi?id=17475
Summary Error with line break inside ?» pair of characters.
Dmitriy Kubyshkin
Reported 2008-02-21 08:57:30 PST
Every punctuation symbol excluding '?' works fine in pair with '»', but pair ?» can break into two lines if there isn't enough space in block so ? stays one line and » moved to the next line.
Attachments
test case (311 bytes, text/html)
2008-02-21 23:24 PST, Alexey Proskuryakov
no flags
updated test case (357 bytes, text/html)
2008-02-22 13:39 PST, Alexey Proskuryakov
no flags
Change rules for allowing a line break after a question mark (46.97 KB, patch)
2010-01-25 15:10 PST, mitz
darin: review+
Alexey Proskuryakov
Comment 1 2008-02-21 23:24:59 PST
Created attachment 19274 [details] test case
Alexey Proskuryakov
Comment 2 2008-02-21 23:25:44 PST
Confirmed with r30421.
mitz
Comment 3 2008-02-22 08:50:32 PST
To match WinIE, WebKit always allows lines to break after a question mark.
Alexey Proskuryakov
Comment 4 2008-02-22 13:39:19 PST
Created attachment 19281 [details] updated test case Made the test case work with IE, which didn't respect div width in the original one. I do not see any special behavior for question marks in IE7 here.
mitz
Comment 5 2008-02-22 15:46:49 PST
(In reply to comment #4) > Created an attachment (id=19281) [edit] > updated test case > > Made the test case work with IE, which didn't respect div width in the original > one. I do not see any special behavior for question marks in IE7 here. Interesting! If I replace the quotation mark with a plain Latin letter then IE7 does wrap after the question mark. Apparently IE's behavior is more complex than WebKit's approximation.
mitz
Comment 6 2008-05-21 18:13:44 PDT
*** Bug 19174 has been marked as a duplicate of this bug. ***
mitz
Comment 7 2008-05-21 18:14:19 PDT
Bug 19174 was about the same issue with a question mark followed by a double quotation mark: ?"
mitz
Comment 8 2010-01-23 16:49:00 PST
mitz
Comment 9 2010-01-25 15:10:36 PST
Created attachment 47371 [details] Change rules for allowing a line break after a question mark
Darin Adler
Comment 10 2010-01-25 17:32:06 PST
Comment on attachment 47371 [details] Change rules for allowing a line break after a question mark > +static const unsigned char internetExplorerBreaksBetweenQuestionMarkAnd[] = { I think it would be better to have a size of 0x80 on this array definition. I think it's a bit curious to name this array with a verb as if it was a function. A mathematical way of thinking about an array. Programmers tend to think of them as objects instead. > + // Internet Explorer allows breaking afer a question mark preceding one of a subset of > + // characters in ASCII. For characters outside ASCII, defer to the Unicode algorithm by returning false. This comment should somehow state that the array is used for enhanced speed as well as to match IE. If all we cared about was matching IE, then the code could say just: case '?': return nextCh == '|'; > case '?': > + return nextCh <= 0x7f && internetExplorerBreaksBetweenQuestionMarkAnd[nextCh]; I prefer capital hex, myself. It would be nice if the check here was more tied to the size of the array. r=me
mitz
Comment 11 2010-01-25 22:01:14 PST
Alexey Proskuryakov
Comment 12 2010-02-11 12:23:08 PST
*** Bug 34807 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.