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: http://svn.webkit.org/repository/webkit/trunk@25421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed