Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 48ad1233623c8d84c12e38b8e1a6bde9df8d8ee3
https://github.com/WebKit/WebKit/commit/48ad1233623c8d84c12e38b8e1a6bde9df8d8ee3
Author: Cole Carley <[email protected]>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M Source/WebCore/bindings/js/ScriptController.cpp
M Source/WebCore/page/QuirkBehaviors.h
M Source/WebCore/page/QuirkTable.cpp
M Source/WebCore/page/Quirks.cpp
M Source/WebCore/page/Quirks.h
M Source/WebCore/page/QuirksData.h
M Source/WebCore/page/URLMatch.cpp
M Source/WebCore/page/URLMatch.h
M Tools/TestWebKitAPI/Tests/WebCore/Quirks.cpp
M Tools/TestWebKitAPI/Tests/WebCore/URLMatch.cpp
Log Message:
-----------
[Quirks] Add parameterized quirks to the table
rdar://186013869
Reviewed by Sammy Gill.
Some quirk behaviors cannot be represented by just a bit in the QuirkBitSet, and
need parameters. One example of this is the QuirkBehavior:
needsScriptToEvaluateBeforeRunningScriptFromURLQuirk, which needs to be
parameterized
by a script.
This patch introduces a mechanism for the following:
1. defining QuirkBehaviors with parameters,
The QuirkBehavior type has gained a new field to represent which
parameters are needed
and a field to hold those parameters.
2. verifying that parameterized QuirkBehaviors are being declared correctly at
compile time
I added a static assert to check that every behavior in the QuirkTable
is passing the correct
parameters.
3. representing parameterized QuirkBehaviors in the QuirksData.
QuirksData now holds a vector of parameterized quirk behaviors as well
as the active quirk bits.
The quirk bits still act as the source of truth, while the
parameterized quirk behaviors
hold extra information about parameters, since most quirks are not
parameterized.
On top of this new infrastructure, I ported all scripts used with
needsScriptToEvaluateBeforeRunningScriptFromURLQuirk from Quirks.cpp to the
Quirk table.
Note that I also made it possible to have multiple scripts for one site.
* Source/WebCore/page/QuirkBehaviors.h:
(WebCore::QuirkParameters::fromScript):
(WebCore::QuirkBehavior::operator() const):
* Source/WebCore/page/QuirkTable.cpp:
(WebCore::SiteSpecificQuirks::firstQuirkWithInvalidParameters):
Canonical link: https://commits.webkit.org/320961@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications