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

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

Issue 1461263002: Add a UseCounter for execCommand with INPUT or TEXTAREA element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 38f7ad29e6c594c1cc17abd4e7ca0a12f465d8bc..1616dd6796371cbf7736758e8b299bfc3d454aee 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4393,6 +4393,8 @@ bool Document::execCommand(const String& commandName, bool, const String& value,
exceptionState.throwDOMException(InvalidStateError, "execCommand is only supported on HTML documents.");
return false;
}
+ if (focusedElement() && isHTMLTextFormControlElement(*focusedElement()))
+ UseCounter::count(*this, UseCounter::ExecCommandOnInputOrTextarea);
// We don't allow recursive |execCommand()| to protect against attack code.
// Recursive call of |execCommand()| could be happened by moving iframe
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698