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

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

Issue 22288004: Refactoring code in highestEditableRoot to avoid a redundant call to rendererIsEditable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/htmlediting.cpp
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index 8a7e6489cb870b7571f086a2a1c4f2130624c999..9fd351541d5d6177076b88a386fb4ffe65f03b34 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -116,7 +116,10 @@ Node* highestEditableRoot(const Position& position, EditableType editableType)
if (!highestRoot)
return 0;
- node = highestRoot;
+ if (highestRoot->hasTagName(bodyTag))
+ return highestRoot;
+
+ node = highestRoot->parentNode();
while (node) {
if (node->rendererIsEditable(editableType))
highestRoot = node;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698