Bug 325133
| Summary: | The select picker stays open when the element stops being a dropdown box | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Anne van Kesteren <annevk> |
| Component: | Forms | Assignee: | Anne van Kesteren <annevk> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | cdumez, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 324529 | ||
Anne van Kesteren
Setting size or multiple on a <select> whose base appearance picker is open leaves
the picker showing. The element picks up the list box rules from
selectMultipleAndListBox.css, so it lays out a correctly sized but empty list box,
while its options stay slotted in the still-showing popover and render in the top
layer above the page. :open keeps matching a list box.
Steps:
1. Enable Enhanced HTML select element for multiple and list box.
2. <select style="appearance: base-select"> with a few options, and
::picker(select) { appearance: base-select }.
3. Click it to open the picker.
4. From the console, select.multiple = true.
No size attribute is needed: preferredSize() goes 1 to 4 through the
m_multiple ? 4 : 1 fallback, so supportsPickerPseudoElement() becomes false while
the popover is still showing.
Nothing closes the picker on this transition:
- attributeChanged() for sizeAttr invalidates style and renderers, calls
setRecalcListItems() and invalidateButtonText(), and never touches the popover.
- parseMultipleAttribute() computes oldBoxType != boxType() and uses it only to
invalidate style.
- Both queuePickerCloseForAppearanceChange() call sites key on usedAppearance()
flipping away from Base, which a size or multiple change does not do.
pickOrToggleOption()'s hidePickerPopoverElement() recovers the select.size = N
variant, but it sits behind if (!m_multiple), so it never fires for the multiple
case. Popover light dismiss recovers both, but not until the user clicks away.
Suggested fix: key on supportsPickerPseudoElement() going false across the attribute
change rather than on the attribute differing, so size 4 to 5 does nothing and 1 to 2
closes. Prefer the queued close to calling hidePickerPopoverElement() synchronously,
since attributeChanged() can run under ScriptDisallowedScope during parsing, which
means parameterizing the console message that currently names the appearance property.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Anne van Kesteren
Pull request: https://github.com/WebKit/WebKit/pull/74800
EWS
Committed 321876@main (dd515af3c07b): <https://commits.webkit.org/321876@main>
Reviewed commits have been landed. Closing PR #74800 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/188362270>