Skip to content

Commit 208e913

Browse files
committed
[css-navigation-1] Add @when/if() integration, and issue about base URLs.
(This is part of importing the history from WICG/declarative-partial-updates.)
1 parent 2b8b264 commit 208e913

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

css-navigation-1/Overview.bs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Abstract: This module contains conditional CSS rules for styling based on routes
1616
</pre>
1717
<!-- for now using Org: w3c rather than Group: csswg because the latter forces an incorrect issue tracking link, overriding Repository -->
1818

19+
<pre class="link-defaults">
20+
spec:css-values-5; type:function; text:if()
21+
</pre>
22+
1923
<!-- FIXME: TEMPORARILY override non-exported definition -->
2024
<pre class=anchors>
2125
url: https://html.spec.whatwg.org/multipage/nav-history-apis.html#concept-navigationtransition-from
@@ -240,9 +244,45 @@ using the steps of the <dfn>create a URL pattern for urlpattern()</dfn> algorith
240244
1. Let <var>baseURL</var> be the [=style resource base URL=] of
241245
the rule or declaration block containing the ''urlpattern()'' function.
242246

247+
<div class="issue">
248+
Do we really want this to be the base URL?
249+
For this particular use of ''urlpattern()'',
250+
it's likely more useful for the base URL
251+
to be the document URL rather than the style sheet URL.
252+
However, it would be very awkward for ''urlpattern()''
253+
to be inconsistent with ''url()''.
254+
Should we introduce <code>document-urlpattern()</code>?
255+
Should we do something similar to
256+
[[css-images-3#ambiguous-urls]]
257+
(see <w3c/csswg-drafts#383>)?
258+
243259
1. Return the result of [=URL pattern/create|create a URL pattern=] given
244260
<var>arg</var>, <var>baseURL</var>, and an empty [=map=].
245261

246262
NOTE: This function requires that its argument is quoted.
247263
This differs from the ''url()'' function,
248264
which allows its argument to be quoted or unquoted.
265+
266+
<h2 id="route-when-function">The ''@when/route()'' function for ''@when''</h2>
267+
268+
This specification defines an additional function for the ''@when'' rule:
269+
270+
<pre class="prod">
271+
<dfn for="@when" function>route()</dfn> = route( <<route-condition>> )
272+
</pre>
273+
274+
The ''@when/route()'' function is associated with the boolean result that
275+
its contained condition is associated with.
276+
277+
<h2 id="route-if-function">The ''if()/route()'' function for ''if()''</h2>
278+
279+
This specification defines an additional function for the ''if()'' function's
280+
<<if-test>> production:
281+
282+
<pre class="prod">
283+
<dfn for="if()" function>route()</dfn> = route( <<route-condition>> )
284+
</pre>
285+
286+
ISSUE: This should probably have a more formal definition of the function,
287+
but I can't find the formal definitions of the existing ''if()'' functions
288+
to model it after.

0 commit comments

Comments
 (0)