diff --git a/spec.bs b/spec.bs index 9649b35..3287120 100644 --- a/spec.bs +++ b/spec.bs @@ -532,11 +532,8 @@ To parse a constructor string given a string |input|: 1. If the result of running [=is a hash prefix=] given |parser| is true, then run [=change state=] given |parser|, "`hash`" and 1. 1. Otherwise if the result of running [=is a search prefix=] given |parser| is true: 1. Run [=change state=] given |parser|, "`search`" and 1. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPattern/hash}}"] to the empty string. 1. Otherwise: 1. Run [=change state=] given |parser|, "`pathname`" and 0. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPattern/search}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPattern/hash}}"] to the empty string. 1. Increment |parser|'s [=constructor string parser/token index=] by |parser|'s [=constructor string parser/token increment=]. 1. [=Continue=]. 1. If |parser|'s [=constructor string parser/state=] is "`authority`": @@ -564,14 +561,6 @@ To parse a constructor string given a string |input|:
We found a protocol suffix, so this is an absolute URLPattern constructor string. Therefore initialize all component to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/username}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/password}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/hostname}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/port}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/pathname}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/search}}"] to the empty string. - 1. Set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/hash}}"] to the empty string. 1. Run [=rewind and set state=] given |parser| and "`protocol`".
We need to eagerly compile the protocol component to determine if it matches any [=special schemes=]. If it does then certain special rules apply. It determines if the pathname defaults to a "`/`" and also whether we will look for the username, password, hostname, and port components. Authority slashes can also cause us to look for these components as well. Otherwise we treat this as an "opaque path URL" and go straight to the pathname component. - 1. If |parser|'s [=constructor string parser/protocol matches a special scheme flag=] is true, then set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/pathname}}"] to "`/`". 1. Let |next state| be "`pathname`". 1. Let |skip| be 1. 1. If the result of running [=next is authority slashes=] given |parser| is true: @@ -642,6 +630,9 @@ To parse a constructor string given a string |input|: 1. Increment |parser|'s [=constructor string parser/token index=] by |parser|'s [=constructor string parser/token increment=]. + 1. If |parser|'s [=constructor string parser/result=] [=map/contains=] "{{URLPatternInit/hostname}}" and not "{{URLPatternInit/port}}", then set |parser|'s [=constructor string parser/result=]["{{URLPatternInit/port}}"] to the empty string. + +