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

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2121313003: [Editing][DOM][CodeHealth] Make Node::isContentEditable and Node::isRichEditable global functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/editing/CaretBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index fec04be5814526a2e6a4ba9ebabc71b93c2c2d1e..955634a4026166a14987cb79508bddfe732173c1 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -539,16 +539,18 @@ enum EditableLevel { Editable, RichlyEditable };
static bool hasEditableStyle(const Node&, EditableLevel);
static bool isEditableToAccessibility(const Node&, EditableLevel);
-bool Node::isContentEditable() const
+// TODO(yoichio): Move to core/editing
+bool isContentEditable(const Node& node)
{
- document().updateStyleAndLayoutTree();
- return blink::hasEditableStyle(*this, Editable);
+ node.document().updateStyleAndLayoutTree();
+ return blink::hasEditableStyle(node, Editable);
}
-bool Node::isContentRichlyEditable() const
+// TODO(yoichio): Move to core/editing
+bool isContentRichlyEditable(const Node& node)
{
- document().updateStyleAndLayoutTree();
- return blink::hasEditableStyle(*this, RichlyEditable);
+ node.document().updateStyleAndLayoutTree();
+ return blink::hasEditableStyle(node, RichlyEditable);
}
// TODO(yoichio): Move to core/editing
@@ -2237,7 +2239,7 @@ bool Node::willRespondToMouseClickEvents()
{
if (isDisabledFormControl(this))
return false;
- return isContentEditable() || hasEventListeners(EventTypeNames::mouseup) || hasEventListeners(EventTypeNames::mousedown) || hasEventListeners(EventTypeNames::click) || hasEventListeners(EventTypeNames::DOMActivate);
+ return isContentEditable(*this) || hasEventListeners(EventTypeNames::mouseup) || hasEventListeners(EventTypeNames::mousedown) || hasEventListeners(EventTypeNames::click) || hasEventListeners(EventTypeNames::DOMActivate);
}
bool Node::willRespondToTouchEvents()
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/editing/CaretBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698