Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8e2c2d819bbea8947ff300138f476c94ba4979d5
      
https://github.com/WebKit/WebKit/commit/8e2c2d819bbea8947ff300138f476c94ba4979d5
  Author: Antti Koivisto <[email protected]>
  Date:   2026-05-07 (Thu, 07 May 2026)

  Changed paths:
    M LayoutTests/fast/selectors/has-invalidation-traversal-size-expected.txt
    M LayoutTests/fast/selectors/has-invalidation-traversal-size.html
    M Source/WebCore/style/StyleInvalidator.cpp

  Log Message:
  -----------
  [:has()] scope selector matching unnecessarily returns documentElement() on 
failure
https://bugs.webkit.org/show_bug.cgi?id=314318
rdar://176458407

Reviewed by Alan Baradlay.

When no ancestor matches any ruleset's scope selector and no ruleset is
scope-breaking, no :has() bearer can be affected by the change. Return
null and skip invalidation instead of falling back to documentElement.

This fallback isn't reached in practice today. It's a guard for future
changes that thread scope selectors through more invalidation paths.

* LayoutTests/fast/selectors/has-invalidation-traversal-size-expected.txt:
* LayoutTests/fast/selectors/has-invalidation-traversal-size.html:
* Source/WebCore/style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):

Canonical link: https://commits.webkit.org/312804@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to