LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Feb 2007 14:10:31 +0000 (14:10 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Feb 2007 14:10:31 +0000 (14:10 +0000)
commit498b3ea9276b989c237162b2b857a750da85fb0f
tree002c67f6bcdbf00504c747aa9679a5f59fcecad8
parent5e309c97e91496667dcb12613dd36ff78309f845
LayoutTests:

        Reviewed by Hyatt.

        - test for http://bugs.webkit.org/show_bug.cgi?id=12726
          REGRESSION (r12073): Text wraps in the middle of a word instead of wrapping at the space before the word

        * fast/text/break-word-expected.checksum: Added.
        * fast/text/break-word-expected.png: Added.
        * fast/text/break-word-expected.txt: Added.
        * fast/text/break-word.html: Added.

WebCore:

        Reviewed by Hyatt.

        - fix http://bugs.webkit.org/show_bug.cgi?id=12726
          REGRESSION (r12073): Text wraps in the middle of a word instead of wrapping at the space before the word

        Test: fast/text/break-word.html

        The wrapW variable used to keep track of the width of the characters scanned
        so far by adding up the widths of individual characters. Because of the
        rounding hack, the total ended up being bigger than the width of the same characters
        when measured together as a single run.

        The fix is to use wrapW only as an upper bound, and once it overflows the line's width,
        fall back on measuring everything from the beginning of the line as one run.

        * rendering/bidi.cpp:
        (WebCore::RenderBlock::findNextLineBreak): Implemented the above fix, including not measuring
        additional single characters once wrapW overflows the line. Also moved the assignment
        to breakNBSP out of the loop since it is constant for the entire text object, made breakWords and
        midWordBreak update only when they might change, and cleaned up a few things.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/break-word-expected.checksum [new file with mode: 0644]
LayoutTests/fast/text/break-word-expected.png [new file with mode: 0644]
LayoutTests/fast/text/break-word-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/break-word.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/bidi.cpp