[webkit-reviews] review granted: [Bug 234842] [:has() pseudo-class] Avoid O(n^2) in style invalidation with repeated DOM mutations : [Attachment 449053] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 13 09:23:18 PST 2022


Dean Jackson <dino at apple.com> has granted Antti Koivisto <koivisto at iki.fi>'s
request for review:
Bug 234842: [:has() pseudo-class] Avoid O(n^2) in style invalidation with
repeated DOM mutations
https://bugs.webkit.org/show_bug.cgi?id=234842

Attachment 449053: Patch

https://bugs.webkit.org/attachment.cgi?id=449053&action=review




--- Comment #10 from Dean Jackson <dino at apple.com> ---
Comment on attachment 449053
  --> https://bugs.webkit.org/attachment.cgi?id=449053
Patch

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

> Source/WebCore/style/ChildChangeInvalidation.cpp:72
> +		   // FIXME: We should cache this state accross invalidations
instead of just testing a single sibling.

Typo: across

>
LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-comp
lexity.html:29
> +const yellow = 'rgb(128, 0, 128)';

This is actually purple.

>
LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-comp
lexity.html:48
> +for (let i = 0; i < count - 1; ++i) {

Why -1 here?

>
LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-comp
lexity.html:65
> +testColor(`After appending div with ${count} elements. This should not time
out.`, yellow);

You should probably rename yellow to purple since that's what you use in the
CSS.


More information about the webkit-reviews mailing list