12011-03-08 Levi Weintraub <leviw@chromium.org>
2
3 Reviewed by NOBODY (OOPS!).
4
5 InsertUnorderedList over a non-editable region and multiple lines enters an infinite loop
6 https://bugs.webkit.org/show_bug.cgi?id=53409
7
8 Fixing broken handling of mixed-editability content for InsertListCommand.
9
10 Test: editing/execCommand/insert-list-with-noneditable-content.html
11
12 * editing/CompositeEditCommand.cpp:
13 (WebCore::CompositeEditCommand::cleanupAfterDeletion): Changed signature to take the destination
14 position for the active editing command. Without this, there are cases when the destination happens
15 to be a placeholder, and we remove it.
16 (WebCore::CompositeEditCommand::moveParagraphs):
17 * editing/CompositeEditCommand.h:
18 * editing/InsertListCommand.cpp:
19 (WebCore::InsertListCommand::doApply): Added logic to the paragraph iteration loop to handle pockets of
20 non-editable content in an editable context. Previously, this could cause an infinite loop.
21 (WebCore::InsertListCommand::isStartOfInsignificantRegion): When iterating over paragraphs with mixed
22 editability content for editing commands, there are special cases (e.g. the boundary between two non-
23 editable spans) that shouldn't be treated as a paragraph.
24 * editing/visible_units.cpp:
25 (WebCore::startOfParagraph): Added a mode of operation where we'll jump across non-editable
26 content in the same paragraph to reach the actual editable paragraph start.
27 (WebCore::endOfParagraph): Ditto.
28 (WebCore::startOfNextParagraph): Now uses the aforementioned non-editable content skipping mode of
29 endOfParagraph.
30