Closed Bug 2078046 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63250 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=326092

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Attachments

(1 file)

Sync web-platform-tests PR 63250 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63250
Details from upstream follow.

Anne van Kesteren <annevk@annevk.nl> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=326092

WebKit export from bug: <select> computes its selected option's style from outdated ancestor styles

<pre>
<select> computes its selected option's style from outdated ancestor styles

SelectFallbackButtonElement::resolveCustomStyle() copies direction and
unicode-bidi from the selected option. The popover holding the options
comes after the button slot in the shadow tree, so style resolution has
not reached the option at that point, and options have no renderer
unless a base appearance picker is open. The button therefore resolved
the option's style on demand through computedStyleForEditability(),
which starts from the existing styles of the option's ancestors.

Before <a href="https://commits.webkit.org/306393@main">306393@main</a> RenderMenuList did that outside of style resolution.
Since then it happens during style resolution, where those styles are
out of date: new styles only reach the renderers once the whole tree is
resolved, so elements inserted since the last update have no style yet
and the others still have their old one. The option's style was thus
computed from an old ancestor style and cached on every element in
between, including ones style resolution had already passed. As those
caches take precedence over renderer styles, getComputedStyle() returned
old values for the select and its ancestors up to the inserted subtree's
root until they were restyled, and so did anything reading the select's
existingComputedStyle(), such as usesBaseAppearancePicker(). When an
ancestor's direction changed, the fallback button ended up with the
previous direction.

Instead resolve the option's style starting from the host style passed
to resolveCustomStyle(), through the option's composed tree ancestors
below the select, without caching anything. That costs at least three
style resolutions each time the button is resolved: the popover, its
slot and the option. A dir change on the root element already restyles
6+N elements of a select with N options.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=326092">https://bugs.webkit.org/show_bug.cgi?id=326092</a>
</pre>

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Attached file Notable wpt changes —

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 255 tests and 2 subtests

Status Summary

Firefox

OK : 1[GitHub] 123[Gecko-android-em-14-x86_64-debug-geckoview] 124[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 5[GitHub] 17[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 405[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 430[Gecko-android-em-14-x86_64-debug-geckoview] 438[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 461[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 462[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 165[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 193[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 222[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 223[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]

Chrome

OK : 1
PASS: 5

Safari

OK : 1
PASS: 1
FAIL: 4

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

(See attachment for full changes)

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: