Bug 311672
| Summary: | Skip full-page anchor scan for conservative-only speculation rules | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Basuke Suzuki <basuke> |
| Component: | New Bugs | Assignee: | Basuke Suzuki <basuke> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Basuke Suzuki
processSpeculationRules() scans ALL links on every style recalculation, performing pattern/selector evaluations per anchor. For conservative rules (eagerness: conservative), the result is only consumed at user interaction time (mousedown/pointerdown/keydown). This is wasted work on pages with many links (e.g. magnifiedsand.com with 934 links).
This patch defers matching for conservative-only rules to interaction time in HTMLAnchorElement::defaultEventHandler(), skipping the full-page anchor scan in Document::processSpeculationRules() and HTMLAnchorElement::checkForSpeculationRules() when all rules are conservative.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Basuke Suzuki
<rdar://problem/173520903>
Basuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/62216
EWS
Committed 310814@main (5cf7b15948ed): <https://commits.webkit.org/310814@main>
Reviewed commits have been landed. Closing PR #62216 and removing active labels.