Closed Bug 1750140 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 32379 - Add tests for :link or :visited in :has()

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Byungwoo Lee <blee@igalia.com> wrote:

Add tests for :link or :visited in :has()

Added unit tests and web platform tests for :link and :visited
in :has() argument to check leaking visitedness by :has().

When we have ':has(:visited) {...}', the subject elements of the rule
are the ancestors of the visited link element.

To prevent leaking visitedness to the link's ancestors, the ':visited'
selector does not match if it is inside the ':has()' argument selector.
So if a ':has()' argument selector requires a matching ':visited', the
style rule are not applied.

In order to apply the consistent limitation to ':has()' invalidation,
ignored the ':visited' pseudo class when building pseudo type hash set
for ':has()' invalidation to prevent invalidation triggered by :visited.

Bug: 669058
Change-Id: Ibc781c213e454db24fe892d3731f4f26e578a960
Reviewed-on: https://chromium-review.googlesource.com/3386734
WPT-Export-Revision: f954b4e07415318c37e57b882e0ce23f38daab8f

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

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

Total 2 tests

Status Summary

Firefox

OK : 1
FAIL: 2

Chrome

OK : 1
FAIL: 2

Safari

OK : 1
FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/css/selectors/invalidation/location-pseudo-classes-in-has.html
CSS Selectors Invalidation: location pseudo classes in :has() argument: FAIL (Chrome: FAIL, Safari: FAIL)
/css/selectors/has-visited.html: FAIL (Chrome: FAIL, Safari: FAIL)

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