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

Unified Diff: third_party/WebKit/Source/core/html/HTMLInputElement.cpp

Issue 2272913002: Add UseCounter to count InvalidStateError by input.selectionStart, selectionEnd, and selectionDirec… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLInputElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
index f8d7bcbe059cf33dd3cf7080c13333b6acbb3047..659200e894ed79772802d449b2f314dbd9b66a11 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -527,6 +527,7 @@ bool HTMLInputElement::canStartSelection() const
int HTMLInputElement::selectionStartForBinding(ExceptionState& exceptionState) const
{
if (!m_inputType->supportsSelectionAPI()) {
+ UseCounter::count(document(), UseCounter::InputSelectionGettersThrow);
exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
return 0;
}
@@ -536,6 +537,7 @@ int HTMLInputElement::selectionStartForBinding(ExceptionState& exceptionState) c
int HTMLInputElement::selectionEndForBinding(ExceptionState& exceptionState) const
{
if (!m_inputType->supportsSelectionAPI()) {
+ UseCounter::count(document(), UseCounter::InputSelectionGettersThrow);
exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
return 0;
}
@@ -545,6 +547,7 @@ int HTMLInputElement::selectionEndForBinding(ExceptionState& exceptionState) con
String HTMLInputElement::selectionDirectionForBinding(ExceptionState& exceptionState) const
{
if (!m_inputType->supportsSelectionAPI()) {
+ UseCounter::count(document(), UseCounter::InputSelectionGettersThrow);
exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
return String();
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698