Bug 1366218 - Use fast path to check empty value. r=smaug
HTMLInputElement::IsValueEmpty uses DocumentEncoder when input element has focus. DocumentEncoder is slow, so we should use fast path (nsTextEditorState::HasNonEmptyValue) to check whether value is empty. MozReview-Commit-ID: 1JxAeZ6z5A4
This commit is contained in:
@@ -1788,6 +1788,10 @@ HTMLInputElement::GetNonFileValueInternal(nsAString& aValue) const
|
||||
bool
|
||||
HTMLInputElement::IsValueEmpty() const
|
||||
{
|
||||
if (GetValueMode() == VALUE_MODE_VALUE && IsSingleLineTextControl(false)) {
|
||||
return !mInputData.mState->HasNonEmptyValue();
|
||||
}
|
||||
|
||||
nsAutoString value;
|
||||
GetNonFileValueInternal(value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user