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

Unified Diff: Source/core/editing/IndentOutdentCommand.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/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/InsertListCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/IndentOutdentCommand.cpp
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index dab6301ecf97a5ccfc86f752d499a6b2aab72e0e..ba5cf29fd0ee17b2b558a72a0cd4fb313f3e77b4 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -28,6 +28,7 @@
#include "HTMLNames.h"
#include "core/dom/Document.h"
+#include "core/dom/ElementTraversal.h"
#include "core/editing/InsertListCommand.h"
#include "core/editing/VisibleUnits.h"
#include "core/editing/htmlediting.h"
@@ -65,8 +66,8 @@ bool IndentOutdentCommand::tryIndentingAsListItem(const Position& start, const P
return false;
// FIXME: previousElementSibling does not ignore non-rendered content like <span></span>. Should we?
- RefPtr<Element> previousList = selectedListItem->previousElementSibling();
- RefPtr<Element> nextList = selectedListItem->nextElementSibling();
+ RefPtr<Element> previousList = ElementTraversal::previousSibling(*selectedListItem);
+ RefPtr<Element> nextList = ElementTraversal::nextSibling(*selectedListItem);
// We should calculate visible range in list item because inserting new
// list element will change visibility of list item, e.g. :first-child
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/InsertListCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698