From 50c79ec8a1250452db412f84f2982f85b0cb4817 Mon Sep 17 00:00:00 2001 From: Yves-Marie Date: Fri, 15 Mar 2024 14:39:43 +0100 Subject: [PATCH 1/3] fix portValue typo --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index ad3954a..8cccdd4 100644 --- a/spec.bs +++ b/spec.bs @@ -1748,7 +1748,7 @@ To convert a modifier to a string given a [=part/modifier=] |modifier
To canonicalize a port given a string |portValue| and optionally a string |protocolValue|: - 1. If |value| is the empty string, return |value|. + 1. If |portValue| is the empty string, return |portValue|. 1. Let |dummyURL| be a new [=URL record=]. 1. If |protocolValue| was given, then set |dummyURL|'s [=url/scheme=] to |protocolValue|.

Note, we set the [=URL record=]'s [=url/scheme=] in order for the [=basic URL parser=] to recognize and normalize default port values.

From a8bf21b249a52351126d3308c376e9cca25e34fb Mon Sep 17 00:00:00 2001 From: Yves-Marie Date: Fri, 15 Mar 2024 14:55:53 +0100 Subject: [PATCH 2/3] add serializing for port and host properties --- spec.bs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec.bs b/spec.bs index 8cccdd4..e0ef8ee 100644 --- a/spec.bs +++ b/spec.bs @@ -21,6 +21,8 @@ spec: ECMASCRIPT; urlPrefix: https://tc39.es/ecma262/ spec: URL; urlPrefix: https://url.spec.whatwg.org/ type: dfn text: serialize an integer; url: #serialize-an-integer + text: host serializer; url: #concept-host-serializer +

URL patterns

@@ -505,8 +507,8 @@ A component is a [=struct=] with the following [=struct/items=]: 1. Set |protocol| to |url|'s [=url/scheme=]. 1. Set |username| to |url|'s [=url/username=]. 1. Set |password| to |url|'s [=url/password=]. - 1. Set |hostname| to |url|'s [=url/host=] or the empty string if the value is null. - 1. Set |port| to |url|'s [=url/port=] or the empty string if the value is null. + 1. Set |hostname| to |url|'s [=url/host=], [=host serializer|serialized=], or the empty string if the value is null. + 1. Set |port| to |url|'s [=url/port=], [=serialize an integer|serialized=], or the empty string if the value is null. 1. Set |pathname| to the result of [=URL path serializing=] |url|. 1. Set |search| to |url|'s [=url/query=] or the empty string if the value is null. 1. Set |hash| to |url|'s [=url/fragment=] or the empty string if the value is null. @@ -1725,7 +1727,7 @@ To convert a modifier to a string given a [=part/modifier=] |modifier 1. Let |dummyURL| be a new [=URL record=]. 1. Let |parseResult| be the result of running the [=basic URL parser=] given |value| with |dummyURL| as [=basic URL parser/url=] and [=hostname state=] as [=basic URL parser/state override=]. 1. If |parseResult| is failure, then throw a {{TypeError}}. - 1. Return |dummyURL|'s [=url/host=]. + 1. Return |dummyURL|'s [=url/host=], [=host serializer|serialized=], or empty string if it is null.
From c46e9811a61546bfc0fe5991bd3082a085be8282 Mon Sep 17 00:00:00 2001 From: Yves-Marie Date: Fri, 15 Mar 2024 21:31:29 +0100 Subject: [PATCH 3/3] newline cleanup --- spec.bs | 1 - 1 file changed, 1 deletion(-) diff --git a/spec.bs b/spec.bs index e0ef8ee..93bfbea 100644 --- a/spec.bs +++ b/spec.bs @@ -22,7 +22,6 @@ spec: URL; urlPrefix: https://url.spec.whatwg.org/ type: dfn text: serialize an integer; url: #serialize-an-integer text: host serializer; url: #concept-host-serializer -

URL patterns