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

  Changed paths:
    M LayoutTests/fast/quirks/active-quirks-by-domain-expected.txt
    M LayoutTests/fast/quirks/active-quirks-by-domain.html
    M LayoutTests/platform/glib/fast/quirks/active-quirks-by-domain-expected.txt
    M LayoutTests/platform/ios/fast/quirks/active-quirks-by-domain-expected.txt
    M LayoutTests/platform/ipad/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/page/QuirkTable.cpp
    M Source/WebCore/page/URLMatch.cpp
    M Source/WebCore/page/URLMatch.h
    M Tools/TestWebKitAPI/Tests/WebCore/URLMatch.cpp

  Log Message:
  -----------
  Google Maps quirks don't apply on initial page load
https://bugs.webkit.org/show_bug.cgi?id=326315
rdar://189161501

Reviewed by Cole Carley.

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

Google Maps quirks aren't applying on initial load via typed url 
"maps.google.com".
This is happening because of the confluence of three facts:

- `maps.google.com` redirects to `www.google.com/maps`, then replaceStates to 
`www.google.com/maps/@<location>`
- we do not currently reevaluate quirks following pushState or replaceState 
(but do for redirects!)
- our quirk is specified as: 
anyTopLevelDomain("google").when(pathStartsWith("/maps/"))

Because of that last slash, `www.google.com/maps` does not match the quirk, and
because we don't reevaluate after replaceState, we don't ever end up matching 
(until a reload).

To fix, add a "pathStartsWithComponent" matcher, and use that to match both 
/maps and /maps/...

* Source/WebCore/page/QuirkTable.cpp:
* Source/WebCore/page/URLMatch.cpp:
(WebCore::URLMatch::RefinementSet::matchesPathPattern const):
* Source/WebCore/page/URLMatch.h:
(WebCore::URLRefinement::pathStartsWithComponent):
(WebCore::URLMatch::applyRefinement):
* Tools/TestWebKitAPI/Tests/WebCore/URLMatch.cpp:
(TestWebKitAPI::TEST(URLMatchTest, 
PathStartsWithComponentRespectsComponentBoundaries)):

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



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

Reply via email to