WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2008 21:18:26 +0000 (21:18 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2008 21:18:26 +0000 (21:18 +0000)
commitcc8297420fa73500229826b93b7a2b6801b7e16c
tree3d652dbf2937e6b2137fc0d3b0799a03c0d76ea0
parent472907642229d8163f3134c81488bc2a6822b2b7
WebCore:

        Reviewed by Darin Adler.

        - fix https://bugs.webkit.org/show_bug.cgi?id=17921
          Extra white space at the end of right-aligned or justified text with -webkit-line-break: after-white-space

        Test: fast/text/trailing-white-space.html

        Made trailing white space on the line always behave like it has the base
        bidi level of the block, meaning it will always go on the right (left)
        of the line in a left-to-right (right-to-left) block. Made the trailing
        white space vanish when it is next to a margin that the text should
        be touching, and made its width not count when computing the center
        point for center alignment.

        * platform/text/BidiResolver.h:
        (WebCore::::prependRun): Added.
        * rendering/RenderBlock.h:
        * rendering/bidi.cpp:
        (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed the
        logicallyLastRun parameter to an optional trailingSpaceRun and changed
        the alignment logic to implement the above rules.
        (WebCore::RenderBlock::layoutInlineChildren): Added code to identify
        when there is trailing white space that needs to be split into its own
        run and optionally re-ordered.
        (WebCore::RenderBlock::findNextLineBreak): Removed code that split some
        trailing space into a separate run in one special case.

LayoutTests:

        Reviewed by Darin Adler.

        - test and updated results for https://bugs.webkit.org/show_bug.cgi?id=17921
          Extra white space at the end of right-aligned or justified text with -webkit-line-break: after-white-space

        * fast/text/trailing-white-space.html: Added.
        * http/tests/misc/acid3-expected.txt:
        * platform/mac/editing/deleting/delete-block-table-expected.txt:
        * platform/mac/editing/deleting/delete-to-select-table-expected.txt:
        * platform/mac/editing/deleting/deletionUI-single-instance-expected.txt:
        * platform/mac/editing/execCommand/5482023-expected.txt:
        * platform/mac/editing/execCommand/boldSelection-expected.txt:
        * platform/mac/editing/execCommand/italicizeByCharacter-expected.txt:
        * platform/mac/editing/execCommand/modifyForeColorByCharacter-expected.txt:
        * platform/mac/editing/execCommand/print-expected.txt:
        * platform/mac/editing/execCommand/selectAll-expected.txt:
        * platform/mac/editing/execCommand/strikethroughSelection-expected.txt:
        * platform/mac/editing/inserting/editable-html-element-expected.txt:
        * platform/mac/editing/inserting/insert-div-027-expected.txt:
        * platform/mac/editing/pasteboard/5028447-expected.txt:
        * platform/mac/editing/pasteboard/block-wrappers-necessary-expected.checksum:
        * platform/mac/editing/pasteboard/block-wrappers-necessary-expected.png:
        * platform/mac/editing/pasteboard/block-wrappers-necessary-expected.txt:
        * platform/mac/editing/pasteboard/nested-blocks-with-text-area-expected.checksum:
        * platform/mac/editing/pasteboard/nested-blocks-with-text-area-expected.png:
        * platform/mac/editing/pasteboard/nested-blocks-with-text-area-expected.txt:
        * platform/mac/editing/pasteboard/nested-blocks-with-text-field-expected.checksum:
        * platform/mac/editing/pasteboard/nested-blocks-with-text-field-expected.png:
        * platform/mac/editing/pasteboard/nested-blocks-with-text-field-expected.txt:
        * platform/mac/editing/selection/5081257-1-expected.txt:
        * platform/mac/editing/selection/after-line-wrap-expected.txt:
        * platform/mac/editing/selection/mixed-editability-1-expected.txt:
        * platform/mac/editing/selection/select-all-001-expected.txt:
        * platform/mac/editing/selection/select-all-002-expected.txt:
        * platform/mac/editing/selection/select-all-003-expected.txt:
        * platform/mac/editing/style/apple-style-editable-mix-expected.txt:
        * platform/mac/editing/style/create-block-for-style-012-expected.checksum:
        * platform/mac/editing/style/create-block-for-style-012-expected.png:
        * platform/mac/editing/style/create-block-for-style-012-expected.txt:
        * platform/mac/fast/clip/outline-overflowClip-expected.txt:
        * platform/mac/fast/forms/textarea-rows-cols-expected.txt:
        * platform/mac/fast/replaced/width100percent-textarea-expected.txt:
        * platform/mac/fast/text/embed-at-end-of-pre-wrap-line-expected.txt:
        * platform/mac/fast/text/justified-text-rect-expected.txt:
        * platform/mac/fast/text/trailing-white-space-expected.checksum: Added.
        * platform/mac/fast/text/trailing-white-space-expected.png: Added.
        * platform/mac/fast/text/trailing-white-space-expected.txt: Added.
        * platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.txt:
        * platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt:
        * platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/trailing-white-space.html [new file with mode: 0644]
LayoutTests/http/tests/misc/acid3-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-block-table-expected.txt
LayoutTests/platform/mac/editing/deleting/delete-to-select-table-expected.txt
LayoutTests/platform/mac/editing/deleting/deletionUI-single-instance-expected.txt
LayoutTests/platform/mac/editing/execCommand/5482023-expected.txt
LayoutTests/platform/mac/editing/execCommand/boldSelection-expected.txt
LayoutTests/platform/mac/editing/execCommand/italicizeByCharacter-expected.txt
LayoutTests/platform/mac/editing/execCommand/modifyForeColorByCharacter-expected.txt
LayoutTests/platform/mac/editing/execCommand/print-expected.txt
LayoutTests/platform/mac/editing/execCommand/selectAll-expected.txt
LayoutTests/platform/mac/editing/execCommand/strikethroughSelection-expected.txt
LayoutTests/platform/mac/editing/inserting/editable-html-element-expected.txt
LayoutTests/platform/mac/editing/inserting/insert-div-027-expected.txt
LayoutTests/platform/mac/editing/pasteboard/5028447-expected.txt
LayoutTests/platform/mac/editing/pasteboard/block-wrappers-necessary-expected.checksum
LayoutTests/platform/mac/editing/pasteboard/block-wrappers-necessary-expected.png
LayoutTests/platform/mac/editing/pasteboard/block-wrappers-necessary-expected.txt
LayoutTests/platform/mac/editing/pasteboard/nested-blocks-with-text-area-expected.checksum
LayoutTests/platform/mac/editing/pasteboard/nested-blocks-with-text-area-expected.png
LayoutTests/platform/mac/editing/pasteboard/nested-blocks-with-text-area-expected.txt
LayoutTests/platform/mac/editing/pasteboard/nested-blocks-with-text-field-expected.checksum
LayoutTests/platform/mac/editing/pasteboard/nested-blocks-with-text-field-expected.png
LayoutTests/platform/mac/editing/pasteboard/nested-blocks-with-text-field-expected.txt
LayoutTests/platform/mac/editing/selection/5081257-1-expected.txt
LayoutTests/platform/mac/editing/selection/after-line-wrap-expected.txt
LayoutTests/platform/mac/editing/selection/mixed-editability-1-expected.txt
LayoutTests/platform/mac/editing/selection/select-all-001-expected.txt
LayoutTests/platform/mac/editing/selection/select-all-002-expected.txt
LayoutTests/platform/mac/editing/selection/select-all-003-expected.txt
LayoutTests/platform/mac/editing/style/apple-style-editable-mix-expected.txt
LayoutTests/platform/mac/editing/style/create-block-for-style-012-expected.checksum
LayoutTests/platform/mac/editing/style/create-block-for-style-012-expected.png
LayoutTests/platform/mac/editing/style/create-block-for-style-012-expected.txt
LayoutTests/platform/mac/fast/clip/outline-overflowClip-expected.txt
LayoutTests/platform/mac/fast/forms/textarea-rows-cols-expected.txt
LayoutTests/platform/mac/fast/replaced/width100percent-textarea-expected.txt
LayoutTests/platform/mac/fast/text/embed-at-end-of-pre-wrap-line-expected.txt
LayoutTests/platform/mac/fast/text/justified-text-rect-expected.txt
LayoutTests/platform/mac/fast/text/trailing-white-space-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/trailing-white-space-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/trailing-white-space-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.txt
LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
WebCore/ChangeLog
WebCore/platform/text/BidiResolver.h
WebCore/rendering/RenderBlock.h
WebCore/rendering/bidi.cpp