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

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

Issue 1318943002: Move global function lowestEditableAncestor() to local function in VisibleSelection.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-27T17:01:49 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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 16e6d189df7a0d76ec9e7a9c069a09e6d636ced9..3a286ea7c5c92643902e1f085ff2fa304d2c8cfb 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -905,6 +905,19 @@ bool VisibleSelection::isBaseFirstInComposedTree() const
return m_baseInComposedTree.isNotNull() && m_baseInComposedTree.compareTo(m_extentInComposedTree) <= 0;
}
+static Element* lowestEditableAncestor(Node* node)
+{
+ while (node) {
+ if (node->hasEditableStyle())
+ return node->rootEditableElement();
+ if (isHTMLBodyElement(*node))
+ break;
+ node = node->parentNode();
+ }
+
+ return nullptr;
+}
+
void VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries()
{
if (m_base.isNull() || m_start.isNull() || m_end.isNull())
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698