Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b43f1484e567625d0e1b124c405a8c6ba31461b4
      
https://github.com/WebKit/WebKit/commit/b43f1484e567625d0e1b124c405a8c6ba31461b4
  Author: Charlie Wolfe <[email protected]>
  Date:   2026-06-16 (Tue, 16 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/urlpattern/urlpattern-empty-regexp-group-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/urlpattern/urlpattern-empty-regexp-group.html
    M Source/WebCore/Modules/url-pattern/URLPatternTokenizer.cpp

  Log Message:
  -----------
  URL Pattern tokenizer emits a spurious zero-length Regexp token for empty 
regexp groups
https://bugs.webkit.org/show_bug.cgi?id=316976
rdar://179452346

Reviewed by Rupin Mittal.

The "regexp length is zero" branch was missing the "Continue" of the spec's 
tokenize algorithm: it
recorded the tokenizing error but then fell through to add a zero-length Regexp 
token anyway. In
strict mode the required TypeError was dropped (the loop exits before the error 
is checked); in
lenient mode an extra bogus token was appended. Add the missing continue so the 
add-token step is
skipped, matching the other error branches.

Test: 
imported/w3c/web-platform-tests/urlpattern/urlpattern-empty-regexp-group.html

* 
LayoutTests/imported/w3c/web-platform-tests/urlpattern/urlpattern-empty-regexp-group-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/urlpattern/urlpattern-empty-regexp-group.html:
 Added.
* Source/WebCore/Modules/url-pattern/URLPatternTokenizer.cpp:
(WebCore::URLPatternUtilities::Tokenizer::tokenize):

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



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

Reply via email to