Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ed2106d87f6af29f1f7d4bb2dccaa006286fe9af
      
https://github.com/WebKit/WebKit/commit/ed2106d87f6af29f1f7d4bb2dccaa006286fe9af
  Author: Cole Carley <[email protected]>
  Date:   2026-10-05 (Mon, 05 Oct 2026)

  Changed paths:
    M Source/WebCore/page/QuirkBehaviors.h
    M Source/WebCore/page/QuirkTable.cpp
    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] Split pathOrFragmentContains into separate rows
https://bugs.webkit.org/show_bug.cgi?id=326111
rdar://189026249

Reviewed by Brent Fulgham.

pathOrFragmentContains() was a special-purpose refinement that
searched two URL components with one pattern, and it took the path
slot in RefinementSet, so it couldn't be combined with a real path
refinement. This patch replaces it with fragmentContains().

The icloud.com mail and notes rows are each split into a
pathContains() row and a fragmentContains() row.

A URL like icloud.com/notes/#notes now matches both rows.
QuirksData::addBehavior() and merge() always appended, so the behavior
would be recorded twice, so this patch makes addBehavior() skip
duplicates. merge() now goes through addBehavior(), so it no longer
adds duplicates either.

Tests: Tools/TestWebKitAPI/Tests/WebCore/Quirks.cpp
       Tools/TestWebKitAPI/Tests/WebCore/URLMatch.cpp

* Source/WebCore/page/QuirkBehaviors.h:
(WebCore::QuirkParameters::operator==):
* Source/WebCore/page/QuirkTable.cpp:
* Source/WebCore/page/QuirksData.h:
(WebCore::QuirksData::addBehavior):
(WebCore::QuirksData::merge):
* Source/WebCore/page/URLMatch.cpp:
(WebCore::URLMatch::RefinementSet::matchesPathPattern const):
(WebCore::URLMatch::RefinementSet::matches const):
* Source/WebCore/page/URLMatch.h:
(WebCore::URLPatternList::operator==):
(WebCore::URLRefinement::fragmentContains):
(WebCore::URLMatch::applyRefinement):
(WebCore::URLRefinement::pathOrFragmentContains): Deleted.
(WebCore::URLRefinement::lastPathComponentStartsWith): Deleted.
* Tools/TestWebKitAPI/Tests/WebCore/Quirks.cpp:
(TestWebKitAPI::TEST_F(QuirksTest, 
IdenticalBehaviorsWithParametersAreRecordedOnce)):
(TestWebKitAPI::TEST_F(QuirksTest, RowsSplitAcrossPathAndFragmentEachApply)):
(TestWebKitAPI::TEST_F(QuirksTest, 
AnIdenticalBehaviorFromSeveralRowsIsRecordedOnce)):
* Tools/TestWebKitAPI/Tests/WebCore/URLMatch.cpp:
(TestWebKitAPI::TEST(URLMatchTest, PathStartsWithIsAnchored)):
(TestWebKitAPI::TEST(URLMatchTest, FragmentContainsSearchesOnlyTheFragment)):
(TestWebKitAPI::TEST(URLMatchTest, FragmentContainsStacksWithAPathRefinement)):
(TestWebKitAPI::TEST(URLMatchTest, 
LastPathComponentStartsWithIgnoresEarlierSegments)): Deleted.
(TestWebKitAPI::TEST(URLMatchTest, PathOrFragmentContainsSearchesBoth)): 
Deleted.

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



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

Reply via email to