Index: Source/core/html/HTMLInputElement.cpp |
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp |
index 03bb788a82123d35f12d842f94d1dfe6c684e543..543f5c433bda21bd089ff9d83eab54ae06ab7a0b 100644 |
--- a/Source/core/html/HTMLInputElement.cpp |
+++ b/Source/core/html/HTMLInputElement.cpp |
@@ -510,7 +510,10 @@ int HTMLInputElement::selectionStartForBinding(ExceptionState& exceptionState) c |
exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."); |
return 0; |
} |
- return HTMLTextFormControlElement::selectionStart(); |
+ |
+ if (!isEmptyValue()) |
tkent
2014/04/29 23:55:44
This looks weird.
If we need such check, we should
harpreet.sk
2014/04/30 14:36:27
Move the check to selectionStart()
|
+ return HTMLTextFormControlElement::selectionStart(); |
+ return 0; |
} |
int HTMLInputElement::selectionEndForBinding(ExceptionState& exceptionState) const |
@@ -519,7 +522,10 @@ int HTMLInputElement::selectionEndForBinding(ExceptionState& exceptionState) con |
exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."); |
return 0; |
} |
- return HTMLTextFormControlElement::selectionEnd(); |
+ |
+ if (!isEmptyValue()) |
+ return HTMLTextFormControlElement::selectionEnd(); |
+ return 0; |
} |
String HTMLInputElement::selectionDirectionForBinding(ExceptionState& exceptionState) const |