WebCore:
authorjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2007 02:55:44 +0000 (02:55 +0000)
committerjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2007 02:55:44 +0000 (02:55 +0000)
commitce39cfadf9dd57067642e65195d6dc769f2e93cb
tree75c737e26c0e8cc56080c6cf45642e262fe2a848
parent170c278b9fd8b45e6864587da70d98bb6a5e7167
WebCore:

        Reviewed by Oliver Hunt.

        <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection

        Still need to fix similar issues with the other operations that iterate
        over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).

        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
        * editing/IndentOutdentCommand.h: Removed an unused function.
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::modifyRange):
        Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
        Call the new selectionForParagraphIteration, which a) prevents operations like this
        one from being performed on a table that isn't fully selected (where the selection
        starts just before the table and ends inside it), and b) helps prevent paragraph
        iteration from going past the end of the selection.
        Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
        since when v is in the last paragraph of the last cell of a table, that expression
        will return the position after the table, not the start of the next paragraph.
        * editing/htmlediting.cpp:
        (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
        take effect inside the table cell where they are performed.
        (WebCore::selectionForParagraphIteration): Added, see above.
        (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
        * editing/htmlediting.h:
        * editing/visible_units.cpp:
        (WebCore::startOfNextParagraph): Added, see above.
        * editing/visible_units.h:
        * editing/TextIterator.h:
        (WebCore::TextIterator::exitNode): Added a FIXME.

LayoutTests:

        Reviewed by Oliver Hunt.

        <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection

        * editing/execCommand/5543472-1-expected.txt: Added.
        * editing/execCommand/5543472-1.html: Added.
        * editing/execCommand/5543472-2-expected.txt: Added.
        * editing/execCommand/5543472-2.html: Added.
        * editing/execCommand/5543472-3-expected.txt: Added.
        * editing/execCommand/5543472-3.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/execCommand/5543472-1-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/5543472-1.html [new file with mode: 0644]
LayoutTests/editing/execCommand/5543472-2-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/5543472-2.html [new file with mode: 0644]
LayoutTests/editing/execCommand/5543472-3-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/5543472-3.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/IndentOutdentCommand.cpp
WebCore/editing/IndentOutdentCommand.h
WebCore/editing/InsertListCommand.cpp
WebCore/editing/TextIterator.cpp
WebCore/editing/htmlediting.cpp
WebCore/editing/htmlediting.h
WebCore/editing/visible_units.cpp
WebCore/editing/visible_units.h