Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cd61a31ca376f746267ba47a0d9b75ac8802ac9a
https://github.com/WebKit/WebKit/commit/cd61a31ca376f746267ba47a0d9b75ac8802ac9a
Author: Tim Horton <[email protected]>
Date: 2026-06-03 (Wed, 03 Jun 2026)
Changed paths:
A
LayoutTests/fast/forms/date/date-editable-components/date-editable-components-component-set-updates-color-expected.txt
A
LayoutTests/fast/forms/date/date-editable-components/date-editable-components-component-set-updates-color.html
M LayoutTests/resources/js-test.js
M Source/WebCore/html/shadow/DateTimeFieldElement.cpp
M Source/WebCore/html/shadow/DateTimeFieldElement.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
Log Message:
-----------
<input type=date> text color is partially stale after changing the value of a
single component
https://bugs.webkit.org/show_bug.cgi?id=316144
rdar://177266131
Reviewed by Lily Spiniolas and Aditya Keerthi.
When updating the value of a single subfield of a date input, we were not
invalidating
style of the whole input, resulting in other subfields maintaining the grey
placeholder
color, instead of turning black.
Fix by explicitly invalidating style when the placeholder state changes.
Test:
fast/forms/date/date-editable-components/date-editable-components-component-set-updates-color.html
*
LayoutTests/fast/forms/date/date-editable-components/date-editable-components-component-set-updates-color-expected.txt:
Added.
*
LayoutTests/fast/forms/date/date-editable-components/date-editable-components-component-set-updates-color.html:
Added.
Add a test that fails before this change (with mismatching text color from
stale style) and passes after.
* LayoutTests/resources/js-test.js:
(shouldNotBeEqualToString):
* Source/WebCore/html/shadow/DateTimeFieldElement.cpp:
(WebCore::DateTimeFieldElement::updateVisibleValue):
This is the actual fix; invalidate style when placeholder state changes.
* Source/WebCore/html/shadow/DateTimeFieldElement.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::autofillFieldName):
(WebCore::Internals::allowAutofillForCurrentWorld):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
Add some test infrastructure allowing us to turn on autofill privileges in a
given world;
one of the keys to reproducing this is making layout clean in
"webkitbeforefocus",
before the DateTimeFieldElement knows that it has gained a non-placeholder
value.
Canonical link: https://commits.webkit.org/314469@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications