Bug 233489 - [:has() pseudo-class] Invalidation support for adding and removing elements
Summary: [:has() pseudo-class] Invalidation support for adding and removing elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antti Koivisto
URL:
Keywords: InRadar
Depends on:
Blocks: 227702
  Show dependency treegraph
 
Reported: 2021-11-25 00:30 PST by Antti Koivisto
Modified: 2022-01-30 07:07 PST (History)
6 users (show)

See Also:


Attachments
Patch (26.80 KB, patch)
2021-11-25 01:18 PST, Antti Koivisto
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (26.80 KB, patch)
2021-11-25 01:43 PST, Antti Koivisto
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (26.80 KB, patch)
2021-11-25 02:06 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (26.82 KB, patch)
2021-11-25 04:01 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff
Patch (1.55 KB, patch)
2021-11-27 00:13 PST, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2021-11-25 00:30:37 PST
Invalidate on tree mutations
Comment 1 Antti Koivisto 2021-11-25 01:18:05 PST
Created attachment 445124 [details]
Patch
Comment 2 EWS Watchlist 2021-11-25 01:19:06 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Antti Koivisto 2021-11-25 01:43:25 PST
Created attachment 445126 [details]
Patch
Comment 4 Antti Koivisto 2021-11-25 02:06:15 PST
Created attachment 445127 [details]
Patch
Comment 5 Antti Koivisto 2021-11-25 02:06:42 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/31743
Comment 6 Antti Koivisto 2021-11-25 04:01:37 PST
Created attachment 445134 [details]
Patch
Comment 7 EWS 2021-11-25 13:14:26 PST
Committed r286169 (244552@main): <https://commits.webkit.org/244552@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445134 [details].
Comment 8 Radar WebKit Bug Importer 2021-11-25 13:15:56 PST
<rdar://problem/85754298>
Comment 9 Antti Koivisto 2021-11-27 00:12:34 PST
Reopen for a followup to fix perf regression.
Comment 10 Antti Koivisto 2021-11-27 00:13:39 PST
Created attachment 445214 [details]
Patch
Comment 11 EWS 2021-11-27 01:45:07 PST
Committed r286188 (244570@main): <https://commits.webkit.org/244570@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445214 [details].
Comment 12 Ilya Streltsyn 2022-01-30 00:25:05 PST
Unfortunately, Lea Verou's testcase with DOM modification in `setTimeout` (https://codepen.io/leaverou/pen/mdBMMrB) still does not work for me in TP 139 on MacBook Air M1/MacOS Monterey 12.2. Both `.has.empty` and `.has.nth` elements stay pink after `setTimeout` fires and modifies their subtree. Only after I either open the Inspector for the first time, modify the CSS in the CodePen panel, or modify `document.styleSheets` after modifying the subtree in the `setTimeout` callback (e.g. add a new valid `cssRule`), these elements become green.

Could you please look into this issue again?
Comment 13 Antti Koivisto 2022-01-30 07:05:52 PST
The test case appears to work fine in trunk, I think STP 139 just doesn't have the fix yet. It might have been fixed in bug 234842.
Comment 14 Antti Koivisto 2022-01-30 07:07:30 PST
Generally it is a good idea to file a new bug for each issue as that ensures they don't get lost. No need to worry about duplicates, we can sort those out.