Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1cbe050130f63c5e6ed103f346a997e8ab8ab251
      
https://github.com/WebKit/WebKit/commit/1cbe050130f63c5e6ed103f346a997e8ab8ab251
  Author: Cole Carley <[email protected]>
  Date:   2026-08-20 (Thu, 20 Aug 2026)

  Changed paths:
    M LayoutTests/fast/quirks/active-quirks-by-domain-expected.txt
    M LayoutTests/platform/glib/fast/quirks/active-quirks-by-domain-expected.txt
    M 
LayoutTests/platform/mac-sequoia/fast/quirks/active-quirks-by-domain-expected.txt
    M 
LayoutTests/platform/mac-tahoe/fast/quirks/active-quirks-by-domain-expected.txt
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/page/QuirkMatch.h
    M Source/WebCore/page/Quirks.cpp
    M Source/WebCore/page/Quirks.h
    M Source/WebCore/page/QuirksData.h
    M Tools/TestWebKitAPI/CMakeLists.txt
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebCore/QuirkMatch.cpp

  Log Message:
  -----------
  Remove handlers for site specific quirks
https://bugs.webkit.org/show_bug.cgi?id=322151
rdar://185373690

Reviewed by Brent Fulgham.

This patch has two purposes:
1. move away from the dispatch map and quirk handler pattern
2. make it more clear how quirks determine what sites to quirk

Instead of handlers, we keep a static constexpr mapping from the site(s)
we want to quirk to the quirked behavior we want for the matches. This
maps much better to our eventual goal of representing all the quirks
in a datafile.

Previously, URLs were matched in myriad ways, making it difficult to
represent statically. I opted for a structural factory pattern to
declaratively describe matches, which is the new QuirkMatch class.
This maps well to a simple syntax that we can enforce and parse in our
datafile.

I have started with only the site specific quirks because they migrate
easily. I believe some of the other global quirks can be converted to this
new format in the future.

This new approach found two dead quirks, that have been re-enabled. Some
follow up work is probably necessary to determine if they are actually
necessary. Both NeedsGeforcenowWarningDisplayNoneQuirk, and
NeedsFormControlToBeMouseFocusableQuirk were being skipped in the handler
unconditionally.

* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/page/QuirkMatch.h: Added.
(WebCore::QuirkMatchContext::QuirkMatchContext):
(WebCore::QuirkMatch::domain):
(WebCore::QuirkMatch::domains):
(WebCore::QuirkMatch::host):
(WebCore::QuirkMatch::hostOrSubdomainOf):
(WebCore::QuirkMatch::hostEndingWith):
(WebCore::QuirkMatch::anyTopLevelDomain):
(WebCore::QuirkMatch::pathContains):
(WebCore::QuirkMatch::pathStartsWith):
(WebCore::QuirkMatch::pathOrFragmentContains):
(WebCore::QuirkMatch::onlyIf):
(WebCore::QuirkMatch::documentDomainIsOneOf):
(WebCore::QuirkMatch::matches const):
(WebCore::QuirkMatch::QuirkMatch):
(WebCore::QuirkMatch::setPathConstraint):
(WebCore::QuirkMatch::anyPattern const):
(WebCore::QuirkMatch::matchesSite const):
(WebCore::QuirkMatch::matchesPathConstraint const):
(WebCore::QuirkMatch::matchesDocumentDomain const):
(WebCore::quirkBehaviors):
(WebCore::Quirk::apply const):
(WebCore::QuirkMatch::PatternList::PatternList):
* Source/WebCore/page/Quirks.cpp:
* Source/WebCore/page/Quirks.h:
* Source/WebCore/page/QuirksData.h:
(WebCore::QuirksData::isSite const):
(WebCore::QuirksData::addSite):
* LayoutTests/fast/quirks/active-quirks-by-domain-expected.txt:
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/QuirkMatch.cpp: Added.
(TestWebKitAPI::matchesURL):
(TestWebKitAPI::matchesEmbeddedURL):
(TestWebKitAPI::TEST(QuirkMatchTest, DomainMatchesRegistrableDomain)):
(TestWebKitAPI::TEST(QuirkMatchTest, 
DomainUnderstandsMultiLabelPublicSuffixes)):
(TestWebKitAPI::TEST(QuirkMatchTest, DomainsMatchesAnyPatternInTheList)):
(TestWebKitAPI::TEST(QuirkMatchTest, HostMatchesExactHostOnly)):
(TestWebKitAPI::TEST(QuirkMatchTest, HostOrSubdomainOfRespectsLabelBoundaries)):
(TestWebKitAPI::TEST(QuirkMatchTest, HostEndingWithIgnoresLabelBoundaries)):
(TestWebKitAPI::TEST(QuirkMatchTest, 
AnyTopLevelDomainMatchesEveryPublicSuffix)):
(TestWebKitAPI::TEST(QuirkMatchTest, PathContainsMatchesAnywhereInThePath)):
(TestWebKitAPI::TEST(QuirkMatchTest, PathStartsWithIsAnchored)):
(TestWebKitAPI::TEST(QuirkMatchTest, PathOrFragmentContainsSearchesBoth)):
(TestWebKitAPI::TEST(QuirkMatchTest, OnlyTheLastPathConstraintIsKept)):
(TestWebKitAPI::TEST(QuirkMatchTest, ConditionIsANDedWithTheSiteMatch)):
(TestWebKitAPI::TEST(QuirkMatchTest, 
DocumentDomainIsOneOfMatchesEmbeddedDocuments)):
(TestWebKitAPI::TEST(QuirkMatchTest, MatchesIgnoreTheDocumentURLByDefault)):
(TestWebKitAPI::TEST(QuirkMatchTest, RefinementsOfDifferentKindsAreAllANDed)):
(TestWebKitAPI::TEST(QuirkMatchTest, ConditionStacksWithAPathRefinement)):
(TestWebKitAPI::TEST(QuirkMatchTest, ContextDerivesValuesFromTheRightURL)):
(TestWebKitAPI::TEST(QuirkMatchTest, ContextCachesDerivedValues)):
(TestWebKitAPI::TEST(QuirkMatchTest, 
HostsWithoutAPublicSuffixFallBackToTheHost)):
(TestWebKitAPI::TEST(QuirkMatchTest, URLsWithoutAHostMatchNothing)):

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



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

Reply via email to