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

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: 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
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 eceba637168f286cfb08306437988e13eed48ba5..0e7500b735995b42c7fa931f268e63d0504395f8 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()

Powered by Google App Engine
This is Rietveld 408576698