New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readonly attribute should only apply on certain input types #3115
Conversation
865802e
to
0a800d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be good to run this against perf bots, since I believe that HTMLInputElement::updateType
is a hot codepath.
ca7e887
to
5b53401
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a835cf7
to
f633a6e
Compare
https://bugs.webkit.org/show_bug.cgi?id=240343 <rdar://93173726> Reviewed by Chris Dumez. We should only apply the readonly attribute on certain input types: https://html.spec.whatwg.org/multipage/input.html#do-not-apply Except in the constraint validation case (willValidate) for compat reasons, since it affects the :in-range/:out-of-range pseudo-classes, the relevant test has been updated to reflect that. This also was the resolution of whatwg/html#8133 in the HTML spec triage meeting. Also introduce isMutable() which corresponds to the spec concept of mutable form control. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/show-picker-disabled-readonly-expected.txt: * LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: * LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/show-picker-disabled-readonly-expected.txt: Added. * Source/WebCore/html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::valueMissing const): (WebCore::BaseDateAndTimeInputType::handleDOMActivateEvent): * Source/WebCore/html/ColorInputType.cpp: (WebCore::ColorInputType::isKeyboardFocusable const): * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::HTMLFormControlElement): (WebCore::HTMLFormControlElement::parseAttribute): (WebCore::HTMLFormControlElement::computeWillValidate const): * Source/WebCore/html/HTMLFormControlElement.h: (WebCore::HTMLFormControlElement::supportsReadOnly const): (WebCore::HTMLFormControlElement::isReadOnly const): (WebCore::HTMLFormControlElement::isMutable const): (WebCore::HTMLFormControlElement::isDisabledOrReadOnly const): Deleted. * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateType): (WebCore::HTMLInputElement::supportsReadOnly const): (WebCore::HTMLInputElement::showPicker): (WebCore::HTMLInputElement::matchesReadWritePseudoClass const): (WebCore::HTMLInputElement::createInnerTextStyle): * Source/WebCore/html/HTMLInputElement.h: * Source/WebCore/html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass const): * Source/WebCore/html/HTMLTextAreaElement.h: * Source/WebCore/html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::isInnerTextElementEditable const): * Source/WebCore/html/SearchInputType.cpp: (WebCore::SearchInputType::handleKeydownEvent): * Source/WebCore/html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::valueMissing const): (WebCore::TextFieldInputType::handleKeydownEventForSpinButton): (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents const): (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): (WebCore::TextFieldInputType::shouldDrawAutoFillButton const): * Source/WebCore/html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::handleTouchEvent): * Source/WebCore/html/shadow/TextControlInnerElements.cpp: (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEventsWithEditability const): Canonical link: https://commits.webkit.org/253321@main
f633a6e
to
af43ca3
Compare
Committed 253321@main (af43ca3): https://commits.webkit.org/253321@main Reviewed commits have been landed. Closing PR #3115 and removing active labels. |
af43ca3