From 209351ae3db0b93f4561926a8bc367db0b5bbb5b Mon Sep 17 00:00:00 2001 From: Matt Giuca Date: Tue, 22 May 2018 17:29:43 +1000 Subject: [PATCH] Move same-origin-as-document check to steps for obtaining. Now the steps for processing a manifest do not take a document URL. This is necessary as manifests are often processed independent of a document, and the interpretation of a manifest should not depend upon the document it was included from. Normative change: If the start_url is not same-origin as the document URL, the entire manifest is rejected (as part of obtaining a manifest from a document, rather than processing a manifest), rather than getting a default start_url. Closes #668 --- index.html | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index 382fbdf28..83152115b 100644 --- a/index.html +++ b/index.html @@ -1302,9 +1302,14 @@

"!FETCH#concept-request-body">body.
  • Let manifest be the result of running processing a - manifest given text, manifest URL, and the - URL that represents the address of the top-level browsing - context. + manifest given text and manifest URL. +
  • +
  • If + manifest["start_url"] is not same origin as + the URL that represents the address of the top-level browsing + context, issue a developer warning that the start_url + needs to be same-origin as Document of the + top-level browsing context, then abort these steps.
  • Return manifest and manifest URL.
  • @@ -1406,9 +1411,8 @@

    following algorithm. The algorithm takes a string text as an argument, which represents a manifest, and a URL manifest URL, which represents the - location of the manifest, and an optional URL document - URL. The output from inputting an JSON document into this - algorithm is a processed manifest. + location of the manifest. The output from inputting an JSON document + into this algorithm is a processed manifest.

    We need to catch throws associated with enumerations in IDL @@ -1450,8 +1454,7 @@

  • Set manifest["start_url"] to the result of running processing the start_url member given - manifest["start_url"], manifest URL, and - document URL. + manifest["start_url"], and manifest URL.
  • Set manifest["lang"] to the result of running processing the lang member given @@ -1955,17 +1958,12 @@

    The steps for processing the start_url member are given by the following algorithm. The algorithm takes a - USVString value, a URL manifest - URL, and an optional URL document URL. This - algorithm returns a URL. + USVString value, and a URL manifest + URL. This algorithm returns a URL.

      -
    1. If document URL is given, and manifest URL - is not same origin as document URL, let - default be document URL. -
    2. -
    3. Otherwise, let default be the result of parsing - ".", using manifest URL as the base URL. +
    4. Let default be the result of parsing ".", using + manifest URL as the base URL.
    5. If value is the empty string, return default. @@ -1983,18 +1981,6 @@

  • -
  • If document URL is given, and start URL is - not same origin as document URL: -
      -
    1. - Issue a developer warning that the start_url - needs to be same-origin as Document of the - top-level browsing context. -
    2. -
    3. Return default. -
    4. -
    -
  • Otherwise, return start URL.