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

Unified Diff: third_party/WebKit/Source/core/html/HTMLElement.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/html/HTMLElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp
index c65115f04480fb2aae2393bbd052934002cd2aa6..36e5043ccc4ff2211b168a2f5098b815e36fa487 100644
--- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -586,6 +586,11 @@ void HTMLElement::setContentEditable(const String& enabled, ExceptionState& exce
exceptionState.throwDOMException(SyntaxError, "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'.");
}
+bool HTMLElement::isContentEditable() const
yosin_UTC9 2016/07/21 08:25:02 Why do we need to have |HTMLElement::isContentEdit
tkent 2016/07/21 08:29:54 HTMLElement::isContentEditable is a web-exposed ID
+{
+ return blink::isContentEditable(*this);
+}
+
bool HTMLElement::draggable() const
{
return equalIgnoringCase(getAttribute(draggableAttr), "true");
@@ -1038,7 +1043,7 @@ void HTMLElement::handleKeypressEvent(KeyboardEvent* event)
// if the element is a text form control (like <input type=text> or <textarea>)
// or has contentEditable attribute on, we should enter a space or newline
// even in spatial navigation mode instead of handling it as a "click" action.
- if (isTextFormControl() || isContentEditable())
+ if (isTextFormControl() || blink::isContentEditable(*this))
return;
int charCode = event->charCode();
if (charCode == '\r' || charCode == ' ') {

Powered by Google App Engine
This is Rietveld 408576698