From bd9b4e3d14520a41e5c49f3ec9c9c6de0035ce07 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Tue, 29 May 2018 12:22:11 +0900 Subject: [PATCH] Add Request's isHistoryNavigation And also a member on the request concept (history-navigation flag) to support this API. See https://github.com/w3c/ServiceWorker/issues/1167 for the discussion that led to this. Tests: https://github.com/web-platform-tests/wpt/pull/10909. Corresponding HTML change: https://github.com/whatwg/html/pull/3674. --- fetch.bs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index 5598cb1d5..daafe5d45 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1150,6 +1150,12 @@ Unless stated otherwise, it is unset.

This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] +

A request has an associated +history-navigation flag. +Unless stated otherwise, it is unset. + +

This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] +


A request has an associated @@ -4976,6 +4982,7 @@ interface Request { readonly attribute DOMString integrity; readonly attribute boolean keepalive; readonly attribute boolean isReloadNavigation; + readonly attribute boolean isHistoryNavigation; readonly attribute AbortSignal signal; [NewObject] Request clone(); @@ -5136,6 +5143,10 @@ initially a new {{AbortSignal}} object.

request . isReloadNavigation
Returns a boolean indicating whether or not request is for a reload navigation. +
request . isHistoryNavigation +
Returns a boolean indicating whether or not request is for a history + navigation (a.k.a. back-foward navigation). +
request . signal
Returns the signal associated with request, which is an {{AbortSignal}} object indicating whether or not request has been aborted, and its abort @@ -5239,10 +5250,11 @@ constructor must run these steps: integrity metadata is request's integrity metadata, - keepalive flag is request's keepalive flag, and + keepalive flag is request's keepalive flag, reload-navigation flag is request's - reload-navigation flag. - + reload-navigation flag, and + history-navigation flag is request's + history-navigation flag.
  • If any of init's members are present, then: @@ -5254,6 +5266,8 @@ constructor must run these steps:

  • Unset request's reload-navigation flag. +

  • Unset request's history-navigation flag. +

  • Set request's referrer to "client" @@ -5534,6 +5548,10 @@ is set, and false otherwise. invoked, must return true if the context object's request's reload-navigation flag is set, and false otherwise. +

    The isHistoryNavigation attribute's getter, when +invoked, must return true if the context object's request's +history-navigation flag is set, and false otherwise. +

    The signal attribute's getter must return the associated signal.