From ac9f452220632a07c37403f84c5ceb15a7755e6a Mon Sep 17 00:00:00 2001 From: Jeremy Roman Date: Wed, 8 Jan 2025 16:31:48 -0500 Subject: [PATCH 1/2] Use the basic URL parser when parsing URLs Blob handling is not required, since the resulting URL is not stored in any way that would make the blob handling visible. This is consistent with what the URL constructor and similar uses do. This change should not be observable. Partially addresses #242. --- spec.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.bs b/spec.bs index ed5e405..ad61d1a 100644 --- a/spec.bs +++ b/spec.bs @@ -513,10 +513,10 @@ A component is a [=struct=] with the following [=struct/items=]: 1. If |input| is a {{USVString}}: 1. Let |baseURL| be null. 1. If |baseURLString| was given, then: - 1. Set |baseURL| to the result of [=URL parser|parsing=] |baseURLString|. + 1. Set |baseURL| to the result of [=basic URL parser|parsing=] |baseURLString|. 1. If |baseURL| is failure, return null. 1. [=list/Append=] |baseURLString| to |inputs|. - 1. Set |url| to the result of [=URL parser|parsing=] |input| given |baseURL|. + 1. Set |url| to the result of [=basic URL parser|parsing=] |input| given |baseURL|. 1. If |url| is failure, return null. 1. [=Assert=]: |url| is a [=/URL=]. 1. Set |protocol| to |url|'s [=url/scheme=]. @@ -1852,7 +1852,7 @@ To convert a modifier to a string given a [=part/modifier=] |modifier Username and password are also never inherited from a base URL when constructing a {{URLPattern}}. (They are, however, inherited from the base URL when parsing a URL supplied as an argument to {{URLPattern/test()}} or {{URLPattern/exec()}}.) - 1. Set |baseURL| to the result of [=URL parser|parsing=] |init|["{{URLPatternInit/baseURL}}"]. + 1. Set |baseURL| to the result of [=basic URL parser|parsing=] |init|["{{URLPatternInit/baseURL}}"]. 1. If |baseURL| is failure, then throw a {{TypeError}}. 1. If |init|["{{URLPatternInit/protocol}}"] does not [=map/exist=], then set |result|["{{URLPatternInit/protocol}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/scheme=] and |type|. 1. If |type| is not "`pattern`" and |init| [=map/contains=] none of "{{URLPatternInit/protocol}}", "{{URLPatternInit/hostname}}", "{{URLPatternInit/port}}" and "{{URLPatternInit/username}}", then set |result|["{{URLPatternInit/username}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/username=] and |type|. From 8c660ed9725cb0850e499cf6141733f4ab9ef4b3 Mon Sep 17 00:00:00 2001 From: Jeremy Roman Date: Wed, 8 Jan 2025 17:03:09 -0500 Subject: [PATCH 2/2] make this explicit in the readable text --- spec.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.bs b/spec.bs index ad61d1a..7188623 100644 --- a/spec.bs +++ b/spec.bs @@ -513,10 +513,10 @@ A component is a [=struct=] with the following [=struct/items=]: 1. If |input| is a {{USVString}}: 1. Let |baseURL| be null. 1. If |baseURLString| was given, then: - 1. Set |baseURL| to the result of [=basic URL parser|parsing=] |baseURLString|. + 1. Set |baseURL| to the result of running the [=basic URL parser=] on |baseURLString|. 1. If |baseURL| is failure, return null. 1. [=list/Append=] |baseURLString| to |inputs|. - 1. Set |url| to the result of [=basic URL parser|parsing=] |input| given |baseURL|. + 1. Set |url| to the result of running the [=basic URL parser=] on |input| with |baseURL|. 1. If |url| is failure, return null. 1. [=Assert=]: |url| is a [=/URL=]. 1. Set |protocol| to |url|'s [=url/scheme=]. @@ -1852,7 +1852,7 @@ To convert a modifier to a string given a [=part/modifier=] |modifier Username and password are also never inherited from a base URL when constructing a {{URLPattern}}. (They are, however, inherited from the base URL when parsing a URL supplied as an argument to {{URLPattern/test()}} or {{URLPattern/exec()}}.) - 1. Set |baseURL| to the result of [=basic URL parser|parsing=] |init|["{{URLPatternInit/baseURL}}"]. + 1. Set |baseURL| to the result of running the [=basic URL parser=] on |init|["{{URLPatternInit/baseURL}}"]. 1. If |baseURL| is failure, then throw a {{TypeError}}. 1. If |init|["{{URLPatternInit/protocol}}"] does not [=map/exist=], then set |result|["{{URLPatternInit/protocol}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/scheme=] and |type|. 1. If |type| is not "`pattern`" and |init| [=map/contains=] none of "{{URLPatternInit/protocol}}", "{{URLPatternInit/hostname}}", "{{URLPatternInit/port}}" and "{{URLPatternInit/username}}", then set |result|["{{URLPatternInit/username}}"] to the result of [=processing a base URL string=] given |baseURL|'s [=url/username=] and |type|.