Skip to content

Commit 0dfd603

Browse files
committed
[css-navigation-1] Describe how to: URL changes during redirects.
1 parent 999abcc commit 0dfd603

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

css-navigation-1/Overview.bs

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ as follows:
130130
[=URL pattern/match|matches=]
131131
the [=navigation location URL pattern=] of <<navigation-location>>.
132132

133+
NOTE: This part handles <code>from:</code> when it matches in the old page.
134+
133135
* its [=activation=] is non-null,
134136
the document's [=has been revealed=] is false or
135137
was false at the start of the current [=task=],
@@ -139,16 +141,36 @@ as follows:
139141
[=URL pattern/match|matches=]
140142
the [=navigation location URL pattern=] of <<navigation-location>>.
141143

144+
NOTE: This part handles <code>from:</code> when it matches in the new page.
145+
142146
: to: <<navigation-location>>
143147
:: The result is true if
144148
the [=document's navigation API=] of the document
145149
is non-null, and either:
146150

147151
* its [=ongoing navigate event=] is non-null,
148-
and its {{NavigateEvent/destination}}'s
149-
{{NavigationDestination/url}}
152+
and the [=current to url=]
150153
[=URL pattern/match|matches=]
151-
the [=navigation location URL pattern=] of <<navigation-location>>.
154+
the [=navigation location URL pattern=] of <<navigation-location>>,
155+
where the <dfn>current to url</dfn> is defined as:
156+
157+
* if the {{pageswap}} event has fired since that navigation began,
158+
and its {{PageSwapEvent/activation}} was non-null,
159+
and that {{PageSwapEvent/activation}}'s
160+
{{NavigationActivation/entry}}'s
161+
{{NavigationHistoryEntry/url}} is non-null,
162+
then that
163+
{{NavigationHistoryEntry/url}}.
164+
165+
NOTE: This part <em>does</em> expose the result of redirects.
166+
167+
ISSUE: Is the final "non-null" check needed?
168+
169+
* otherwise, the [=ongoing navigate event=]'s
170+
{{NavigateEvent/destination}}'s
171+
{{NavigationDestination/url}}
172+
173+
NOTE: This part does <em>not</em> expose the result of redirects.
152174

153175
ISSUE: This assumes that the [=ongoing navigate event=]
154176
and the [=transition=] have the same lifetime,
@@ -160,6 +182,8 @@ as follows:
160182
we could probably define this more like "from" above.
161183
But which lifetime is the one we want?
162184

185+
NOTE: This part handles <code>to:</code> when it matches in the old page.
186+
163187
* its [=activation=] is non-null,
164188
the document's [=has been revealed=] is false or
165189
was false at the start of the current [=task=],
@@ -169,18 +193,17 @@ as follows:
169193
[=URL pattern/match|matches=]
170194
the [=navigation location URL pattern=] of <<navigation-location>>.
171195

172-
TODO: Update this definition to handle redirects better.
173-
In particular, we'd like the ''to:'' URL to change
174-
at only a single time,
175-
from the original URL of the navigation to the final one.
176-
There is already a well-defined definition and processing model
177-
that we can depend on.
196+
NOTE: This part handles <code>to:</code> when it matches in the new page.
178197

179198
ISSUE: The above definitions of from and to apparently don't work right
180199
if you start a same-document navigation (e.g., with {{History/pushState}})
181200
in the middle of a cross-document navigation.
182201

183-
ISSUE: Improve integration with [=has been revealed=] rather than monkeypatching it.
202+
ISSUE: Generally improve integration with the HTML spec for these definitions,
203+
instead of monkeypatching.
204+
This includes the interaction with [=has been revealed=]
205+
and the interaction with the {{pageswap}} event,
206+
and other things where this section links to non-exported definitions.
184207

185208
: <<general-enclosed>>
186209
::

0 commit comments

Comments
 (0)