diff --git a/spec.bs b/spec.bs index 6979fd5..cb4edf8 100644 --- a/spec.bs +++ b/spec.bs @@ -186,44 +186,74 @@ Each {{URLPattern}} object has an associated search componen Each {{URLPattern}} object has an associated hash component, a [=component=], which must be set upon creation.
-
{{URLPattern}} . {{URLPattern/protocol}} +
|urlPattern| = new {{URLPattern/constructor(input, baseURL)|URLPattern}}(|input|)
-

The normalized protocol pattern string. + Constructs a new URLPattern object. The |input| is an object containing separate patterns for each URL component; e.g. hostname, pathname, etc. Missing components will default to a wildcard pattern. In addition, |input| can contain a baseURL property that provides static text patterns for any missing components.

-
{{URLPattern}} . {{URLPattern/username}} +
|urlPattern| = new {{URLPattern/constructor(input, baseURL)|URLPattern}}(|input|, |baseURL|)
-

The normalized username pattern string. + Constructs a new URLPattern object. The |input| is a URL string containing pattern syntax for one or more components. If |baseURL| is provided, then |input| can be relative. This constructor will always set at least an empty string value and does not default any components to wildcard patterns.

-
{{URLPattern}} . {{URLPattern/password}} +
|matches| = |urlPattern|.{{URLPattern/test(input, baseURL)|test}}(|input|)
-

The normalized password pattern string. + Tests if |urlPattern| matches the given arguments. The |input| is an object containing strings representing each URL component; e.g. hostname, pathname, etc. Missing components are treated as empty strings. In addition, |input| can contain a baseURL property that provides values for any missing components. If |urlPattern| matches the |input| on a component-by-component basis then true is returned. Otherwise, false is returned.

-
{{URLPattern}} . {{URLPattern/hostname}} +
|matches| = |urlPattern|.{{URLPattern/test(input, baseURL)|test}}(|input|, |baseURL|)
-

The normalized hostname pattern string. + Tests if |urlPattern| matches the given arguments. The |input| is a URL string. If |baseURL| is provided, then |input| can be relative. If |urlPattern| matches the |input| on a component-by-component basis then true is returned. Otherwise, false is returned.

-
{{URLPattern}} . {{URLPattern/port}} +
|result| = |urlPattern|.{{URLPattern/exec(input, baseURL)|exec}}(|input|)
-

The normalized port pattern string. + Executes the |urlPattern| against the given arguments. The |input| is an object containing strings representing each URL component; e.g. hostname, pathname, etc. Missing components are treated as empty strings. In addition, |input| can contain a baseURL property that provides values for any missing components. If |urlPattern| matches the |input| on a component-by-component basis then an object is returned containing the results. Matched group values are contained in per-component group objects within the |result| object; e.g. `matches.pathname.group.id`. If |urlPattern| does not match the |input|, then |result| is null.

-
{{URLPattern}} . {{URLPattern/pathname}} +
|result| = |urlPattern|.{{URLPattern/exec(input, baseURL)|exec}}(|input|, |baseURL|)
-

The normalized pathname pattern string. + Executes the |urlPattern| against the given arguments. The |input| is a URL string. If |baseURL| is provided, then |input| can be relative.. If |urlPattern| matches the |input| on a component-by-component basis then an object is returned containing the results. Matched group values are contained in per-component group objects within the |result| object; e.g. `matches.pathname.group.id`. If |urlPattern| does not match the |input|, then |result| is null.

-
{{URLPattern}} . {{URLPattern/search}} +
|urlPattern|.{{URLPattern/protocol}}
-

The normalized search pattern string. +

Returns |urlPattern|'s normalized protocol pattern string.

-
{{URLPattern}} . {{URLPattern/hash}} +
|urlPattern|.{{URLPattern/username}}
-

The normalized hash pattern string. +

Returns |urlPattern|'s normalized username pattern string. +

+ +
|urlPattern|.{{URLPattern/password}}
+
+

Returns |urlPattern|'s normalized password pattern string. +

+ +
|urlPattern|.{{URLPattern/hostname}}
+
+

Returns |urlPattern|'s normalized hostname pattern string. +

+ +
|urlPattern|.{{URLPattern/port}}
+
+

Returns |urlPattern|'s normalized port pattern string. +

+ +
|urlPattern|.{{URLPattern/pathname}}
+
+

Returns |urlPattern|'s normalized pathname pattern string. +

+ +
|urlPattern|.{{URLPattern/search}}
+
+

Returns |urlPattern|'s normalized search pattern string. +

+ +
|urlPattern|.{{URLPattern/hash}}
+
+

Returns |urlPattern|'s normalized hash pattern string.