VERIFIED FIXED 6418
Incorrect scrollbar when using overflow:auto and word-wrap:break-word; in some cases
https://bugs.webkit.org/show_bug.cgi?id=6418
Summary Incorrect scrollbar when using overflow:auto and word-wrap:break-word; in som...
David Smith
Reported 2006-01-08 00:17:04 PST
The URL is a somewhat simplified and fixed up snippet from an Adium chat (which is displayed in a WebView). Opera 8.5.1 has the rendering I would expect, with no scrollbar (although it does mess up the border slightly). Gecko based browsers don't even get close. Expected result: no horizontal scrollbar, with the text wrapped if necessary to fit. Actual result: horizontal scrollbar that can scroll 1px I originally thought this was another case of http://bugzilla.opendarwin.org/show_bug.cgi?id=5619, but discussions on IRC indicated that it may be a separate bug.
Attachments
Reduced testcase (239 bytes, text/html)
2006-01-08 08:42 PST, mitz
no flags
The opposite case (177 bytes, text/html)
2006-01-11 13:41 PST, mitz
no flags
Proposed patch (17.11 KB, patch)
2006-01-12 13:31 PST, mitz
darin: review+
David Smith
Comment 1 2006-01-08 00:47:46 PST
http://trac.adiumx.com/ticket/267 is the relevant ticket in Adium's bug tracking system.
mitz
Comment 2 2006-01-08 07:49:02 PST
Dave Hyatt has noted in the past that findNextLineBreak contains some suspicious-looking comparisons with width+1 instead of width. I think they're what's causing this bug, since it happens only when the text is one pixel too wide to fit.
mitz
Comment 3 2006-01-08 08:42:17 PST
Created attachment 5545 [details] Reduced testcase Note how "ipsum" stays on the first line, although this results in a RenderText wider than its containing RenderBlock (84 and 83 pixels respectively). Just changing the "width+1" instances to "width" solves this particular problem, but breaks tons of other things. I have a feeling that one way or another the rounding hacks are involved in this bug.
mitz
Comment 4 2006-01-11 13:41:58 PST
Created attachment 5608 [details] The opposite case Despite the +1, premature line-breaking can happen too. In this case, "Dolor" is broken into two lines in TOT and shipping WebKit. Eliminating the "single character but not single-character run" case from the WebTextRenderer rounding hack logic when fixing bug 5414 may have increased the likelihood of this happening, but as you can check, it happened even before. I'm working on a fix...
mitz
Comment 5 2006-01-12 13:31:16 PST
Created attachment 5627 [details] Proposed patch
Darin Adler
Comment 6 2006-01-12 21:48:16 PST
Comment on attachment 5627 [details] Proposed patch Looks great. Nice to get rid of the always-false appliedEndWidth boolean along with fixing this. r=me
Note You need to log in before you can comment on or make changes to this bug.