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

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

Issue 2706033004: Don't throw when getting selection(Direction|Start|End) on input (Closed)
Patch Set: Created 3 years, 10 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/HTMLInputElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
index c6863dd163eeb4dc38938418a5e5d5027aa0a35c..aeeb8785a2b51fbd6b95bea94070fe3c95757245 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -549,26 +549,20 @@ bool HTMLInputElement::canStartSelection() const {
}
unsigned HTMLInputElement::selectionStartForBinding(
+ bool& isNull,
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.");
+ isNull = true;
return 0;
}
return TextControlElement::selectionStart();
}
unsigned HTMLInputElement::selectionEndForBinding(
+ bool& isNull,
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.");
+ isNull = true;
return 0;
}
return TextControlElement::selectionEnd();
@@ -577,11 +571,6 @@ unsigned HTMLInputElement::selectionEndForBinding(
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();
}
return TextControlElement::selectionDirection();

Powered by Google App Engine
This is Rietveld 408576698