2011-06-13 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jun 2011 00:19:39 +0000 (00:19 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Jun 2011 00:19:39 +0000 (00:19 +0000)
commit47daabcab7bc8430d5abeea42df0e3514944d174
tree73a8d4027590f96d2b523d3b0cb0ff5699992659
parent888c3c84c07e0893591a2495e8dc9c25e55dfbff
2011-06-13  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by David Hyatt.

        Trailing tabs in a textarea become unselectable under certain conditions
        https://bugs.webkit.org/show_bug.cgi?id=54598

        The bug was caused by WebKit's erroneously collapsing leading whitespace when white-space is
        set to pre-wrap. Per CSS 2.1 spec section 16.1.1, leading whitespace should not be removed
        in this case.

        See also: http://www.w3.org/TR/CSS2/text.html#white-space-model

        Fixed the bug by adding an extra argument to shouldCollapseWhiteSpace, indicating whether
        whitespace is leading or trailing. It defaults to leading because 16.1.1 does not allow allow
        collapsing of whitespace anywhere but at the end of each line.

        Test: fast/text/pre-wrap-trailing-tab.html

        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::shouldCollapseWhiteSpace): Added WhitespacePosition as an argument. Returns false
        when whitespacePosition is not TrailingWhitespace even if white-space is pre-wrap.
        (WebCore::requiresLineBox): Takes WhitespacePosition as an argument and passes it to
        shouldCollapseWhiteSpace.
        (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Calls requiresLineBox.
        (WebCore::RenderBlock::LineBreaker::skipTrailingWhitespace): Ditto.
        (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace): Ditto.
2011-06-13  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by David Hyatt.

        Trailing tabs in a textarea become unselectable under certain conditions
        https://bugs.webkit.org/show_bug.cgi?id=54598

        Added a test to ensure Webkit renders leading whitespace when white-space is set to pre-wrap
        and word-wrap is set to break-word.

        Also rebaselined few tests because WebKit now renders leading whitespace in those tests.

        * fast/text/pre-wrap-trailing-tab-expected.txt: Added.
        * fast/text/pre-wrap-trailing-tab.html: Added.
        * http/tests/misc/acid3-expected.txt:
        * platform/mac/fast/forms/basic-textareas-expected.txt:
        * platform/mac/fast/forms/basic-textareas-quirks-expected.txt

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/pre-wrap-trailing-tab-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/pre-wrap-trailing-tab.html [new file with mode: 0644]
LayoutTests/http/tests/misc/acid3-expected.txt
LayoutTests/platform/mac/fast/forms/basic-textareas-expected.txt
LayoutTests/platform/mac/fast/forms/basic-textareas-quirks-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlockLineLayout.cpp