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

Unified Diff: third_party/WebKit/Source/core/editing/EditingStrategy.cpp

Issue 2441693004: Make editingIgnoresContents() as global function (Closed)
Patch Set: 2016-10-24T12:29:25 Created 4 years, 2 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
Index: third_party/WebKit/Source/core/editing/EditingStrategy.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStrategy.cpp b/third_party/WebKit/Source/core/editing/EditingStrategy.cpp
index 57a85f24bbf7a3f924bcdd38510a8d6f797bd59f..f8dc98e51420b22191efdb189ec3b79c4699188e 100644
--- a/third_party/WebKit/Source/core/editing/EditingStrategy.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStrategy.cpp
@@ -23,9 +23,11 @@ int EditingAlgorithm<Traversal>::caretMaxOffset(const Node& node) {
return lastOffsetForEditing(&node);
}
-template <typename Traversal>
-bool EditingAlgorithm<Traversal>::isEmptyNonEditableNodeInEditable(
- const Node* node) {
+// TODO(yosin): We should move "isEmptyNonEditableNodeInEditable()" to
+// "EditingUtilities.cpp"
+// |isEmptyNonEditableNodeInEditable()| is introduced for fixing
+// http://crbug.com/428986.
+static bool isEmptyNonEditableNodeInEditable(const Node* node) {
// Editability is defined the DOM tree rather than the flat tree. For example:
// DOM:
// <host>
@@ -36,12 +38,18 @@ bool EditingAlgorithm<Traversal>::isEmptyNonEditableNodeInEditable(
// Flat Tree:
// <host><div ce><span1>unedittable</span></div></host>
// e.g. editing/shadow/breaking-editing-boundaries.html
- return !Traversal::hasChildren(*node) && !hasEditableStyle(*node) &&
+ return !NodeTraversal::hasChildren(*node) && !hasEditableStyle(*node) &&
node->parentNode() && hasEditableStyle(*node->parentNode());
}
-template <typename Traversal>
-bool EditingAlgorithm<Traversal>::editingIgnoresContent(const Node* node) {
+// TODO(yosin): We should move "editingIgnoresContent()" to
+// "EditingUtilities.cpp"
+// TODO(yosin) We should make |editingIgnoresContent()| to take |Node&| instead
+// |Node*|.
+// TODO(yosin): We should not use |isEmptyNonEditableNodeInEditable()| in
+// |editingIgnoresContent()| since |isEmptyNonEditableNodeInEditable()|
+// requires clean layout tree.
+bool editingIgnoresContent(const Node* node) {
return !node->canContainRangeEndPoint() ||
isEmptyNonEditableNodeInEditable(node);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStrategy.h ('k') | third_party/WebKit/Source/core/editing/EditingUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698