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:
@@ -250,6 +250,13 @@ class HTMLInputElement final : public TextControlElement,
|
||||
const nsAString& aValue) override;
|
||||
virtual bool HasCachedSelection() override;
|
||||
|
||||
/**
|
||||
* TextEditorValueEquals() is designed for internal use so that aValue
|
||||
* shouldn't include \r character. It should be handled before calling this
|
||||
* with nsContentUtils::PlatformToDOMLineBreaks().
|
||||
*/
|
||||
bool TextEditorValueEquals(const nsAString& aValue) const;
|
||||
|
||||
// Methods for nsFormFillController so it can do selection operations on input
|
||||
// types the HTML spec doesn't support them on, like "email".
|
||||
uint32_t GetSelectionStartIgnoringType(ErrorResult& aRv);
|
||||
|
||||
Reference in New Issue
Block a user