Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91e399dd29da015a1901a394a5af3e70182cb2ed
      
https://github.com/WebKit/WebKit/commit/91e399dd29da015a1901a394a5af3e70182cb2ed
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    A 
LayoutTests/accessibility/isolated-tree/mac/base-select-option-menu-item-mark-char-expected.txt
    A 
LayoutTests/accessibility/isolated-tree/mac/base-select-option-menu-item-mark-char.html
    A 
LayoutTests/accessibility/mac/base-select-option-menu-item-mark-char-expected.txt
    A LayoutTests/accessibility/mac/base-select-option-menu-item-mark-char.html
    M Source/WTF/wtf/unicode/CharacterNames.h
    M Source/WebCore/accessibility/AXCoreObject.h
    M Source/WebCore/accessibility/AXLogger.cpp
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h
    M Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
    M Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
    M Source/WebCore/platform/graphics/FontCascade.cpp

  Log Message:
  -----------
  AX: Hover Text doesn't show a checkmark for the selected option of a 
base-appearance select
https://bugs.webkit.org/show_bug.cgi?id=325891
rdar://182972485

Reviewed by Dominic Mazzoni.

When a traditional select's popup is open, AppKit renders it as an NSMenu and 
vends AXMenuItemMarkChar
("✓") on the selected item, which Hover Text displays as a prefix on the item's 
label (e.g. "✓ Pickup in
person"). A base-appearance select renders its own picker, which we expose as 
an AXMenu of AXMenuItems, and
those never vend the mark, so Hover Text shows the label alone.

There are two reasons for this:

1. handleMenuItemMarkCharAttribute only returns a mark for checked objects, and 
a selected option isn't
   checked.

2. The attribute isn't in these menu items' accessibilityAttributeNames. 
310441@main made MenuItem a control
   so Voice Control would number base-select options, and since the 
attribute-names chain checks isControl()
   before isMenuItem(), plain menu items get controlAttrs rather than 
menuItemAttrs.

The checkmark a base-appearance select shows is its options' ::checkmark 
pseudo-element, which the UA
stylesheet only makes visible for selected options, and which pages can restyle 
or hide. So rather than
always vending "✓" for the selected option, vend the glyph of its visible 
::checkmark, falling back to "✓"
when the checkmark has no text (e.g. it's an image, or drawn with borders), and 
nothing when the page hides
it. Options are still only marked when selected, even if a page makes every 
option's checkmark visible.

This is computed by the new AXCoreObject::selectedOptionCheckmark(), which the 
isolated tree caches as
AXProperty::SelectedOptionCheckmark, updated on SelectedStateChanged and on 
StyleChanged. A change to an
option's ::checkmark style is reported as a style change to the option itself, 
so StyleChanged covers both
the checkmark appearing when the option becomes selected and pages restyling it.

* 
LayoutTests/accessibility/isolated-tree/mac/base-select-option-menu-item-mark-char-expected.txt:
 Added.
* 
LayoutTests/accessibility/isolated-tree/mac/base-select-option-menu-item-mark-char.html:
 Added.
* 
LayoutTests/accessibility/mac/base-select-option-menu-item-mark-char-expected.txt:
 Added.
* LayoutTests/accessibility/mac/base-select-option-menu-item-mark-char.html: 
Added.
* Source/WebCore/accessibility/AXCoreObject.h:
* Source/WebCore/accessibility/AXLogger.cpp:
(WebCore::operator<<):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateIsolatedTree):
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectedOptionCheckmark const):
* Source/WebCore/accessibility/AccessibilityObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperties):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:
* Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::appendPlatformProperties):
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _additionalAccessibilityAttributeNames:]):
(handleMenuItemMarkCharAttribute):

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



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

Reply via email to