return TextFieldInputType::handleKeydownEvent(event);
const String& key = event.keyIdentifier();
- if (key == "U+001B") {
+ if (key == "U+001B"_s) {
Ref<HTMLInputElement> protectedInputElement(*element());
protectedInputElement->setValueForUser(emptyString());
protectedInputElement->onSearch();
return width;
}
+void SearchInputType::setValue(const String& sanitizedValue, bool valueChanged, TextFieldEventBehavior eventBehavior, TextControlSetValueSelection selection)
+{
+ bool emptinessChanged = valueChanged && sanitizedValue.isEmpty() != element()->value().isEmpty();
+
+ BaseTextInputType::setValue(sanitizedValue, valueChanged, eventBehavior, selection);
+
+ if (m_cancelButton && emptinessChanged)
+ m_cancelButton->invalidateStyleInternal();
+}
+
} // namespace WebCore