[Webkit-unassigned] [Bug 17427] Line breaking opportunities at the end of a text node are missed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Sep 16 17:25:05 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=17427


Alex Henrie <alexhenrie24 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #164327|                            |review?, commit-queue?
               Flag|                            |




--- Comment #6 from Alex Henrie <alexhenrie24 at gmail.com>  2012-09-16 17:25:33 PST ---
Created an attachment (id=164327)
 --> (https://bugs.webkit.org/attachment.cgi?id=164327&action=review)
Proposed patch

I've written a patch that fixes this bug. It determines whether or not a line break is possible immediately before a text node by running the line-breaking algorithm on a temporary string made from the first two UChars of that text node and the last two UChars of the preceding text node. I chose this approach over adding a 'context' parameter to TextBreakIterator for two reasons: First, I could not figure out how to combine two UChar* strings into a UText without allocating a new string and copying them both into it, and second, because it would have required much more intrusive changes for a dubious benefit.

I noticed that my patch causes LayoutTests/fast/text/international/003.html and LayoutTests/fast/text/international/text-combine-image-test.html to "fail". I believe that my patch actually makes the rendering of 003.html more correct because it correctly allows a line break between the number 20 and the character 日. As far as text-combine-image-test.html, I do not believe that this page renders correctly with or without the patch because the text should render in a single vertical column, the same as if it had no markup. For what it's worth, I think the page looks a little nicer with the patch than without.

Even if you think there is a better approach, could this patch be accepted as an interim solution? This bug needs to be fixed to make the best use of limited screen space on mobile devices, for consistency with other web browsers and applications in general, and for web applications such as [1] that require line breaking to be consistent.

[1] http://meta.wikimedia.org/wiki/User:Remember_the_dot/Syntax_highlighter

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list