Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 357f0423e8b4c2209de2c65e1911b10e2561e8ee
https://github.com/WebKit/WebKit/commit/357f0423e8b4c2209de2c65e1911b10e2561e8ee
Author: Chris Dumez <[email protected]>
Date: 2026-03-27 (Fri, 27 Mar 2026)
Changed paths:
M Source/WebCore/html/HTMLInputElement.cpp
Log Message:
-----------
Simplify / Optimize HTMLInputElement::isDevolvableWidget()
https://bugs.webkit.org/show_bug.cgi?id=310894
Reviewed by Anne van Kesteren.
Replace 14 individual type-check calls with a single OptionSet check
listing the 16 devolvable input types, matching the HTML spec [1].
The new code is a single bitmask AND operation instead of up to 14
sequential OptionSet::contains checks with short-circuit evaluation.
The old code had two additional problems:
- isEmailField(), isPasswordField(), isSearchField(),
isTelephoneField(), and isURLField() were redundant with the
isTextType() call, which already covers all of them.
- isURLField() after isTextType() was dead code: URL is in textTypes,
so if isTextType() returned false, isURLField() would also return
false.
[1]
https://html.spec.whatwg.org/multipage/rendering.html#the-input-element-as-a-text-entry-widget
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isDevolvableWidget const):
Canonical link: https://commits.webkit.org/310140@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications