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

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

Issue 1312213008: Move member function rootEditableElement() out from VisiblePosition class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T17:55:42 Include VisiblePosition.h Created 5 years, 4 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/EditingUtilities.h ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingUtilities.cpp
diff --git a/Source/core/editing/EditingUtilities.cpp b/Source/core/editing/EditingUtilities.cpp
index e4905bc2ba6ab45b1d818a00417704bde1528289..27862b213176f829ec9db4166ec2a05385fa0752 100644
--- a/Source/core/editing/EditingUtilities.cpp
+++ b/Source/core/editing/EditingUtilities.cpp
@@ -303,6 +303,13 @@ Element* editableRootForPosition(const PositionInComposedTree& p, EditableType e
return editableRootForPosition(toPositionInDOMTree(p), editableType);
}
+// TODO(yosin) This does not handle [table, 0] correctly.
+Element* rootEditableElementOf(const VisiblePosition& visiblePosition)
+{
+ Node* anchorNode = visiblePosition.deepEquivalent().anchorNode();
+ return anchorNode ? anchorNode->rootEditableElement() : nullptr;
+}
+
// Finds the enclosing element until which the tree can be split.
// When a user hits ENTER, he/she won't expect this element to be split into two.
// You may pass it as the second argument of splitTreeToNode.
« no previous file with comments | « Source/core/editing/EditingUtilities.h ('k') | Source/core/editing/VisiblePosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698