Bug 284588
Summary: | Null-check baseURL parameter when it is provided with an input URLPatternInit | ||
---|---|---|---|
Product: | WebKit | Reporter: | jlee53 |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
jlee53
Currently, implementation is checking to see if the input URLPatternInit's baseURL field has a value. This is incorrect. The spec actually states that we should be checking the baseURLString parameter of the match() function.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
jlee53
I also am updating the function declarations to match the IDL spec. The idl spec says that they should be optional and they currently are not.
[CallWith=CurrentScriptExecutionContext] boolean test(optional URLPatternInput input, optional USVString baseURL);
[CallWith=CurrentScriptExecutionContext] URLPatternResult? exec(optional URLPatternInput input, optional USVString baseURL);
diff --git a/Source/WebCore/Modules/url-pattern/URLPattern.h b/Source/WebCore/Modules/url-pattern/URLPattern.h
index 3569a61912af..d979bcaf9395 100644
--- a/Source/WebCore/Modules/url-pattern/URLPattern.h
+++ b/Source/WebCore/Modules/url-pattern/URLPattern.h
- ExceptionOr<bool> test(ScriptExecutionContext&, std::optional<URLPatternInput>&&, String&& baseURL) const;
+ ExceptionOr<bool> test(ScriptExecutionContext&, std::optional<URLPatternInput>&&, std::optional<String>&& baseURL) const;
- ExceptionOr<std::optional<URLPatternResult>> exec(ScriptExecutionContext&, std::optional<URLPatternInput>&&, String&& baseURL) const;
+ ExceptionOr<std::optional<URLPatternResult>> exec(ScriptExecutionContext&, std::optional<URLPatternInput>&&, std::optional<String>&& baseURL) const;
jlee53
Pull request: https://github.com/WebKit/WebKit/pull/37897
EWS
Committed 287815@main (c1be3898e16f): <https://commits.webkit.org/287815@main>
Reviewed commits have been landed. Closing PR #37897 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/141458595>