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

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

Issue 14794012: Make contenteditable="false" element as atomic node for selection motion (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-05-27T14:00 Created 7 years, 7 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/htmlediting.h ('k') | 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 69a59f3064ddfba20a4b7531e0de1a07c4889e9d..80b36f7907437d16ed7d4670f9045e16c9320942 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -66,7 +66,18 @@ using namespace HTMLNames;
// purposes of editing.
bool isAtomicNode(const Node *node)
{
- return node && (!node->hasChildNodes() || editingIgnoresContent(node));
+ if (!node)
+ return false;
+ if (!node->hasChildNodes() || editingIgnoresContent(node))
+ return true;
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return false;
+ // For compatibility with IE, we allow to move caret into table cell event
+ // if TABLE and TR are uneditable.
+ if (renderer->isTable() || renderer->isTableRow())
ojan 2013/05/27 06:51:54 I don't think this bit is right. Even if we were t
yosin_UTC9 2013/05/27 09:10:13 I don't think there are web contents depend on thi
+ return false;
+ return renderer->style()->userModify() == READ_ONLY && lowestEditableAncestor(node);
}
// Compare two positions, taking into account the possibility that one or both
@@ -128,7 +139,7 @@ Node* highestEditableRoot(const Position& position, EditableType editableType)
return highestRoot;
}
-Node* lowestEditableAncestor(Node* node)
+Node* lowestEditableAncestor(const Node* node)
{
if (!node)
return 0;
« no previous file with comments | « Source/core/editing/htmlediting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698