Index: Source/core/editing/CompositeEditCommand.cpp |
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp |
index f456fa0014244e3124c813e2aa781e97ad98b674..3f7dbda700826d1073970146ea919be2071ab335 100644 |
--- a/Source/core/editing/CompositeEditCommand.cpp |
+++ b/Source/core/editing/CompositeEditCommand.cpp |
@@ -31,9 +31,9 @@ |
#include "core/dom/Document.h" |
#include "core/dom/DocumentFragment.h" |
#include "core/dom/DocumentMarkerController.h" |
+#include "core/dom/ElementTraversal.h" |
#include "core/dom/NodeTraversal.h" |
#include "core/dom/Range.h" |
-#include "core/events/ScopedEventQueue.h" |
#include "core/dom/Text.h" |
#include "core/editing/AppendNodeCommand.h" |
#include "core/editing/ApplyStyleCommand.h" |
@@ -61,6 +61,7 @@ |
#include "core/editing/WrapContentsInDummySpanCommand.h" |
#include "core/editing/htmlediting.h" |
#include "core/editing/markup.h" |
+#include "core/events/ScopedEventQueue.h" |
#include "core/html/HTMLElement.h" |
#include "core/frame/Frame.h" |
#include "core/rendering/InlineTextBox.h" |
@@ -1283,8 +1284,8 @@ bool CompositeEditCommand::breakOutOfEmptyListItem() |
if (!newBlock) |
newBlock = createDefaultParagraphElement(document()); |
- RefPtr<Node> previousListNode = emptyListItem->isElementNode() ? toElement(emptyListItem)->previousElementSibling(): emptyListItem->previousSibling(); |
- RefPtr<Node> nextListNode = emptyListItem->isElementNode() ? toElement(emptyListItem)->nextElementSibling(): emptyListItem->nextSibling(); |
+ RefPtr<Node> previousListNode = emptyListItem->isElementNode() ? ElementTraversal::previousSibling(*emptyListItem): emptyListItem->previousSibling(); |
+ RefPtr<Node> nextListNode = emptyListItem->isElementNode() ? ElementTraversal::nextSibling(*emptyListItem): emptyListItem->nextSibling(); |
if (isListItem(nextListNode.get()) || isListElement(nextListNode.get())) { |
// If emptyListItem follows another list item or nested list, split the list node. |
if (isListItem(previousListNode.get()) || isListElement(previousListNode.get())) |