Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Unified Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 166033005: Port Node's previousElementSibling() / nextElementSibling() to ElementTraversal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/editing/IndentOutdentCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()))
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/editing/IndentOutdentCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698