зеркало из https://github.com/mozilla/gecko-dev.git
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 --HG-- extra : rebase_source : 8cf89721bf59f0bde09e217428bb593ad6d328de
This commit is contained in:
Родитель
88991ce560
Коммит
54382f83cb
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче