[webkit-changes] [WebKit/WebKit] f2989c: AX: Input time elements with no value are read inc...

AndresGonzalezApple noreply at github.com
Mon Mar 25 08:57:52 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f2989cc4e30ed41ddc976422ff3b0ba0faa930f1
      https://github.com/WebKit/WebKit/commit/f2989cc4e30ed41ddc976422ff3b0ba0faa930f1
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2024-03-25 (Mon, 25 Mar 2024)

  Changed paths:
    M LayoutTests/accessibility/datetime/input-time-label-value-expected.txt
    M LayoutTests/accessibility/datetime/input-time-label-value.html
    M LayoutTests/platform/ios/accessibility/datetime/input-time-label-value-expected.txt
    M LayoutTests/platform/mac-ventura/accessibility/datetime/input-time-label-value-expected.txt
    M Source/WebCore/html/BaseDateAndTimeInputType.cpp
    M Source/WebCore/html/shadow/DateTimeEditElement.cpp
    M Source/WebCore/html/shadow/DateTimeEditElement.h
    M Source/WebCore/html/shadow/DateTimeFieldElement.h
    M Source/WebCore/html/shadow/DateTimeFieldElements.cpp
    M Source/WebCore/html/shadow/DateTimeFieldElements.h
    M Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp
    M Source/WebCore/html/shadow/DateTimeNumericFieldElement.h
    M Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
    M Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h

  Log Message:
  -----------
  AX: Input time elements with no value are read incorrectly by VoiceOver.
https://bugs.webkit.org/show_bug.cgi?id=271394
<rdar://problem/125176285>

Reviewed by Tyler Wilcock.

The problem occurs because BaseDateAndTimeInputType::valueAsDouble returns NaN if the value attribute is not present. Thus, accessibilityValueAsDate was returning a bogus WallTime. This patch fixes the problem by getting the placeholder value set during the creation of the shadow subtree for the datetime element, which is the value shown on the screen.

* LayoutTests/accessibility/datetime/input-time-label-value-expected.txt:
* LayoutTests/accessibility/datetime/input-time-label-value.html:
Added a test case with no value.

* LayoutTests/platform/ios/accessibility/datetime/input-time-label-value-expected.txt:
* LayoutTests/platform/mac-ventura/accessibility/datetime/input-time-label-value-expected.txt:
* Source/WebCore/html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::accessibilityValueAsDate const):
(WebCore::BaseDateAndTimeInputType::setupDateTimeChooserParameters):
* Source/WebCore/html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::placeholderValue const):
(WebCore::DateTimeEditElement::valueAsDateTimeFieldsState const):
* Source/WebCore/html/shadow/DateTimeEditElement.h:
* Source/WebCore/html/shadow/DateTimeFieldElement.h:
* Source/WebCore/html/shadow/DateTimeFieldElements.cpp:
(WebCore::DateTimeDayFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeHourFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeMeridiemFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeMillisecondFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeMinuteFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeMonthFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeSecondFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeSymbolicMonthFieldElement::populateDateTimeFieldsState):
(WebCore::DateTimeYearFieldElement::populateDateTimeFieldsState):
Modified the populateDateTimeFieldsState method to return the placeholder value if the value has not been set.

* Source/WebCore/html/shadow/DateTimeFieldElements.h:
* Source/WebCore/html/shadow/DateTimeNumericFieldElement.cpp:
(WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement):
(WebCore::DateTimeNumericFieldElement::valueAsInteger const): Inlined in header.
* Source/WebCore/html/shadow/DateTimeNumericFieldElement.h:
* Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp:
(WebCore::DateTimeSymbolicFieldElement::valueAsInteger const): Inlined in header.
* Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h:

Canonical link: https://commits.webkit.org/276626@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list