Bug 233631

Summary: [:has() pseudo-class] Cache :has() failures for subtrees
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 227702    
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Antti Koivisto 2021-11-30 04:10:33 PST
Add a temporary (style resolution/invalidation scoped) cache that remembers whether a given :has() argument has any matches in a subtree.
Comment 1 Antti Koivisto 2021-11-30 05:58:02 PST
Created attachment 445410 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-11-30 08:48:48 PST
Comment on attachment 445410 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=445410&action=review

> Source/WebCore/css/SelectorChecker.cpp:1252
> -    // FIXME: This is almost the worst possible implementation in terms of performance.
> +    // FIXME: This could be better in terms of performance.

NIce.
Comment 3 Antti Koivisto 2021-11-30 08:51:39 PST
Created attachment 445422 [details]
Patch for landing
Comment 4 EWS 2021-11-30 10:03:35 PST
Committed r286302 (244661@main): <https://commits.webkit.org/244661@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445422 [details].
Comment 5 Radar WebKit Bug Importer 2021-11-30 10:04:26 PST
<rdar://problem/85871354>