Skip to content

Commit e9f795e

Browse files
committed
[css-navigation-1] Move the section on the url-pattern() function.
This moves the section for the url-pattern() function into the newly created umbrella section on defining URL patterns.
1 parent 7f796f7 commit e9f795e

1 file changed

Lines changed: 61 additions & 61 deletions

File tree

css-navigation-1/Overview.bs

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,67 @@ NOTE: The bracing syntax also allows for future expansion if needed.
129129
NOTE: Some of the design discussion for this feature has been in
130130
<a href="https://github.com/w3c/csswg-drafts/issues/12594">w3c/csswg-drafts#12594</a>.
131131

132+
<h3 id="url-pattern-function">The ''url-pattern()'' function</h3>
133+
134+
<!--
135+
136+
NOTE: We may eventually want to move this to css-values.
137+
138+
If we do, the definition of "style resource base URL" probably doesn't need to be
139+
exported any more, since it was exported for this definition.
140+
141+
-->
142+
143+
The <dfn export function>url-pattern()</dfn> function represents a [=URL pattern=],
144+
which can be used to match URLs.
145+
146+
<pre class="prod def">
147+
<<url-pattern()>> = url-pattern( <<string>> )
148+
</pre>
149+
150+
This function represents a [=URL pattern=] that can be created
151+
using the steps of the <dfn>create a URL pattern for url-pattern()</dfn> algorithm:
152+
153+
1. Let <var>arg</var> be the <<string>> argument to the ''url-pattern()'' function.
154+
155+
1. Let <var>baseURL</var> be the [=style resource base URL=] of
156+
the rule or declaration block containing the ''url-pattern()'' function.
157+
158+
<div class="issue">
159+
Do we want this to be the base URL all the time?
160+
For use of ''url-pattern()'' in ''@navigation'',
161+
it's likely more useful for the base URL
162+
to be the document URL rather than the style sheet URL.
163+
However, it would be very awkward for ''url-pattern()''
164+
to be inconsistent with ''url()''.
165+
166+
Should we allow the base URL of ''url-pattern()''
167+
to be defined by the consumer?
168+
Should we introduce <code>document-url-pattern()</code>?
169+
Should we do something similar to
170+
[[css-images-3#ambiguous-urls]]
171+
(see <w3c/csswg-drafts#383>)?
172+
173+
Also see other proposed uses of {{URLPattern}} in CSS
174+
in <w3c/csswg-drafts#10975>,
175+
for '':local-link''.
176+
</div>
177+
178+
1. Return the result of [=URL pattern/create|create a URL pattern=] given
179+
<var>arg</var>, <var>baseURL</var>, and an empty [=map=].
180+
181+
NOTE: This function requires that its argument is quoted.
182+
This differs from the ''url()'' function,
183+
which allows its argument to be quoted or unquoted.
184+
185+
To <dfn export>serialize a ''url-pattern()'' function</dfn> <var>f</var>,
186+
[=serialize a function=] <var>f</var>,
187+
using [=serialize a string=] on the single argument
188+
to serialize <var>f</var>'s contents.
189+
190+
NOTE: This is defined this way because {{URLPattern}}
191+
intentionally does not provide a serialization.
192+
132193
<h3 id="route-value-type">The <<route-location>> value type</h3>
133194

134195
<pre class="prod def" dfn-type="type" nohighlight>
@@ -729,67 +790,6 @@ and other things where this section links to non-exported definitions.
729790
ISSUE: Generally figure out if these definitions should care about
730791
the [=ongoing navigate event=] or the [=transition=].
731792

732-
<h2 id="url-pattern-function">The ''url-pattern()'' function</h2>
733-
734-
<!--
735-
736-
NOTE: We may eventually want to move this to css-values.
737-
738-
If we do, the definition of "style resource base URL" probably doesn't need to be
739-
exported any more, since it was exported for this definition.
740-
741-
-->
742-
743-
The <dfn export function>url-pattern()</dfn> function represents a [=URL pattern=],
744-
which can be used to match URLs.
745-
746-
<pre class="prod def">
747-
<<url-pattern()>> = url-pattern( <<string>> )
748-
</pre>
749-
750-
This function represents a [=URL pattern=] that can be created
751-
using the steps of the <dfn>create a URL pattern for url-pattern()</dfn> algorithm:
752-
753-
1. Let <var>arg</var> be the <<string>> argument to the ''url-pattern()'' function.
754-
755-
1. Let <var>baseURL</var> be the [=style resource base URL=] of
756-
the rule or declaration block containing the ''url-pattern()'' function.
757-
758-
<div class="issue">
759-
Do we want this to be the base URL all the time?
760-
For use of ''url-pattern()'' in ''@navigation'',
761-
it's likely more useful for the base URL
762-
to be the document URL rather than the style sheet URL.
763-
However, it would be very awkward for ''url-pattern()''
764-
to be inconsistent with ''url()''.
765-
766-
Should we allow the base URL of ''url-pattern()''
767-
to be defined by the consumer?
768-
Should we introduce <code>document-url-pattern()</code>?
769-
Should we do something similar to
770-
[[css-images-3#ambiguous-urls]]
771-
(see <w3c/csswg-drafts#383>)?
772-
773-
Also see other proposed uses of {{URLPattern}} in CSS
774-
in <w3c/csswg-drafts#10975>,
775-
for '':local-link''.
776-
</div>
777-
778-
1. Return the result of [=URL pattern/create|create a URL pattern=] given
779-
<var>arg</var>, <var>baseURL</var>, and an empty [=map=].
780-
781-
NOTE: This function requires that its argument is quoted.
782-
This differs from the ''url()'' function,
783-
which allows its argument to be quoted or unquoted.
784-
785-
To <dfn export>serialize a ''url-pattern()'' function</dfn> <var>f</var>,
786-
[=serialize a function=] <var>f</var>,
787-
using [=serialize a string=] on the single argument
788-
to serialize <var>f</var>'s contents.
789-
790-
NOTE: This is defined this way because {{URLPattern}}
791-
intentionally does not provide a serialization.
792-
793793
<h2 class="no-num" id="privacy">Privacy Considerations</h2>
794794

795795
ISSUE: To be written.

0 commit comments

Comments
 (0)