Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c685d23096c9c4e1c678672029df7db0e99ded2d
https://github.com/WebKit/WebKit/commit/c685d23096c9c4e1c678672029df7db0e99ded2d
Author: Yoav Weiss <[email protected]>
Date: 2026-02-03 (Tue, 03 Feb 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/document-rules-visibility.https-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/document-rules-visibility.https.html
M Source/WebCore/dom/SpeculationRulesMatcher.cpp
Log Message:
-----------
Speculation Rules: ensure that non-visible anchors with visible descendants
get prefetched
https://bugs.webkit.org/show_bug.cgi?id=306860
Reviewed by Alex Christensen.
Anchor elements with `display: contents` may not be visible but could have
visible descendants.
The current speculation rules logic doesn't account for that, and prevents
prefetches on such elements from working.
This fixes that by looking at their descendants and seeing if they are rendered.
Test:
imported/w3c/web-platform-tests/speculation-rules/prefetch/document-rules-visibility.https.html
*
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/document-rules-visibility.https-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/speculation-rules/prefetch/document-rules-visibility.https.html:
Added.
* Source/WebCore/dom/SpeculationRulesMatcher.cpp:
(WebCore::hasRenderedDescendants): Check if any descendant is rendered.
(WebCore::SpeculationRulesMatcher::hasMatchingRule): Expand on the visibility
logic to include descendant check.
Canonical link: https://commits.webkit.org/306730@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications