github web-platform-tests/wpt merge_pr_48804

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
11 months ago

[@scope] Match using most proximate activation first

A single @scope rule may produce more than one activation if a @scope
rule matches more than one element in the ancestor chain. In this case,
we store the parent activations before any activation produced by
"this" element, meaning the most proximate activation is at the end
of the activation vector. The order in which we tried the activations
were believed to not matter, because the selector checker anyway tries
closer ancestors first. For common cases involving :scope, this is
correct, since we're looking for a specific element. However, for cases
involving '&', it's wrong: we'll match the least proximate activation
in this case.

Therefore, simply reverse the order of the activations in
MatchForScopeActivation.

Fixed: 351244339
Change-Id: I913076f1bdedacab1030f137007b17ec7f7785a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5961463
Reviewed-by: Rune Lillesveen futhark@chromium.org
Commit-Queue: Anders Hartvoll Ruud andruud@chromium.org
Cr-Commit-Position: refs/heads/main@{#1373411}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.