From 1cbc4a4283a7290d133338967030e1cc0b3fab7e Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Tue, 13 May 2008 01:41:18 +0000 Subject: [PATCH] [w] (2) Application caches: Define what happens when the user cancels the download. Resolve the infinite loop when the server is broken but a fallback resource doesn't have a valid manifest= attribute. git-svn-id: http://svn.whatwg.org/webapps@1598 340c8d12-0b0e-0410-8428-c7bf67bfef74 --- index | 77 ++++++++++++++++++++++++++++-------------------- source | 92 ++++++++++++++++++++++++++++++++++++---------------------- 2 files changed, 103 insertions(+), 66 deletions(-) diff --git a/index b/index index 8074b81f50e..93a3b656073 100644 --- a/index +++ b/index @@ -30519,11 +30519,11 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t cache, then:

Fetch the resource normally. If this results 4xx or 5xx status codes - or equivalent, or if there were network errors, then instead fetch, from - the cache, the resource of the fallback entry corresponding to the - namespace with the longest matching <path> component. Abort these - steps.

+ or equivalent, or if there were network errors (but not if the user + canceled the download), then instead fetch, from the cache, the resource + of the fallback + entry corresponding to the namespace with the longest matching + <path> component. Abort these steps.

  • Fail the resource load. @@ -30721,7 +30721,8 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t

  • If this results 4xx or 5xx status codes or equivalent, or if there - were network errors, then abort these steps. + were network errors, or if the user canceled the download, then abort + these steps.

  • Wait for there to be no running scripts, or at least no running @@ -31446,7 +31447,7 @@ user reload must be equivalent to .reload() title=concept-appcache-manifest>manifest with the same origin as the URI in question, and that have this URI as one of their entries (excluding entries marked as manifest), and that + href="#foreign" title=concept-appcache-foreign>foreign), and that already contain their manifest, categorised as a manifest. If so, then the user agent must then fetch the resource from the application cache, and was to be fetched using HTTP GET or equivalent, and its URI matches the opportunistic - caching namespace of one or more application caches, then:

    + caching namespace of one or more application caches, and the user + didn't cancel the navigation attempt during the previous step, then:

    -
    If the file was successfully downloaded - -
    The user agent must cache the resource in all those application - caches, categorised as opportunistically cached entries. - -
    If the server returned a 4xx or 5xx status code or equivalent, or - there were network errors - -
    If the browsing context being navigated is a top-level browsing context, then the user agent - must discard the failed load and instead use the fallback resource specified for the - opportunistic caching namespace in question. If multiple application - caches match, the user agent must use the fallback of the most appropriate - application cache of those that match. For the purposes of session - history (and features that depend on session history, e.g. bookmarking) - the user agent must use the URI of the resource that was requested (the - one that matched the opportunistic caching namespace), not the fallback - resource. However, the user agent may indicate to the user that the - original page load failed, that the page used was a fallback resource, - and what the URI of the fallback resource actually is. +
    If the browsing context being navigated is a top-level browsing context, and the navigation + attempt failed (e.g. the server returned a 4xx or 5xx status code or + equivalent, or there was a DNS error) + +
    +

    Let candidate be the fallback resource specified for + the opportunistic caching namespace in question. If multiple + application caches match, the user agent must use the fallback of the + most appropriate + application cache of those that match.

    + +

    If candidate is not marked as foreign, then the user agent must + discard the failed load and instead continue along these steps using + candidate as the resource.

    + +

    For the purposes of session history (and features that depend on + session history, e.g. bookmarking) the user agent must use the URI of + the resource that was requested (the one that matched the + opportunistic caching namespace), not the fallback resource. However, + the user agent may indicate to the user that the original page load + failed, that the page used was a fallback resource, and what the URI + of the fallback resource actually is.

    + +
    Otherwise + +
    +

    Once the download is complete, if there were no errors and the user + didn't cancel the request, the user agent must cache the resource in + all the application caches that have a matching opportunistic caching + namespace, categorised as opportunistically cached entries. + Meanwhile, the user must continue along these steps.

  • diff --git a/source b/source index 24340708d41..5752eb7cbc5 100644 --- a/source +++ b/source @@ -28390,15 +28390,16 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t
  • -

    If the resource's URI has the same origin as the manifest's URI, and the start of - the resource's URI's <path> component is exactly matched by - the <path> component of an opportunistic caching +

    If the resource's URI has the same origin as the + manifest's URI, and the start of the resource's URI's <path> + component is exactly matched by the <path> component of an + opportunistic caching namespace in the application cache, then:

    Fetch the resource normally. If this results 4xx or 5xx status - codes or equivalent, or if there were network errors, then instead - fetch, from the cache, the resource of the fallback entry corresponding to the namespace with the longest matching <path> component. Abort these steps.

    @@ -28584,7 +28585,8 @@ JSURI: http://ietfreport.isoc.org/all-ids/draft-hoehrmann-javascript-scheme-00.t title="">uri.

  • If this results 4xx or 5xx status codes or equivalent, or if - there were network errors, then abort these steps.

  • + there were network errors, or if the user canceled the download, + then abort these steps.

  • @@ -29289,7 +29291,7 @@ user reload must be equivalent to .reload() with the same origin as the URI in question, and that have this URI as one of their entries (excluding entries marked as manifest), and that + title="concept-appcache-foreign">foreign), and that already contain their manifest, categorised as a manifest. If so, then the user agent must then fetch the resource from the matches the opportunistic caching namespace of one or more application - caches, then:

    + caches, and the user didn't cancel the navigation attempt during + the previous step, then:

    -
    If the file was successfully downloaded
    +
    If the browsing context being navigated is a top-level + browsing context, and the navigation attempt failed + (e.g. the server returned a 4xx or 5xx status code or equivalent, + or there was a DNS error)
    -
    The user agent must cache the resource in all those - application caches, categorised as opportunistically cached - entries.
    - - -
    If the server returned a 4xx or 5xx status code or - equivalent, or there were network errors
    - -
    If the browsing context being navigated is a top-level - browsing context, then the user agent must discard the - failed load and instead use the fallback resource - specified for the opportunistic caching namespace in question. If - multiple application caches match, the user agent must use the - fallback of the most - appropriate application cache of those that match. For the - purposes of session history (and features that depend on session - history, e.g. bookmarking) the user agent must use the URI of the - resource that was requested (the one that matched the - opportunistic caching namespace), not the fallback - resource. However, the user agent may indicate to the user that - the original page load failed, that the page used was a fallback - resource, and what the URI of the fallback resource actually - is.
    +
    + +

    Let candidate be the fallback resource + specified for the opportunistic caching namespace in + question. If multiple application caches match, the user agent + must use the fallback of the most appropriate application + cache of those that match.

    + +

    If candidate is not marked as foreign, then the user + agent must discard the failed load and instead continue along + these steps using candidate as the + resource.

    + +

    For the purposes of session history (and features that depend + on session history, e.g. bookmarking) the user agent must use + the URI of the resource that was requested (the one that matched + the opportunistic caching namespace), not the fallback + resource. However, the user agent may indicate to the user that + the original page load failed, that the page used was a fallback + resource, and what the URI of the fallback resource actually + is.

    + +
    + +
    Otherwise
    + +
    + +

    Once the download is complete, if there were no errors and + the user didn't cancel the request, the user agent must cache + the resource in all the application caches that have a matching opportunistic + caching namespace, categorised as opportunistically cached + entries. Meanwhile, the user must continue along these + steps.

    + +