Bug 1597679 - part 3: Create methods to compare given string with values of TextControlState, nsTextControlFrame, HTMLInputElement and HTMLTextAreaElement r=smaug
For avoiding unnecessary copy of string buffer only for comparing setting value and current value, especially with `nsAutoString`, this patch creates `*Equals()` methods for every class. And also this avoids to call `nsContentUtils::PlatformToDOMLineBreaks()` in most paths. Differential Revision: https://phabricator.services.mozilla.com/D54331
This commit is contained in:
@@ -6756,6 +6756,11 @@ void HTMLInputElement::GetTextEditorValue(nsAString& aValue,
|
||||
}
|
||||
}
|
||||
|
||||
bool HTMLInputElement::TextEditorValueEquals(const nsAString& aValue) const {
|
||||
TextControlState* state = GetEditorState();
|
||||
return state ? state->ValueEquals(aValue) : aValue.IsEmpty();
|
||||
}
|
||||
|
||||
void HTMLInputElement::InitializeKeyboardEventListeners() {
|
||||
TextControlState* state = GetEditorState();
|
||||
if (state) {
|
||||
|
||||
Reference in New Issue
Block a user