diff --git a/css-navigation-1/Overview.bs b/css-navigation-1/Overview.bs index f2c8d35de8e6..c07ed9e73f6c 100644 --- a/css-navigation-1/Overview.bs +++ b/css-navigation-1/Overview.bs @@ -115,9 +115,11 @@ as follows: : <> :: : <> : at: <> - :: The result is true if - the document's [=Document/URL=] [=URL pattern/match|matches=] - the [=navigation location URL pattern=] of <>. + :: The result is whether the result of + [=URL pattern/match|match a URL pattern=] is non-null + given urlPattern as + the [=navigation location URL pattern=] of <>, + input as the document's [=Document/URL=]. : from: <> :: The result is true if @@ -127,8 +129,11 @@ as follows: * its [=transition=] is non-null, its [=from entry=]'s {{NavigationHistoryEntry/url}} is non-null and - [=URL pattern/match|matches=] - the [=navigation location URL pattern=] of <>. + [=URL pattern/match|match a URL pattern=] is non-null when + given urlPattern as + the [=navigation location URL pattern=] of <>, + input as that + [=from entry=]'s {{NavigationHistoryEntry/url}}. NOTE: This part handles from: when it matches in the old page. @@ -136,10 +141,14 @@ as follows: the document's [=has been revealed=] is false or was false at the start of the current [=task=], and the activation's {{NavigationActivation/from}}'s - {{NavigationHistoryEntry/url}}'s + {{NavigationHistoryEntry/url}} is non-null and - [=URL pattern/match|matches=] - the [=navigation location URL pattern=] of <>. + [=URL pattern/match|match a URL pattern=] is non-null when + given urlPattern as + the [=navigation location URL pattern=] of <>, + input as that + activation's {{NavigationActivation/from}}'s + {{NavigationHistoryEntry/url}}. NOTE: This part handles from: when it matches in the new page. @@ -149,9 +158,10 @@ as follows: is non-null, and either: * its [=ongoing navigate event=] is non-null, - and the [=current to url=] - [=URL pattern/match|matches=] + [=URL pattern/match|match a URL pattern=] is non-null + given urlPattern as the [=navigation location URL pattern=] of <>, + input as the [=current to url=], where the current to url is defined as: * if the {{pageswap}} event has fired since that navigation began, @@ -188,10 +198,14 @@ as follows: the document's [=has been revealed=] is false or was false at the start of the current [=task=], and the activation's {{NavigationActivation/entry}}'s - {{NavigationHistoryEntry/url}}'s + {{NavigationHistoryEntry/url}} is non-null and - [=URL pattern/match|matches=] - the [=navigation location URL pattern=] of <>. + [=URL pattern/match|match a URL pattern=] is non-null + given urlPattern as + the [=navigation location URL pattern=] of <>, + input as that + activation's {{NavigationActivation/entry}}'s + {{NavigationHistoryEntry/url}}. NOTE: This part handles to: when it matches in the new page. @@ -266,7 +280,98 @@ to model it after. -TODO: To be written. +This specification defines a new '':link-to()'' functional pseudo-class +that matches link elements that link to a certain URL. + +The '':link-to()'' pseudo-class takes a single argument, a <>, +and the pseudo-class matches any element where: +* the element matches '':any-link'' +* the target of link matches the <>, as defined below. + +
+<> = <> [ with <> ]?
+<> = <>
+<> = ( [ <> |
+                                    <> |
+                                    <> ] )
+<> = <>
+                         [ "and" <> ]*
+<> = <>
+                        [ "or" <> ]*
+<> = <> | <>
+<> = <> : <>
+<> = navigation-param( <> )
+
+ +A <> matches the target of the link when both: +* the <> matches the target of the link, and +* the <> matches the target of the link, + with the [=URL pattern=] represented by the <> as context + +A <> represents a [=URL pattern=]. +If the <> is a <>, +then it represents the URL pattern +represented by the <> function +(see [=create a URL pattern for url-pattern()=]). + +A <> matches a URL +when [=URL pattern/match|match a URL pattern=] is non-null +given urlPattern as +the [=URL pattern=] that it represents and +input as the given URL. + +A <> matches a URL +(with a [=URL Pattern=] as context) +based on standard boolean logic for and and or, +and based on whether each <> matches the URL +(with the URL Pattern as context). + +A <> matches the URL input (with a URL Pattern urlPattern as context) +if the following steps return true: +1. Let matchResult be the result of + [=URL pattern/match|match a URL pattern=] + given urlPattern and input. + the [=URL pattern=] + represented by the <> function in the <> + (see [=create a URL pattern for url-pattern()=]) +1. If matchResult is null, return false. + + NOTE: This doesn't really matter because + in this case the <> also doesn't match. +1. For each property prop of matchResult (a {{URLPatternResult}}) + that is a {{URLPatternComponentResult}}: + 1. For each [=map/entry=] entry in its {{URLPatternComponentResult/groups}}, + then: + 1. If <> is a <>, + return true if + entry's [=map/key=] is the <> + and entry's [=map/value=] is the <>. + 1. If <> is a <>, + and entry's [=map/key=] is the function's <>, + then for each navigationUrl of the + current to URL + and current from URL + extract "current to URL" and + "current from URL" from ''@navigation'' + definitions above and link to them: + 1. Let navigationMatchResult be the result of + [=URL pattern/match|match a URL pattern=] + given urlPattern and navigationUrl. + 1. If navigationMatchResult is null, [=continue=]. + 1. Return true if navigationMatchResult's + property prop + has an [=map/entry=] + whose [=map/key=] is the same as entry's key + and whose [=map/value=] is the same as entry's value. + + NOTE: This step makes the ''navigation-param()'' function + perform what is essentially a three-way match, + between the target of the link, + the provided URL pattern, + and the from or to URL of the current navigation. + +ISSUE: A <> should also be able to be a named route +once those are added back to the spec.

The ''url-pattern()'' function