WebCore:
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2007 19:18:01 +0000 (19:18 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2007 19:18:01 +0000 (19:18 +0000)
commit4cf94d0864e6f7bef8579ba2bc80d462ac406a22
treef60be9bcd7c616045bf0e9e89b1580cc7c1c73bd
parentcacadca6c096b65e58875f472e8a22c2e17188fa
WebCore:

        Reviewed by Darin.

        <rdar://problem/5057506> Double-clicking after ToDo content doesn't select the paragraph break

        * editing/Selection.cpp:
        (WebCore::Selection::validate):
        Moved the code that moves across a paragraph boundary
        when expanding selections by word granularity from
        endOfWord to here.
        In the word and paragraph granularity cases, if the
        end of the selection is at the end of the last paragraph
        in the last cell of a block table, expand it so that
        it ends at the start of the paragraph after the table,
        instead of just after the table, so that ToDo content
        gets the same double/tripled click behavior that normal
        paragraphs get (added two testcases).
        When expanding the selection to include paragraph
        breaks, pass VisiblePosition::next true so that it
        doesn't change editability.
        * editing/VisiblePosition.cpp:
        (WebCore::VisiblePosition::next): Renamed the bool because it's now also
        used to keep non-editable positions non-editable.
        (WebCore::VisiblePosition::previous): Ditto.
        (WebCore::VisiblePosition::lastPositionWithSameEditabilityAtOrBefore):
        Renamed this function and made it also work with non-editable positions.
        (WebCore::VisiblePosition::firstPositionWithSameEditabilityAtOrAfter):
        Ditto.
        * editing/VisiblePosition.h:
        * editing/visible_units.cpp:
        (WebCore::endOfWord): Called the renamed function.
        (WebCore::previousWordPosition): Ditto.
        (WebCore::nextWordPosition): Ditto.
        (WebCore::startOfLine): Ditto.
        (WebCore::endOfLine): Ditto.
        (WebCore::previousSentencePosition): Ditto.
        (WebCore::nextSentencePosition): Ditto.

LayoutTests:

        Reviewed by Darin.

        <rdar://problem/5333725> -webkit-user-select: none makes selection difficult

        * editing/selection/5057506-2.html: Added.
        * editing/selection/5057506.html: Added.
        * platform/mac/editing/selection/5057506-2-expected.checksum: Added.
        * platform/mac/editing/selection/5057506-2-expected.png: Added.
        * platform/mac/editing/selection/5057506-2-expected.txt: Added.
        * platform/mac/editing/selection/5057506-expected.checksum: Added.
        * platform/mac/editing/selection/5057506-expected.png: Added.
        * platform/mac/editing/selection/5057506-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/selection/5057506-2.html [new file with mode: 0644]
LayoutTests/editing/selection/5057506.html [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/5057506-2-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/5057506-2-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/5057506-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/5057506-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/5057506-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/editing/selection/5057506-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/Selection.cpp
WebCore/editing/VisiblePosition.cpp
WebCore/editing/VisiblePosition.h
WebCore/editing/visible_units.cpp