Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 814ebe2cfe6ab3aa3039250361171f51d3847da4
      
https://github.com/WebKit/WebKit/commit/814ebe2cfe6ab3aa3039250361171f51d3847da4
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M 
LayoutTests/fast/forms/select/base/select-box-type-change-closes-picker-expected.txt
    M 
LayoutTests/fast/forms/select/base/select-box-type-change-closes-picker.html
    A 
LayoutTests/fast/forms/select/base/select-multiple-without-preference-closes-picker-expected.txt
    A 
LayoutTests/fast/forms/select/base/select-multiple-without-preference-closes-picker.html
    A 
LayoutTests/fast/forms/select/mac-wk2/open-select-popup-with-open-rule-changing-display-expected.txt
    A 
LayoutTests/fast/forms/select/mac-wk2/open-select-popup-with-open-rule-changing-display.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-display-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-display.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-move-remove-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-move-remove.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-size-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-size.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-top-layer-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-top-layer.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/switch-picker-appearance-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/switch-picker-appearance-timing.tentative-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/switch-picker-appearance-timing.tentative.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/switch-picker-appearance.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/w3c-import.log
    M LayoutTests/platform/ios/TestExpectations
    R 
LayoutTests/platform/ios/fast/forms/select/base/select-box-type-change-closes-picker-expected.txt
    R 
LayoutTests/platform/ios/fast/forms/select/base/select-multiple-box-type-change-closes-picker-expected.txt
    M Source/WebCore/accessibility/AccessibilityMenuList.cpp
    M Source/WebCore/accessibility/AccessibilityObject.cpp
    M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
    M Source/WebCore/html/HTMLElement.cpp
    M Source/WebCore/html/HTMLElement.h
    M Source/WebCore/html/HTMLSelectElement.cpp
    M Source/WebCore/html/HTMLSelectElement.h
    M Source/WebCore/html/shadow/SelectPopoverElement.cpp
    M Source/WebCore/html/shadow/SelectPopoverElement.h
    M Source/WebCore/testing/Internals.cpp

  Log Message:
  -----------
  :open stops matching a select whose base appearance picker is still showing
https://bugs.webkit.org/show_bug.cgi?id=325152
rdar://188911581

Reviewed by Ryosuke Niwa.

:open was a flag shared by the native popup menu and the base appearance 
picker, and
didDetachRenderers() cleared it. That is right for the native popup, which goes 
away with the
renderers, but not the popover. So a display change, moveBefore(), setting size 
to 1, or a :open
rule that changes display left the picker showing while :open stopped matching. 
The flag changed
during a render tree update, where invalidation is dropped, so :has() and 
sibling rules went stale
as well.

:open is now derived. While the picker popover is showing, the select matches 
:open as long as it
supports a base appearance picker, which only its attributes decide. Otherwise 
:open follows the
native popup flag. SelectPopoverElement invalidates the select's :open when its 
visibility state
changes, and setSizeAndMultiple() does so when a size or multiple change makes 
an open picker stop
or start counting. Accessibility and internals.isSelectPopupVisible() use the 
same answer.

A truthful :open showed where the picker did not actually close:
- didRecalcStyle() compared the select's appearance against its committed 
style, which is not
  updated yet at that point. So changing the select's own appearance, for 
instance through inline
  style, never closed the picker. The select and its picker popover now both 
check from
  didAttachRenderers(), through closePickerIfNoLongerBaseAppearance(), which 
needs no record of
  the previous appearance.
- With HTMLEnhancedSelectMultipleAndListBoxEnabled off, setting multiple on a 
select whose size is
  1 left the picker open.
- Script run by hiding other popovers while the picker opens can make the 
select a list box.
  showPickerInternal() now checks once more after showing the picker, which 
also takes over the
  :open appearance checks that showPicker() and openPickerForUserInteraction() 
each made.
- The queued close re-checks whether the picker still has to close. A change 
undone within the
  same task now leaves the picker open, and one close logs one warning.
- popoverWasHidden() now runs at the end of hidePopoverInternal(), so :open no 
longer matches
  during the focus events it causes. This matches Chrome.

A size or multiple change no longer queues an appearance close next to the 
dropdown box one, so iOS
stops logging a second warning and no longer needs its own baselines for the 
box type tests. Three
customizable-select tests that iOS expected to fail now pass there as well.

This also fixes a crash in showPopup() when a :open rule rebuilds the renderer 
of a native select.

https://github.com/whatwg/html/issues/13027 proposes specifying when the picker 
closes once it can
no longer be shown. switch-picker-appearance.html no longer assumes the close 
is synchronous, and
switch-picker-appearance-timing.tentative.html tests the proposal.

Tests: 
fast/forms/select/base/select-multiple-without-preference-closes-picker.html
       
fast/forms/select/mac-wk2/open-select-popup-with-open-rule-changing-display.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-display.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-move-remove.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-size.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-pseudo-open-top-layer.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/switch-picker-appearance-timing.tentative.html

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



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

Reply via email to