[webkit-changes] [WebKit/WebKit] 8f41d9: AX: WebKit does not report some inputs as invalid ...

Tyler Wilcock noreply at github.com
Mon Feb 20 09:49:13 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f41d99df20caa903541ee9cbbff27820ac283f2
      https://github.com/WebKit/WebKit/commit/8f41d99df20caa903541ee9cbbff27820ac283f2
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-02-20 (Mon, 20 Feb 2023)

  Changed paths:
    A LayoutTests/accessibility/invalid-inputs-expected.txt
    A LayoutTests/accessibility/invalid-inputs.html
    M LayoutTests/platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/html/ValidatedFormListedElement.cpp

  Log Message:
  -----------
  AX: WebKit does not report some inputs as invalid despite being rendered as such
https://bugs.webkit.org/show_bug.cgi?id=252549
rdar://problem/105653691

Reviewed by Chris Fleizach.

Currently, WebKit only reports native input elements as invalid if:

  - `HTMLInputElement::hasBadInput()`
  - `HTMLInputElement::typeMismatch()`

However, there are several other reasons an input can be invalid (for
example, `HTMLInputElement::patternMismatch()`).

This patch fixes this by using `ValidatedFormListedElement::isValidFormControlElement()`,
which inherently considers all possible ways an input can be valid / invalid.

This patch also features another improvement. Now, when an input changes from valid to
invalid or vice versa, WebKit sends a notification. This makes it known to AT users when
they enter input that causes the field to go invalid. Previously, AT users would have to
leave and re-enter the field to know it had become invalid.

* LayoutTests/platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt:
Add new invalid expectation.
* LayoutTests/accessibility/invalid-inputs-expected.txt: Added.
* LayoutTests/accessibility/invalid-inputs.html: Added.
* LayoutTests/platform/ios/TestExpectations:
Enable new test.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::onValidityChange): Added.
* Source/WebCore/accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::onValidityChange):
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::invalidStatus const):
* Source/WebCore/html/ValidatedFormListedElement.cpp:
(WebCore::ValidatedFormListedElement::updateValidity):

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




More information about the webkit-changes mailing list