From 2dcc42c8e774e94e94585b2d1d867d664e282284 Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Tue, 19 Sep 2017 16:52:44 +0200 Subject: [PATCH 1/9] Add IDL section and define IDL for all the members --- index.html | 402 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 233 insertions(+), 169 deletions(-) diff --git a/index.html b/index.html index 14a521924..962c351c2 100644 --- a/index.html +++ b/index.html @@ -295,34 +295,33 @@

short_name).

-
+

Application's name

The application's name is derived from either the - name member or short_name - member (if either is present) - otherwise, it is generated by the + name member or short_name + member (if either is present) - otherwise, it is generated by the user agent or provided by the end-user.

When either member is missing from the manifest, a user agent MAY use - the name member as a fallback for the - short_name member or vice versa. + the name member as a fallback for the + short_name member or vice versa.

- If the name and short_name members are + If the name and short_name members are undefined, the user agent SHOULD assign a default name (e.g., "Untitled"). Alternatively, a user agent MAY allow the end-user to input some text that can serve as the application's name.

- When both the name and - short_name members + When both the name and + short_name members are present, it is left up to implementations to decide which member is best suited for the space available (e.g., the - short_name member might be better suited for the + short_name member might be better suited for the space available underneath an icon).

@@ -826,10 +825,9 @@

URL is not within scope, abort HTML's navigation algorithm with a SecurityError.

-

- A developer specifies the navigation scope via the scope member. In the case where the - scope member is missing or +

+ A developer specifies the navigation scope via the scope + member. In the case where the scope member is missing or in error, the navigation scope is treated as unbounded (represented as the value undefined). In such a case, the manifest is applied to all URLs the application context is @@ -837,7 +835,7 @@

"#navigation-scope-security-considerations">security considerations).

-
+
@@ -905,7 +903,7 @@

-
+

Display modes

@@ -956,12 +954,12 @@

- The display modes values and their corresponding fallback - display modes are as follows: + The display modes values defined by DisplayModeType, + and their corresponding fallback display modes are as follows:

- fullscreen + fullscreen
Opens the web application without any user agent chrome and takes up @@ -972,7 +970,7 @@

standalone.

- standalone + standalone
Opens the web application to look and feel like a standalone native @@ -987,7 +985,7 @@

minimal-ui.

- minimal-ui + minimal-ui
This mode is similar to fullscreen, but provides the end-user @@ -1002,7 +1000,7 @@

browser.

- browser + browser
Opens the web application using the platform-specific convention for @@ -1049,7 +1047,7 @@

transition, or speaking the text "Launching application X".

-
+

The 'display-mode' media feature

@@ -1500,8 +1498,8 @@

argument.
  • Let icons of parsed manifest be the result - of running the steps for processing an array of images with - manifest, manifest URL, and "icons" as + of running the steps for processing an array of image resources + with manifest, manifest URL, and "icons" as arguments.
  • Let scope of parsed manifest be the result @@ -1540,7 +1538,7 @@

    argument.

  • Let screenshots of parsed manifest be the - result of running the steps for processing an array of images + result of running the steps for processing an array of image resources with manifest, manifest URL, and "screenshots" as arguments.
  • @@ -1574,7 +1572,7 @@

    Please note that the start URL is not necessarily the value - of the start_url member: the user or user agent + of the start_url member: the user or user agent could have changed it when the application was added to home-screen or otherwise bookmarked.

    @@ -1592,17 +1590,40 @@

    -
    +

    Manifest and its members

    A manifest is a JSON document that contains startup parameters and application defaults for when a web application is - launched. A manifest consists of a top-level object that - contains zero or more members. Each of the members are defined below, - as well as how their values are processed. + launched. A manifest consists of a top-level WebAppManifest + object that contains zero or more members. + Each of the members are defined below, as well as how their values are processed.

    +
    +          [NoInterfaceObject]
    +          dictionary WebAppManifest {
    +             TextDirectionType? dir;
    +             USVString? lang;
    +             USVString? name;
    +             USVString? short_name;
    +             USVString? description;
    +             sequence<ImageResource>? icons;
    +             sequence<ImageResource>? screenshots;
    +             sequence<CategoryType>? categories;
    +             USVString? iarc_rating_id;
    +             USVString? start_url;
    +             DisplayModeType? display;
    +             OrientationLockType? orientation;
    +             USVString? theme_color;
    +             USVString? background_color;
    +             USVString? scope;
    +             ServiceWorkerRegistration? serviceworker;
    +             sequence<ExternalApplicationResource>? related_applications;
    +             boolean? prefer_related_applications;
    +          };
    +      

    Every manifest has an associated manifest URL, which is the [[!URL]] from which the manifest was fetched. @@ -1612,45 +1633,49 @@

    dir member

    - The dir member specifies the base + The dir member specifies the base direction for the directionality-capable members of the manifest. The dir member's value can be set to one of the text-direction values.

    +
    +            [NoInterfaceObject]
    +            enum TextDirectionType { "ltr", "rtl", "auto" };
    +        

    The directionality-capable members are:

    - The text-direction values - are the following, implying that the value of the + The text-direction values defined by + TextDirectionType, are the following, implying that the value of the directionality-capable members is by default:

    -
    +
    - ltr + ltr
    left-to-right text.
    - rtl + rtl
    right-to-left text.
    - auto + auto
    end-user, the user agent MUST use the base direction to compute directional runs and layout or position text correctly in text containing mixed-direction sequences [[!BIDI]]. When the base - direction is "auto" the user + direction is "auto" the user agent MUST run the steps to programmatically determine the directionality of a member - and use the resulting text-direction value to assist in displaying the value of the @@ -1729,7 +1754,7 @@

    lang member

    - The lang member is a + The lang member is a language tag (string) that specifies the primary language for the values of the manifest's directionality-capable members (as knowing the language can also help with directionality). @@ -1794,7 +1819,7 @@

    name member

    - The name member is a + The name member is a string that represents the name of the web application as it is usually displayed to the user (e.g., amongst a list of other applications, or as a label for an icon). @@ -1828,7 +1853,7 @@

    short_name member

    - The short_name member + The short_name member is a string that represents a short version of the name of the web application. It is intended to be used where there is insufficient space to display the full name of the web application. @@ -1862,8 +1887,8 @@

    description member

    - The description - member allows the developer to describe the purpose of the web + The description + member allows the developer to describe the purpose of the web application.

    @@ -1896,7 +1921,7 @@

    - The scope member is a + The scope member is a string that represents the navigation scope of this web application's application context.

    @@ -1972,8 +1997,8 @@

    icons member

    - The icons member is an - array of image objects that can serve as iconic + The icons member is an + array of ImageResources that can serve as iconic representations of the web application in various contexts. For example, they can be used to represent the web application amongst a list of other applications, or to integrate the web application with @@ -1982,7 +2007,7 @@

    The icons member is processed using the steps for - processing an array of images. + processing an array of image resources.

    If there are multiple equally appropriate icons in icons, @@ -1991,8 +2016,8 @@

    agent tries to use an icon but that icon is determined, upon closer examination, to in fact be inappropriate (e.g. because its content type is unsupported), then the user agent MUST try the - next-most-appropriate icon as determined by examining the image - object's members. + next-most-appropriate icon as determined by examining the + ImageResource's members.

    @@ -2042,9 +2067,18 @@

    display member

    +
    +          [NoInterfaceObject]
    +          enum DisplayModeType {
    +            "fullscreen",
    +            "standalone",
    +            "minimal-ui",
    +            "browser"
    +          };
    +        

    - The display member is a - string, whose value is one of display modes values. The + The display member is a DisplayModeType, + whose value is one of display modes values. The item represents the developer's preferred display mode for the web application. When the member is missing or erroneous, the user agent MUST use the fallback display mode. @@ -2090,8 +2124,8 @@

    orientation member

    - The orientation - member is a string that serves as the default + The orientation + member is a string that serves as the default orientation for all top-level browsing contexts of the web application. The possible values are those of the OrientationLockType enum defined in @@ -2172,14 +2206,14 @@

    start_url member

    - The start_url member is a string that + The start_url member is a string that represents the start URL , which is URL that the developer would prefer the user agent load when the user launches the web application (e.g., when the user clicks on the icon of the web application from a device's application menu or homescreen).

    - The start_url member is purely advisory, and a + The start_url member is purely advisory, and a user agent MAY ignore it or provide the end-user the choice not to make use of it. A user agent MAY also allow the end-user to modify the URL when, for instance, a bookmark for the web application @@ -2275,11 +2309,11 @@

    serviceworker member

    - The serviceworker member describes a service + The serviceworker member describes a service worker as defined in [[!SERVICE-WORKERS-1]].

    - The serviceworker member represents an intented + The serviceworker member represents an intented service worker registration in form of a registration @@ -2374,8 +2408,8 @@

    theme_color member

    - The theme_color - member serves as the default theme color for an + The theme_color + member serves as the default theme color for an application context. What constitutes a theme color is defined in [[!HTML]].

    @@ -2439,7 +2473,7 @@

    manifest.

    - The related_applications member lists + The related_applications member lists related applications and serves as an indication of such a relationship between web application and related applications. This relationship is unidirectional and unless a listed application @@ -2457,7 +2491,7 @@

    The steps for processing the related_applications member are given by the following algorithm. The algorithm takes a manifest as an argument. This algorithm returns a list of - application objects applications, which can be empty. + ExternalApplicationResources applications, which can be empty.

    1. Let applications be an empty list. @@ -2529,7 +2563,7 @@

      - The prefer_related_applications member is a + The prefer_related_applications member is a boolean value that is used as a hint for the user agent to say that related applications should be preferred over the web application. The user agent MUST consider the missing value as @@ -2568,8 +2602,8 @@

      background_color member

      - The background_color - member describes the expected background color of the web + The background_color + member describes the expected background color of the web application. It repeats what is already available in the application stylesheet but can be used by the user agent to draw the background color of a web application for which the manifest is known @@ -2627,7 +2661,7 @@

      categories member

      - The categories member + The categories member describes the expected application categories to which the web application belongs.

      @@ -2689,11 +2723,11 @@

      Manifest authors are encouraged to use lower-case.

      - This specification does not define the particular values for a the - categories member. However, the working group + This specification does not define the particular CategoryTypes + for a the categories member. However, the working group maintains a list of known - category values in our wiki. + values in our wiki.

    @@ -2701,8 +2735,8 @@

    screenshots member

    - The screenshots - member is an array of image objects represent the + The screenshots + member is an array of ImageResources, representing the web application in common usage scenarios.

    @@ -2711,8 +2745,8 @@

    iarc_rating_id member

    - The iarc_rating_id - member is a string that represents an ID value of the + The iarc_rating_id + member is a string that represents an ID value of the IARC rating of the web application. It is intended to be used to determine which ages the web application is appropriate for.

    @@ -2769,15 +2803,25 @@

    - Image object and its members + ImageResource and its members

    +
    +        [NoInterfaceObject]
    +        dictionary ImageResource {
    +          USVString src;
    +          DOMString sizes;
    +          USVString type;
    +          USVString purpose;
    +          USVString platform;
    +        };
    +      

    - Each image object + Each ImageResource represents an image that is used as part of a web application, suitable to use in various contexts depending on the semantics of the member that is using the object (e.g., an icon that is part of an application - menu, etc.). For an image object, this specification provides + menu, etc.). For an image resource, this specification provides developers with a means of specifying the dimensions, and media type of an image (i.e., a "responsive image" solution [[RESPIMG-USECASES]]). A user agent can use these values to select an image that is best suited @@ -2785,23 +2829,24 @@

    end-user's preferences.

    - User agents may modify an image object to better match the - platform’s visual style before displaying it to the user, for example - by rounding the corners or painting it in a specific color. It is - recommended that developers prepare their image objects for such + User agents may modify the images associated with an ImageResource + to better match the platform’s visual style before displaying it to the + user, for example by rounding the corners or painting it in a specific color. + It is recommended that developers prepare their image resources for such scenarios to avoid losing important information through, e.g., change of color or clipped corners.

    - Fetching image objects + Fetching image resources

    - To fetch an image object, the user agent MUST run the - steps to fetch an image object. The algorithm takes an - image object, the manifest URL, and the - document (Document) from which the manifest - was linked. It returns a Response: + To fetch the image associated with an ImageResource, + the user agent MUST run the steps to fetch an image resource. + + The algorithm takes an image URL (ImageResource.src), + the manifest URL, and the document (Document) + from which the manifest was linked. It returns a Response:

    1. Let request be a new Request. @@ -2809,7 +2854,7 @@

    2. Set the following properties of request:
      1. - url is set to image object's URL. + url is set to image URL.
      2. initiator is "manifest". @@ -2835,7 +2880,7 @@

    - Content security policy of image objects + Content security policy of image resources

    The security policy that governs whether a user agent can @@ -2881,28 +2926,27 @@

    -
    +

    purpose member

    - The purpose member is an unordered set of + The purpose member is an unordered set of unique space-separated tokens that are ASCII case-insensitive. The allowed values are the icon purposes.

    - When an image object is used as an icon, a + When an ImageResource is used as an icon, a developer can hint that the image is intended to serve some special - purpose in the context of the host OS (i.e., for better - integration). + purpose in the context of the host OS (i.e., for better integration).

    For example, as a badge or "pinned" icon that is visually distinct, in color or form, from an application's launch icon. The user agent uses the value of the - purpose member as a hint to determine where and - how an image object is displayed. Unless declared otherwise by + purpose member as a hint to determine where and + how an ImageResource is displayed. Unless declared otherwise by the developer, a user agent can use an icon for any purpose.

    @@ -2926,7 +2970,7 @@

    The steps for processing a purpose member of an image are given by the following algorithm. The algorithm takes - an image object image. This algorithm will return a + an ImageResource image. This algorithm will return a set.

      @@ -2995,13 +3039,13 @@

    -
    +

    sizes member

    - The sizes member of an image object is a - string consisting of an unordered set of unique + The sizes member of an ImageResource + is a string consisting of an unordered set of unique space-separated tokens which are ASCII case-insensitive that represents the dimensions of an image. Each keyword is either an ASCII case-insensitive match for the string " ZERO (0) character and that are separated by a single U+0078 LATIN SMALL LETTER X or U+0058 LATIN CAPITAL LETTER X character. The keywords represent icon sizes in raw pixels (as opposed to CSS - pixels). When multiple image objects are available, a user + pixels). When multiple ImageResources are available, a user agent MAY use the value to decide which icon is most suitable for a display context (and ignore any that are inappropriate).

    The steps for processing a sizes member of an image are given by the following algorithm. The algorithm takes - an image object image. This algorithm will return a + an ImageResource image. This algorithm will return a set.

      @@ -3053,19 +3097,19 @@

    -
    +

    src member

    - The src member of an - image object is a URL from which a user agent can fetch + The src member of an + ImageResource is a URL from which a user agent can fetch the image's data.

    The steps for processing the src member of an image are given by the following algorithm. The algorithm takes - a image object icon, and a URL manifest + a ImageResource icon, and a URL manifest URL , which is the URL from which the manifest was fetched. This algorithm will return a URL or undefined. @@ -3094,18 +3138,18 @@

    -
    +

    type member

    - The type member of an image object is + The type member of an ImageResource is a hint as to the media type of the image. The purpose of this member is to allow a user agent to ignore images of media types it does not support.

    - There is no default MIME type for image objects. However, for the + There is no default MIME type for image resources. However, for the purposes of determining the type of the resource, user agents must expect the resource to be an image.

    @@ -3144,19 +3188,19 @@

    - Processing an array of images + Processing an array of image resources

    - The steps for processing an array of images are given by + The steps for processing an array of image resources are given by the following algorithm. The algorithm takes a manifest, a URL manifest URL, which is the URL from which the manifest was fetched, and a string that represents the member name of the member which contains the array of - image objects. This algorithm returns a list of image - objects, which can be empty. + ImageResources. This algorithm returns a sequence of ImageResources, + which can be empty.

      -
    1. Let images be an empty list. +
    2. Let images be an empty sequence.
    3. Let unprocessed images be the result of calling the [[\GetOwnProperty]] internal method of manifest @@ -3165,7 +3209,7 @@

    4. If unprocessed images is an array, then:
      1. From unprocessed images, filter out any item where - HasOwnProperty(item,"src") returns false. + HasOwnProperty(item, "src") returns false.
      2. For each potential image in the array:
          @@ -3234,33 +3278,32 @@

          Each member specifies which object a multi-purpose member can be used with.

          -
          +

          platform member

          - The platform - member represents the platform to which a containing - object applies. + The platform member represents the + platform to which a containing object applies.

          The following object types can make use of this member:

          - A platform represents a software distribution ecosystem or + A platform represents a software distribution ecosystem or possibly an operating system.

          This specification does not define the particular values for a the - platform member. However, the working group + platform member. However, the working group maintains a list of known platform values in our wiki. @@ -3268,7 +3311,7 @@

          The steps for processing the platform member of an application are given by the following algorithm. The algorithm - takes an application object application. This + takes an ExternalApplicationResource application. This algorithm will return a string or undefined.

            @@ -3292,25 +3335,33 @@

          - The serviceworker object and its members + The ServiceWorkerRegistration object and its members

          - A serviceworker object represents a service worker + A ServiceWorkerRegistration object represents a service worker registration for the web application.

          -
          +
          +        [NoInterfaceObject]
          +        dictionary ServiceWorkerRegistration {
          +          USVString src;
          +          USVString scope;
          +          USVString type;
          +          boolean use_cache;
          +        };
          +      
          +

          src member

          - The service worker src - member of a serviceworker object is a URL - representing a service worker. + The src member of a ServiceWorkerRegistration + object is a URL representing a service worker.

          The steps for processing the src member of a service worker are given by the following algorithm. The - algorithm takes a serviceworker object + algorithm takes a ServiceWorkerRegistration registration, and a URL manifest URL, which is the URL from which the manifest was fetched. This algorithm will return a URL or @@ -3340,19 +3391,18 @@

    -
    +

    scope member

    - The service worker - scope member of a serviceworker object is - the service worker's associated scope URL. + The scope member of a ServiceWorkerRegistration + object is the service worker's associated scope URL.

    The steps for processing the scope member of a service worker are given by the following algorithm. The - algorithm takes a serviceworker object + algorithm takes a ServiceWorkerRegistration registration, and a URL manifest URL, which is the URL from which the manifest was fetched. This algorithm will return a URL or @@ -3383,20 +3433,20 @@

    -
    +

    type member

    - The service worker type member of a - serviceworker object is the service worker's type member of a + ServiceWorkerRegistration object is the service worker's worker type.

    The steps for processing the type member of a service worker are given by the following algorithm. The - algorithm takes a serviceworker object + algorithm takes a ServiceWorkerRegistration registration, and a URL manifest URL, which is the URL from which the manifest was fetched. This algorithm will return a string. @@ -3430,20 +3480,20 @@

    -
    +

    use_cache member

    - The service worker use_cache member of a - serviceworker object determines whether the user agent + The use_cache member of a + ServiceWorkerRegistration object determines whether the user agent cache should be used when fetching the service worker.

    The steps for processing the use_cache member of a service worker are given by the following algorithm. The - algorithm takes a serviceworker object + algorithm takes a serviceworkerregistration registration, and a URL manifest URL, which is the URL from which the manifest was fetched. This algorithm will return a boolean. @@ -3472,11 +3522,21 @@

    - Application object and its members + ExternalApplicationResource and its members

    +
    +        [NoInterfaceObject]
    +        dictionary ExternalApplicationResource {
    +          USVString platform;
    +          USVString url;
    +          USVString id;
    +          USVString min_version;
    +          USVString fingerprints;
    +        };
    +      

    - Each application object represents an application related to - the web application. An application object has the following + Each ExternalApplicationResources represents an application related to + the web application. An application resource has the following properties:

    @@ -3515,8 +3575,9 @@

    - A valid application object MUST have platform and - either an url or an id (or both). + A valid ExternalApplicationResource object MUST have + platform and either an url or an + id (or both).

    @@ -3553,19 +3614,19 @@

    Where should the platform expected value be listed?

    -
    +

    url member

    - The url member of an application + The url member of an ExternalApplicationResource object represents the URL at which the application can be found.

    The steps for processing the url member of an application are given by the following algorithm. The algorithm - takes an application object application. This + takes an ExternalApplicationResource application. This algorithm will return an URL or undefined.

      @@ -3590,19 +3651,19 @@

    -
    +

    id member

    - The id member of an application + The id member of an ExternalApplicationResource object represents the id which is used to represent the application on the platform.

    The steps for processing the id member of an application are given by the following algorithm. The algorithm - takes an application object application. This + takes an ExternalApplicationResource application. This algorithm will return a string or undefined.

      @@ -3623,20 +3684,20 @@

    -
    +

    min_version member

    - The min_version member - of an application object represents the minimum version of the - application that is considered related to this web app. This version - is a string with platform-specific syntax and semantics. + The min_version member of an + ExternalApplicationResource object represents the minimum + version of the application that is considered related to this web app. + This version is a string with platform-specific syntax and semantics.

    The steps for processing the min_version member of an application are given by the following algorithm. The - algorithm takes an application object application. + algorithm takes an ExternalApplicationResource application. This algorithm will return a string or undefined.

      @@ -3657,15 +3718,15 @@

    -
    +

    fingerprints member

    - The fingerprints member - of an application object represents a set of cryptographic - fingerprints used for verifying the application. It is given as an - array of fingerprint objects. + The fingerprints member + of an ExternalApplicationResource object represents a set + of cryptographic fingerprints used for verifying the application. + It is given as an array of fingerprint objects.

    A fingerprint object has two properties: type @@ -3675,7 +3736,7 @@

    The steps for processing the fingerprints member of an application are given by the following algorithm. The - algorithm takes an application object application. + algorithm takes an ExternalApplicationResource application. This algorithm will return a list of fingerprint objects, possibly empty.

    @@ -4454,6 +4515,9 @@

    proprietary tags/metadata, if they are present in a document).

    +
    + +

    JSON Schema From 44128404f552c93800df188fe35d91730e7757fd Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Thu, 21 Sep 2017 12:28:04 +0200 Subject: [PATCH 2/9] Review comments --- index.html | 204 ++++++++++++++++++++++++++--------------------------- 1 file changed, 99 insertions(+), 105 deletions(-) diff --git a/index.html b/index.html index 962c351c2..cf1dcb5b8 100644 --- a/index.html +++ b/index.html @@ -295,33 +295,33 @@

    short_name).

    -
    +

    Application's name

    The application's name is derived from either the - name member or short_name + name member or short_name member (if either is present) - otherwise, it is generated by the user agent or provided by the end-user.

    When either member is missing from the manifest, a user agent MAY use - the name member as a fallback for the - short_name member or vice versa. + the name member as a fallback for the + short_name member or vice versa.

    - If the name and short_name members are + If the name and short_name members are undefined, the user agent SHOULD assign a default name (e.g., "Untitled"). Alternatively, a user agent MAY allow the end-user to input some text that can serve as the application's name.

    - When both the name and - short_name members + When both the name and + short_name members are present, it is left up to implementations to decide which member is best suited for the space available (e.g., the - short_name member might be better suited for the + short_name member might be better suited for the space available underneath an icon).

    @@ -826,8 +826,8 @@

    a SecurityError.

    - A developer specifies the navigation scope via the scope - member. In the case where the scope member is missing or + A developer specifies the navigation scope via the scope + member. In the case where the scope member is missing or in error, the navigation scope is treated as unbounded (represented as the value undefined). In such a case, the manifest is applied to all URLs the application context is @@ -1016,11 +1016,11 @@

    The fullscreen display mode is orthogonal to, and works independently of, the [[WHATWG-FULLSCREEN]] API. The - fullscreen display mode affects the + fullscreen display mode affects the fullscreen state of the browser window, while the [[WHATWG-FULLSCREEN]] API operates on an element contained within the viewport. As such, a web application can have its display mode set to - fullscreen, while + fullscreen, while document.fullScreenElement returns null, and fullscreenEnabled returns false.

    @@ -1259,7 +1259,7 @@

    A manifest is obtained and applied regardless of the - media attribute of the link + media attribute of the link element matches the environment or not.

    @@ -1358,10 +1358,10 @@

    - The manifest-src and - default-src directives govern the origins + The manifest-src and + default-src directives govern the origins from which a user agent can fetch a manifest. As with - other directives, by default the manifest-src + other directives, by default the manifest-src directive is *, meaning that a user agent can, [[!FETCH]]'s CORS permitting, fetch the manifest cross-domain. Remote origins (e.g., a "342" alt="manifest-src directive example illustrated">

    For a [[!HTML]] document, [[!CSP3]]'s - manifest-src directive controls the sources + manifest-src directive controls the sources from which a [[!HTML]] document can load a manifest from. The same CSP policy's img-src directive controls where the icon's images can be fetched from. @@ -1590,7 +1590,7 @@

    -
    +

    Manifest and its members

    @@ -1598,21 +1598,20 @@

    A manifest is a JSON document that contains startup parameters and application defaults for when a web application is launched. A manifest consists of a top-level WebAppManifest - object that contains zero or more members. + dictionary that contains zero or more members. Each of the members are defined below, as well as how their values are processed.

    -          [NoInterfaceObject]
               dictionary WebAppManifest {
                  TextDirectionType? dir;
    -             USVString? lang;
    +             DOMString? lang;
                  USVString? name;
                  USVString? short_name;
                  USVString? description;
                  sequence<ImageResource>? icons;
                  sequence<ImageResource>? screenshots;
                  sequence<CategoryType>? categories;
    -             USVString? iarc_rating_id;
    +             DOMString? iarc_rating_id;
                  USVString? start_url;
                  DisplayModeType? display;
                  OrientationLockType? orientation;
    @@ -1633,13 +1632,12 @@ 

    dir member

    - The dir member specifies the base + The dir member specifies the base direction for the directionality-capable members of the - manifest. The dir member's value can be set to + manifest. The dir member's value can be set to one of the text-direction values.

    -            [NoInterfaceObject]
                 enum TextDirectionType { "ltr", "rtl", "auto" };
             

    @@ -1647,13 +1645,13 @@

    @@ -1754,7 +1752,7 @@

    lang member

    - The lang member is a + The lang member is a language tag (string) that specifies the primary language for the values of the manifest's directionality-capable members (as knowing the language can also help with directionality). @@ -1819,7 +1817,7 @@

    name member

    - The name member is a + The name member is a string that represents the name of the web application as it is usually displayed to the user (e.g., amongst a list of other applications, or as a label for an icon). @@ -1853,7 +1851,7 @@

    short_name member

    - The short_name member + The short_name member is a string that represents a short version of the name of the web application. It is intended to be used where there is insufficient space to display the full name of the web application. @@ -1887,7 +1885,7 @@

    description member

    - The description + The description member allows the developer to describe the purpose of the web application.

    @@ -1921,7 +1919,7 @@

    - The scope member is a + The scope member is a string that represents the navigation scope of this web application's application context.

    @@ -1929,7 +1927,7 @@

    The steps for processing the scope member is given by the following algorithm. The algorithm takes a manifest manifest, a URL manifest - URL , a URL document URL, and a URL + URL, a URL document URL, and a URL start URL . This algorithm returns a URL or undefined.

    @@ -1997,7 +1995,7 @@

    icons member

    - The icons member is an + The icons member is an array of ImageResources that can serve as iconic representations of the web application in various contexts. For example, they can be used to represent the web application amongst a @@ -2006,7 +2004,7 @@

    system preferences.

    - The icons member is processed using the steps for + The icons member is processed using the steps for processing an array of image resources.

    @@ -2068,7 +2066,6 @@

    display member

    -          [NoInterfaceObject]
               enum DisplayModeType {
                 "fullscreen",
                 "standalone",
    @@ -2077,7 +2074,7 @@ 

    };

    - The display member is a DisplayModeType, + The display member is a DisplayModeType, whose value is one of display modes values. The item represents the developer's preferred display mode for the web application. When the member is missing or erroneous, the user @@ -2124,15 +2121,15 @@

    orientation member

    - The orientation + The orientation member is a string that serves as the default orientation for all top-level browsing contexts of the web application. The possible values are those of the - OrientationLockType enum defined in + OrientationLockType enum defined in [[!SCREEN-ORIENTATION]].

    - If the user agent honors the value of the orientation + If the user agent honors the value of the orientation member as the default orientation, then that serves as the default orientation for the life of the web application (unless overridden by some other means at runtime). This means that @@ -2143,7 +2140,7 @@

    Although the specification relies on the [[!SCREEN-ORIENTATION]]'s - OrientationLockType, it is OPTIONAL for a user + OrientationLockType, it is OPTIONAL for a user agent to implement the [[!SCREEN-ORIENTATION]] API. Supporting the [[!SCREEN-ORIENTATION]] API is, of course, RECOMMENDED.

    @@ -2185,7 +2182,7 @@

    and set value to be the result.
  • If value is not one of the - OrientationLockType enum values, or + OrientationLockType enum values, or value is unsupported by the user agent, or the value cannot be used together with display mode: @@ -2206,14 +2203,14 @@

    start_url member

    - The start_url member is a string that + The start_url member is a string that represents the start URL , which is URL that the developer would prefer the user agent load when the user launches the web application (e.g., when the user clicks on the icon of the web application from a device's application menu or homescreen).

    - The start_url member is purely advisory, and a + The start_url member is purely advisory, and a user agent MAY ignore it or provide the end-user the choice not to make use of it. A user agent MAY also allow the end-user to modify the URL when, for instance, a bookmark for the web application @@ -2262,7 +2259,7 @@

    1. Issue a developer warning that the - start_url needs to be same-origin as + start_url needs to be same-origin as Document of the top-level browsing context.
    2. Return a new URL whose input is @@ -2275,7 +2272,7 @@

    - For example, if the value of start_url is + For example, if the value of start_url is ../start_point.html, and the manifest's URL is https://example.com/resources/manifest.webmanifest, then the result of URL parsing would be @@ -2284,10 +2281,10 @@

    - Privacy consideration: start_url tracking + Privacy consideration: start_url tracking

    - It's conceivable that the start_url could be crafted + It's conceivable that the start_url could be crafted to indicate that the application was launched from outside the browser (e.g., "start_url": "index.html?launcher=homescreen"). This can be useful for @@ -2309,11 +2306,11 @@

    serviceworker member

    - The serviceworker member describes a service + The serviceworker member describes a service worker as defined in [[!SERVICE-WORKERS-1]].

    - The serviceworker member represents an intented + The serviceworker member represents an intented service worker registration in form of a registration @@ -2408,7 +2405,7 @@

    theme_color member

    - The theme_color + The theme_color member serves as the default theme color for an application context. What constitutes a theme color is defined in [[!HTML]]. @@ -2473,7 +2470,7 @@

    manifest.

    - The related_applications member lists + The related_applications member lists related applications and serves as an indication of such a relationship between web application and related applications. This relationship is unidirectional and unless a listed application @@ -2563,7 +2560,7 @@

    - The prefer_related_applications member is a + The prefer_related_applications member is a boolean value that is used as a hint for the user agent to say that related applications should be preferred over the web application. The user agent MUST consider the missing value as @@ -2602,7 +2599,7 @@

    background_color member

    - The background_color + The background_color member describes the expected background color of the web application. It repeats what is already available in the application stylesheet but can be used by the user agent to draw the @@ -2611,13 +2608,13 @@

    from the network or retrieved from disk.

    - The background_color member is only meant to improve the + The background_color member is only meant to improve the user experience while a web application is loading and MUST NOT be used by the user agent as the background color when the web application's stylesheet is available.

    - The steps for processing the background_color + The steps for processing the background_color member are given by the following algorithm. The algorithm takes a manifest as an argument. This algorithm returns a string or undefined. @@ -2661,12 +2658,12 @@

    categories member

    - The categories member + The categories member describes the expected application categories to which the web application belongs.

    - The categories member is only meant as a hint to + The categories member is only meant as a hint to catalogs or stores listing web applications and it is expected that these will make a best effort to find appropriate categories (or category) under which to list the web application. Like search @@ -2724,7 +2721,7 @@

    This specification does not define the particular CategoryTypes - for a the categories member. However, the working group + for a the categories member. However, the working group maintains a list of known values in our wiki. @@ -2735,7 +2732,7 @@

    screenshots member

    - The screenshots + The screenshots member is an array of ImageResources, representing the web application in common usage scenarios.

    @@ -2745,13 +2742,13 @@

    iarc_rating_id member

    - The iarc_rating_id + The iarc_rating_id member is a string that represents an ID value of the IARC rating of the web application. It is intended to be used to determine which ages the web application is appropriate for.

    - The steps for processing the iarc_rating_id + The steps for processing the iarc_rating_id member is given by the following algorithm. The algorithm takes a manifest as an argument. This algorithm returns a string or undefined. @@ -2807,9 +2804,8 @@

    -        [NoInterfaceObject]
             dictionary ImageResource {
    -          USVString src;
    +          required USVString src;
               DOMString sizes;
               USVString type;
               USVString purpose;
    @@ -2931,7 +2927,7 @@ 

    purpose member

    - The purpose member is an unordered set of + The purpose member is an unordered set of unique space-separated tokens that are ASCII case-insensitive. The allowed values are the icon purposes. @@ -2945,7 +2941,7 @@

    For example, as a badge or "pinned" icon that is visually distinct, in color or form, from an application's launch icon. The user agent uses the value of the - purpose member as a hint to determine where and + purpose member as a hint to determine where and how an ImageResource is displayed. Unless declared otherwise by the developer, a user agent can use an icon for any purpose.

    @@ -3044,7 +3040,7 @@

    sizes member

    - The sizes member of an ImageResource + The sizes member of an ImageResource is a string consisting of an unordered set of unique space-separated tokens which are ASCII case-insensitive that represents the dimensions of an image. Each keyword is either an @@ -3102,7 +3098,7 @@

    src member

    - The src member of an + The src member of an ImageResource is a URL from which a user agent can fetch the image's data.

    @@ -3143,7 +3139,7 @@

    type member

    - The type member of an ImageResource is + The type member of an ImageResource is a hint as to the media type of the image. The purpose of this member is to allow a user agent to ignore images of media types it does not support. @@ -3283,7 +3279,7 @@

    platform member

    - The platform member represents the + The platform member represents the platform to which a containing object applies.

    @@ -3303,7 +3299,7 @@

    This specification does not define the particular values for a the - platform member. However, the working group + platform member. However, the working group maintains a list of known platform values in our wiki. @@ -3335,16 +3331,15 @@

    - The ServiceWorkerRegistration object and its members + The ServiceWorkerRegistration dictionary and its members

    - A ServiceWorkerRegistration object represents a service worker + A ServiceWorkerRegistration dictionary represents a service worker registration for the web application.

    -        [NoInterfaceObject]
             dictionary ServiceWorkerRegistration {
    -          USVString src;
    +          required USVString src;
               USVString scope;
               USVString type;
               boolean use_cache;
    @@ -3355,8 +3350,8 @@ 

    src member

    - The src member of a ServiceWorkerRegistration - object is a URL representing a service worker. + The src member of a ServiceWorkerRegistration + dictionary is a URL representing a service worker.

    The steps for processing the src member of a @@ -3396,8 +3391,8 @@

    scope member

    - The scope member of a ServiceWorkerRegistration - object is the service worker's associated scope URL. + The scope member of a ServiceWorkerRegistration + dictionary is the service worker's associated scope URL.

    The steps for processing the scope member of a @@ -3438,8 +3433,8 @@

    type member

    - The type member of a - ServiceWorkerRegistration object is the service worker's type member of a + ServiceWorkerRegistration dictionary is the service worker's worker type.

    @@ -3485,8 +3480,8 @@

    use_cache member

    - The use_cache member of a - ServiceWorkerRegistration object determines whether the user agent + The use_cache member of a + ServiceWorkerRegistration dictionary determines whether the user agent cache should be used when fetching the service worker.

    @@ -3525,11 +3520,10 @@

    ExternalApplicationResource and its members

    -        [NoInterfaceObject]
             dictionary ExternalApplicationResource {
    -          USVString platform;
    +          required USVString platform;
               USVString url;
    -          USVString id;
    +          DOMString id;
               USVString min_version;
               USVString fingerprints;
             };
    @@ -3575,7 +3569,7 @@ 

    - A valid ExternalApplicationResource object MUST have + A valid ExternalApplicationResource dictionary MUST have platform and either an url or an id (or both).

    @@ -3614,17 +3608,17 @@

    Where should the platform expected value be listed?

    -
    +

    url member

    - The url member of an ExternalApplicationResource - object represents the URL at which the application can be + The url member of an ExternalApplicationResource + dictionary represents the URL at which the application can be found.

    - The steps for processing the url member of an + The steps for processing the url member of an application are given by the following algorithm. The algorithm takes an ExternalApplicationResource application. This algorithm will return an URL or undefined. @@ -3651,13 +3645,13 @@

  • -
    +

    id member

    - The id member of an ExternalApplicationResource - object represents the id which is used to represent the application + The id member of an ExternalApplicationResource + dictionary represents the id which is used to represent the application on the platform.

    @@ -3684,13 +3678,13 @@

    -
    +

    min_version member

    - The min_version member of an - ExternalApplicationResource object represents the minimum + The min_version member of an + ExternalApplicationResource dictionary represents the minimum version of the application that is considered related to this web app. This version is a string with platform-specific syntax and semantics.

    @@ -3718,13 +3712,13 @@

    -
    +

    fingerprints member

    - The fingerprints member - of an ExternalApplicationResource object represents a set + The fingerprints member + of an ExternalApplicationResource dictionary represents a set of cryptographic fingerprints used for verifying the application. It is given as an array of fingerprint objects.

    @@ -3830,7 +3824,7 @@

    "https://w3c.github.io/screen-orientation/#dfn-default-orientation"> default orientation concept and the - OrientationLockType enum, are defined in + OrientationLockType enum, are defined in [[!SCREEN-ORIENTATION]].

    @@ -3840,11 +3834,11 @@

    The manifest-src, + "https://w3c.github.io/webappsec-csp/#manifest_src">manifest-src, img-src, + "https://w3c.github.io/webappsec-csp/#img_src">img-src, and default-src + "https://w3c.github.io/webappsec-csp/#default_src">default-src directives are defined in [[!CSP3]].

    From 8018ba602b203a4a418e69025fceee9c20058631 Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Mon, 25 Sep 2017 14:25:24 +0200 Subject: [PATCH 3/9] More review fixes --- index.html | 554 ++++++++++++++++++++++++++--------------------------- 1 file changed, 272 insertions(+), 282 deletions(-) diff --git a/index.html b/index.html index cf1dcb5b8..663260e71 100644 --- a/index.html +++ b/index.html @@ -301,28 +301,26 @@

    The application's name is derived from either the - name member or short_name - member (if either is present) - otherwise, it is generated by the - user agent or provided by the end-user. + name member or short_name member (if either is present) + - otherwise, it is generated by the user agent or provided by the + end-user.

    When either member is missing from the manifest, a user agent MAY use - the name member as a fallback for the - short_name member or vice versa. + the name member as a fallback for the short_name member + or vice versa.

    - If the name and short_name members are - undefined, the user agent SHOULD assign a default name (e.g., - "Untitled"). Alternatively, a user agent MAY allow the end-user to - input some text that can serve as the application's name. + If the name and short_name members are undefined, the + user agent SHOULD assign a default name (e.g., "Untitled"). + Alternatively, a user agent MAY allow the end-user to input some text + that can serve as the application's name.

    - When both the name and - short_name members - are present, it is left up to implementations to decide which member - is best suited for the space available (e.g., the - short_name member might be better suited for the - space available underneath an icon). + When both the name and short_name members are present, + it is left up to implementations to decide which member is best + suited for the space available (e.g., the short_name member + might be better suited for the space available underneath an icon).

    @@ -826,13 +824,12 @@

    a SecurityError.

    - A developer specifies the navigation scope via the scope - member. In the case where the scope member is missing or - in error, the navigation scope is treated as unbounded - (represented as the value undefined). In such a case, the - manifest is applied to all URLs the application context is - navigated to (see related security + A developer specifies the navigation scope via the scope member. + In the case where the scope member is missing or in error, the + navigation scope is treated as unbounded (represented as the + value undefined). In such a case, the manifest is applied + to all URLs the application context is navigated to (see related + security considerations).

    @@ -954,8 +951,9 @@

    - The display modes values defined by DisplayModeType, - and their corresponding fallback display modes are as follows: + The display modes values defined by + DisplayModeType, and their corresponding fallback display + modes are as follows:

    @@ -1015,12 +1013,11 @@

    The fullscreen display mode is orthogonal to, and works - independently of, the [[WHATWG-FULLSCREEN]] API. The - fullscreen display mode affects the - fullscreen state of the browser window, while the [[WHATWG-FULLSCREEN]] - API operates on an element contained within the viewport. As such, a - web application can have its display mode set to - fullscreen, while + independently of, the [[WHATWG-FULLSCREEN]] API. The fullscreen + display mode affects the fullscreen state of the browser window, + while the [[WHATWG-FULLSCREEN]] API operates on an element contained + within the viewport. As such, a web application can have its display + mode set to fullscreen, while document.fullScreenElement returns null, and fullscreenEnabled returns false.

    @@ -1259,8 +1256,8 @@

    A manifest is obtained and applied regardless of the - media attribute of the link - element matches the environment or not. + media attribute of the link element + matches the environment or not.

    @@ -1358,10 +1355,9 @@

    - The manifest-src and - default-src directives govern the origins - from which a user agent can fetch a manifest. As with - other directives, by default the manifest-src + The manifest-src and default-src directives govern + the origins from which a user agent can fetch a manifest. + As with other directives, by default the manifest-src directive is *, meaning that a user agent can, [[!FETCH]]'s CORS permitting, fetch the manifest cross-domain. Remote origins (e.g., a manifest-src directive example illustrated

    - For a [[!HTML]] document, [[!CSP3]]'s - manifest-src directive controls the sources - from which a [[!HTML]] document can load a manifest from. The - same CSP policy's img-src directive controls where - the icon's images can be fetched from. + For a [[!HTML]] document, [[!CSP3]]'s manifest-src + directive controls the sources from which a [[!HTML]] document + can load a manifest from. The same CSP policy's + img-src directive controls where the icon's images + can be fetched from.
    @@ -1498,9 +1494,9 @@

    argument.
  • Let icons of parsed manifest be the result - of running the steps for processing an array of image resources - with manifest, manifest URL, and "icons" as - arguments. + of running the steps for processing an array of image + resources with manifest, manifest URL, and + "icons" as arguments.
  • Let scope of parsed manifest be the result of running the steps for processing the scope @@ -1538,9 +1534,9 @@

    argument.

  • Let screenshots of parsed manifest be the - result of running the steps for processing an array of image resources - with manifest, manifest URL, and "screenshots" - as arguments. + result of running the steps for processing an array of image + resources with manifest, manifest URL, and + "screenshots" as arguments.
  • Return parsed manifest.
  • @@ -1572,9 +1568,9 @@

    Please note that the start URL is not necessarily the value - of the start_url member: the user or user agent - could have changed it when the application was added to home-screen - or otherwise bookmarked. + of the start_url + member: the user or user agent could have changed it when the + application was added to home-screen or otherwise bookmarked.

    @@ -1592,15 +1588,8 @@

    - Manifest and its members + WebAppManifest dictionary

    -

    - A manifest is a JSON document that contains startup - parameters and application defaults for when a web application is - launched. A manifest consists of a top-level WebAppManifest - dictionary that contains zero or more members. - Each of the members are defined below, as well as how their values are processed. -

               dictionary WebAppManifest {
                  TextDirectionType? dir;
    @@ -1623,6 +1612,11 @@ 

    boolean? prefer_related_applications; };

    +

    + A manifest is a JSON document that contains startup + parameters and application defaults for when a web application is + launched. +

    Every manifest has an associated manifest URL, which is the [[!URL]] from which the manifest was fetched. @@ -1631,15 +1625,15 @@

    dir member

    -

    - The dir member specifies the base - direction for the directionality-capable members of the - manifest. The dir member's value can be set to - one of the text-direction values. -

                 enum TextDirectionType { "ltr", "rtl", "auto" };
             
    +

    + The dir member specifies the base direction for + the directionality-capable members of the manifest. The + dir member's value can be set to one of the text-direction + values. +

    The directionality-capable members are:

    @@ -1655,9 +1649,10 @@

    - The text-direction values defined by - TextDirectionType, are the following, implying that the value of the - directionality-capable members is by default: + The text-direction values + defined by TextDirectionType, are the following, implying + that the value of the directionality-capable members is by + default:

    @@ -1686,8 +1681,8 @@

    end-user, the user agent MUST use the base direction to compute directional runs and layout or position text correctly in text containing mixed-direction sequences [[!BIDI]]. When the base - direction is "auto" the user - agent MUST run the steps to programmatically determine the + direction is "auto" the + user agent MUST run the steps to programmatically determine the directionality of a member - and use the resulting text-direction value to assist in displaying the value of the member. @@ -1752,10 +1747,10 @@

    lang member

    - The lang member is a - language tag (string) that specifies the primary language for - the values of the manifest's directionality-capable members - (as knowing the language can also help with directionality). + The lang member is a language tag (string) that + specifies the primary language for the values of the manifest's + directionality-capable members (as knowing the language can + also help with directionality).

    A language tag is a string that matches the production of @@ -1817,10 +1812,10 @@

    name member

    - The name member is a - string that represents the name of the web application as it - is usually displayed to the user (e.g., amongst a list of other - applications, or as a label for an icon). + The name member is a string that represents the + name of the web application as it is usually displayed to the user + (e.g., amongst a list of other applications, or as a label for an + icon).

    The steps for processing the name member is @@ -1851,10 +1846,10 @@

    short_name member

    - The short_name member - is a string that represents a short version of the name of the - web application. It is intended to be used where there is - insufficient space to display the full name of the web application. + The short_name member is a string that represents a + short version of the name of the web application. It is intended to + be used where there is insufficient space to display the full name of + the web application.

    The steps for processing the short_name @@ -1885,9 +1880,8 @@

    description member

    - The description - member allows the developer to describe the purpose of the web - application. + The description member allows the developer to describe + the purpose of the web application.

    The steps for processing the description @@ -1919,16 +1913,16 @@

    - The scope member is a - string that represents the navigation scope of this web application's - application context. + The scope member is a string that represents the + navigation scope of this web application's application + context.

    The steps for processing the scope member is given by the following algorithm. The algorithm takes a manifest manifest, a URL manifest - URL, a URL document URL, and a URL - start URL . This algorithm returns a URL or + URL, a URL document URL, and a URL start + URL . This algorithm returns a URL or undefined.

      @@ -1995,13 +1989,13 @@

      icons member

      - The icons member is an - array of ImageResources that can serve as iconic - representations of the web application in various contexts. For - example, they can be used to represent the web application amongst a - list of other applications, or to integrate the web application with - an OS's task switcher and/or - system preferences. + The icons member is an array of + ImageResources that can serve as iconic representations of the + web application in various contexts. For example, they can be used to + represent the web application amongst a list of other applications, + or to integrate the web application with an OS's task switcher and/or system + preferences.

      The icons member is processed using the steps for @@ -2074,11 +2068,11 @@

      };

      - The display member is a DisplayModeType, - whose value is one of display modes values. The - item represents the developer's preferred display mode for the - web application. When the member is missing or erroneous, the user - agent MUST use the fallback display mode. + The display member is a DisplayModeType, whose + value is one of display modes values. The item represents the + developer's preferred display mode for the web application. + When the member is missing or erroneous, the user agent MUST use the + fallback display mode.

      The steps for processing the display member @@ -2121,27 +2115,25 @@

      orientation member

      - The orientation - member is a string that serves as the default - orientation for all top-level browsing contexts of the web - application. The possible values are those of the - OrientationLockType enum defined in + The orientation member is a string that serves as + the default orientation for all top-level browsing + contexts of the web application. The possible values are those of + the OrientationLockType enum defined in [[!SCREEN-ORIENTATION]].

      - If the user agent honors the value of the orientation - member as the default orientation, then that serves as the - default orientation for the life of the web application - (unless overridden by some other means at runtime). This means that - the user agent MUST return the orientation to the default - orientation any time the orientation is unlocked - [[!SCREEN-ORIENTATION]] or the top-level browsing context is - navigated. + If the user agent honors the value of the orientation member + as the default orientation, then that serves as the default + orientation for the life of the web application (unless + overridden by some other means at runtime). This means that the user + agent MUST return the orientation to the default orientation + any time the orientation is unlocked [[!SCREEN-ORIENTATION]] or the + top-level browsing context is navigated.

      Although the specification relies on the [[!SCREEN-ORIENTATION]]'s - OrientationLockType, it is OPTIONAL for a user - agent to implement the [[!SCREEN-ORIENTATION]] API. Supporting the + OrientationLockType, it is OPTIONAL for a user agent to + implement the [[!SCREEN-ORIENTATION]] API. Supporting the [[!SCREEN-ORIENTATION]] API is, of course, RECOMMENDED.

      @@ -2181,10 +2173,9 @@

    1. Otherwise, Trim(value), convert to lower-case, and set value to be the result.
    2. -
    3. If value is not one of the - OrientationLockType enum values, or - value is unsupported by the user agent, or the - value cannot be used together with display +
    4. If value is not one of the OrientationLockType + enum values, or value is unsupported by the user agent, or + the value cannot be used together with display mode:
      1. @@ -2203,18 +2194,18 @@

        start_url member

        - The start_url member is a string that - represents the start URL , which is URL that the - developer would prefer the user agent load when the user launches the - web application (e.g., when the user clicks on the icon of the web + The start_url member is a string that represents + the start URL , which is URL that the developer + would prefer the user agent load when the user launches the web + application (e.g., when the user clicks on the icon of the web application from a device's application menu or homescreen).

        - The start_url member is purely advisory, and a - user agent MAY ignore it or provide the end-user the choice - not to make use of it. A user agent MAY also allow the end-user to - modify the URL when, for instance, a bookmark for the web application - is being created or any time thereafter. + The start_url member is purely advisory, and a user agent MAY + ignore it or provide the end-user the choice not to make use + of it. A user agent MAY also allow the end-user to modify the URL + when, for instance, a bookmark for the web application is being + created or any time thereafter.

        The steps for processing the start_url member @@ -2258,9 +2249,9 @@

      2. If 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. + Issue a developer warning that the start_url + needs to be same-origin as Document of the + top-level browsing context.
        2. Return a new URL whose input is document URL. @@ -2284,15 +2275,14 @@

          Privacy consideration: start_url tracking

          - It's conceivable that the start_url could be crafted - to indicate that the application was launched from outside the - browser (e.g., "start_url": - "index.html?launcher=homescreen"). This can be useful for - analytics and possibly other customizations. However, it is also - conceivable that developers could encode strings into the start_url - that uniquely identify the user (e.g., a server assigned - UUID). This is fingerprinting/privacy sensitive - information that the user might not be aware of. + It's conceivable that the start_url could be crafted to + indicate that the application was launched from outside the browser + (e.g., "start_url": "index.html?launcher=homescreen"). + This can be useful for analytics and possibly other customizations. + However, it is also conceivable that developers could encode + strings into the start_url that uniquely identify the user (e.g., a + server assigned UUID). This is fingerprinting/privacy + sensitive information that the user might not be aware of.

          Given the above, it is RECOMMENDED that, upon installation, or any @@ -2306,12 +2296,11 @@

          serviceworker member

          - The serviceworker member describes a service - worker as defined in [[!SERVICE-WORKERS-1]]. + The serviceworker member describes a service worker as + defined in [[!SERVICE-WORKERS-1]].

          - The serviceworker member represents an intented - serviceworker member represents an intented service worker registration in form of a registration object @@ -2405,10 +2394,9 @@

          theme_color member

          - The theme_color - member serves as the default theme color for an - application context. What constitutes a theme color is - defined in [[!HTML]]. + The theme_color member serves as the default theme + color for an application context. What constitutes a theme + color is defined in [[!HTML]].

          If the user agent honors the value of the theme_color @@ -2470,11 +2458,11 @@

          manifest.

          - The related_applications member lists - related applications and serves as an indication of such a - relationship between web application and related applications. - This relationship is unidirectional and unless a listed application - claims the same relationship, the user agent MUST NOT assume a + The related_applications member lists related + applications and serves as an indication of such a relationship + between web application and related applications. This + relationship is unidirectional and unless a listed application claims + the same relationship, the user agent MUST NOT assume a bi-directional endorsement.

          @@ -2488,7 +2476,8 @@

          The steps for processing the related_applications member are given by the following algorithm. The algorithm takes a manifest as an argument. This algorithm returns a list of - ExternalApplicationResources applications, which can be empty. + ExternalApplicationResources applications, which + can be empty.

          1. Let applications be an empty list. @@ -2560,11 +2549,11 @@

            - The prefer_related_applications member is a - boolean value that is used as a hint for the user agent to say that - related applications should be preferred over the web - application. The user agent MUST consider the missing value as - equivalent to have it set to false. If the + The prefer_related_applications member is a boolean value + that is used as a hint for the user agent to say that related + applications should be preferred over the web application. The + user agent MUST consider the missing value as equivalent to have it + set to false. If the prefer_related_applications is set to true, and the user agent wants to suggest to install the web application, the user agent might want to suggest installing one of the related @@ -2599,18 +2588,18 @@

            background_color member

            - The background_color - member describes the expected background color of the web - application. It repeats what is already available in the application - stylesheet but can be used by the user agent to draw the - background color of a web application for which the manifest is known - before the files are actually available, whether they are fetched - from the network or retrieved from disk. + The background_color member describes the expected + background color of the web application. It repeats what is already + available in the application stylesheet but can be used by the + user agent to draw the background color of a web application + for which the manifest is known before the files are actually + available, whether they are fetched from the network or retrieved + from disk.

            - The background_color member is only meant to improve the - user experience while a web application is loading and MUST NOT be - used by the user agent as the background color when the web + The background_color member is only meant to improve the user + experience while a web application is loading and MUST NOT be used by + the user agent as the background color when the web application's stylesheet is available.

            @@ -2658,17 +2647,15 @@

            categories member

            - The categories member - describes the expected application categories to which the web - application belongs. + The categories member describes the expected application + categories to which the web application belongs.

            - The categories member is only meant as a hint to - catalogs or stores listing web applications and it is expected that - these will make a best effort to find appropriate categories (or - category) under which to list the web application. Like search - engines and meta keywords, catalogs and stores are not required to - honor this hint. + The categories member is only meant as a hint to catalogs or + stores listing web applications and it is expected that these will + make a best effort to find appropriate categories (or category) under + which to list the web application. Like search engines and meta + keywords, catalogs and stores are not required to honor this hint.

            The steps for processing the categories @@ -2720,9 +2707,9 @@

            Manifest authors are encouraged to use lower-case.

            - This specification does not define the particular CategoryTypes - for a the categories member. However, the working group - maintains a CategoryTypes for a the categories member. However, + the working group maintains a list of known values in our wiki.

            @@ -2732,9 +2719,9 @@

            screenshots member

            - The screenshots - member is an array of ImageResources, representing the - web application in common usage scenarios. + The screenshots member is an array of + ImageResources, representing the web application in common + usage scenarios.

    @@ -2742,15 +2729,15 @@

    iarc_rating_id member

    - The iarc_rating_id - member is a string that represents an ID value of the - IARC rating of the web application. It is intended to be used to - determine which ages the web application is appropriate for. + The iarc_rating_id member is a string that + represents an ID value of the IARC rating of the web application. It + is intended to be used to determine which ages the web application is + appropriate for.

    - The steps for processing the iarc_rating_id - member is given by the following algorithm. The algorithm takes - a manifest as an argument. This algorithm returns a string + The steps for processing the iarc_rating_id member + is given by the following algorithm. The algorithm takes a + manifest as an argument. This algorithm returns a string or undefined.

      @@ -2813,24 +2800,24 @@

      };

      - Each ImageResource - represents an image that is used as part of a web application, suitable - to use in various contexts depending on the semantics of the member - that is using the object (e.g., an icon that is part of an application - menu, etc.). For an image resource, this specification provides - developers with a means of specifying the dimensions, and media type of - an image (i.e., a "responsive image" solution [[RESPIMG-USECASES]]). A - user agent can use these values to select an image that is best suited - to display on the end-user's device or most closely matches the - end-user's preferences. + Each ImageResource represents an image that is used as part + of a web application, suitable to use in various contexts depending on + the semantics of the member that is using the object (e.g., an icon + that is part of an application menu, etc.). For an image resource, this + specification provides developers with a means of specifying the + dimensions, and media type of an image (i.e., a "responsive image" + solution [[RESPIMG-USECASES]]). A user agent can use these values to + select an image that is best suited to display on the end-user's device + or most closely matches the end-user's preferences.

      - User agents may modify the images associated with an ImageResource - to better match the platform’s visual style before displaying it to the - user, for example by rounding the corners or painting it in a specific color. - It is recommended that developers prepare their image resources for such - scenarios to avoid losing important information through, e.g., change - of color or clipped corners. + User agents may modify the images associated with an + ImageResource to better match the platform’s visual style before + displaying it to the user, for example by rounding the corners or + painting it in a specific color. It is recommended that developers + prepare their image resources for such scenarios to avoid losing + important information through, e.g., change of color or clipped + corners.

      @@ -2838,11 +2825,11 @@

      To fetch the image associated with an ImageResource, - the user agent MUST run the steps to fetch an image resource. - - The algorithm takes an image URL (ImageResource.src), - the manifest URL, and the document (Document) - from which the manifest was linked. It returns a Response: + the user agent MUST run the steps to fetch an image + resource. The algorithm takes an image URL + (ImageResource.src), the manifest URL, and the + document (Document) from which the manifest + was linked. It returns a Response:

      1. Let request be a new Request. @@ -2927,10 +2914,9 @@

        purpose member

        - The purpose member is an unordered set of - unique space-separated tokens that are ASCII - case-insensitive. The allowed values are the icon - purposes. + The purpose member is an unordered set of unique + space-separated tokens that are ASCII case-insensitive. + The allowed values are the icon purposes.

        When an ImageResource is used as an icon, a @@ -2941,9 +2927,9 @@

        For example, as a badge or "pinned" icon that is visually distinct, in color or form, from an application's launch icon. The user agent uses the value of the - purpose member as a hint to determine where and - how an ImageResource is displayed. Unless declared otherwise by - the developer, a user agent can use an icon for any purpose. + purpose member as a hint to determine where and how an + ImageResource is displayed. Unless declared otherwise by the + developer, a user agent can use an icon for any purpose.

        The icon purposes are as follows: @@ -2966,8 +2952,8 @@

        The steps for processing a purpose member of an image are given by the following algorithm. The algorithm takes - an ImageResource image. This algorithm will return a - set. + an ImageResource image. This algorithm will return + a set.

        1. Let purpose be an empty set. @@ -3040,8 +3026,8 @@

          sizes member

          - The sizes member of an ImageResource - is a string consisting of an unordered set of unique + The sizes member of an ImageResource is a + string consisting of an unordered set of unique space-separated tokens which are ASCII case-insensitive that represents the dimensions of an image. Each keyword is either an ASCII case-insensitive match for the string "

          The steps for processing a sizes member of an image are given by the following algorithm. The algorithm takes - an ImageResource image. This algorithm will return a - set. + an ImageResource image. This algorithm will return + a set.

          1. Let sizes be an empty set. @@ -3093,20 +3079,19 @@

      -
      +

      src member

      - The src member of an - ImageResource is a URL from which a user agent can fetch - the image's data. + The src member of an ImageResource is a URL + from which a user agent can fetch the image's data.

      The steps for processing the src member of an image are given by the following algorithm. The algorithm takes - a ImageResource icon, and a URL manifest - URL , which is the URL from which the + a ImageResource icon, and a URL + manifest URL , which is the URL from which the manifest was fetched. This algorithm will return a URL or undefined.

      @@ -3134,15 +3119,14 @@

    -
    +

    type member

    - The type member of an ImageResource is - a hint as to the media type of the image. The purpose of this member - is to allow a user agent to ignore images of media types it does not - support. + The type member of an ImageResource is a hint as to + the media type of the image. The purpose of this member is to allow a + user agent to ignore images of media types it does not support.

    There is no default MIME type for image resources. However, for the @@ -3187,13 +3171,13 @@

    Processing an array of image resources

    - The steps for processing an array of image resources are given by - the following algorithm. The algorithm takes a manifest, a URL - manifest URL, which is the URL from which the + The steps for processing an array of image resources are + given by the following algorithm. The algorithm takes a manifest, a + URL manifest URL, which is the URL from which the manifest was fetched, and a string that represents the member name of the member which contains the array of - ImageResources. This algorithm returns a sequence of ImageResources, - which can be empty. + ImageResources. This algorithm returns a sequence of + ImageResources, which can be empty.

    1. Let images be an empty sequence. @@ -3274,13 +3258,14 @@

      Each member specifies which object a multi-purpose member can be used with.

      -
      +

      platform member

      - The platform member represents the - platform to which a containing object applies. + The platform member represents the platform to + which a containing object applies.

      The following object types can make use of this member: @@ -3299,16 +3284,15 @@

      This specification does not define the particular values for a the - platform member. However, the working group - maintains a list of known - platform values in our wiki. + platform member. However, the working group maintains a + list of + known platform values in our wiki.

      The steps for processing the platform member of an application are given by the following algorithm. The algorithm - takes an ExternalApplicationResource application. This - algorithm will return a string or undefined. + takes an ExternalApplicationResource application. + This algorithm will return a string or undefined.

      1. Let value be the result of calling the @@ -3334,8 +3318,8 @@

        The ServiceWorkerRegistration dictionary and its members

        - A ServiceWorkerRegistration dictionary represents a service worker - registration for the web application. + A ServiceWorkerRegistration dictionary represents a service + worker registration for the web application.

                 dictionary ServiceWorkerRegistration {
        @@ -3433,8 +3417,8 @@ 

        type member

        - The type member of a - ServiceWorkerRegistration dictionary is the service worker's type member of a ServiceWorkerRegistration + dictionary is the service worker's worker type.

        @@ -3475,15 +3459,16 @@

      -
      +

      use_cache member

      - The use_cache member of a - ServiceWorkerRegistration dictionary determines whether the user agent - cache - should be used when fetching the service worker. + The use_cache member of a ServiceWorkerRegistration + dictionary determines whether the user agent cache should + be used when fetching the service worker.

      The steps for processing the use_cache member of a @@ -3515,7 +3500,8 @@

    -
    +

    ExternalApplicationResource and its members

    @@ -3529,9 +3515,9 @@

    };

    - Each ExternalApplicationResources represents an application related to - the web application. An application resource has the following - properties: + Each ExternalApplicationResources represents an application + related to the web application. An application resource has the + following properties:

    @@ -3620,8 +3606,8 @@

    The steps for processing the url member of an application are given by the following algorithm. The algorithm - takes an ExternalApplicationResource application. This - algorithm will return an URL or undefined. + takes an ExternalApplicationResource application. + This algorithm will return an URL or undefined.

    1. Let value be the result of calling the @@ -3651,14 +3637,14 @@

      The id member of an ExternalApplicationResource - dictionary represents the id which is used to represent the application - on the platform. + dictionary represents the id which is used to represent the + application on the platform.

      The steps for processing the id member of an application are given by the following algorithm. The algorithm - takes an ExternalApplicationResource application. This - algorithm will return a string or undefined. + takes an ExternalApplicationResource application. + This algorithm will return a string or undefined.

      1. Let value be the result of calling the @@ -3685,14 +3671,16 @@

        The min_version member of an ExternalApplicationResource dictionary represents the minimum - version of the application that is considered related to this web app. - This version is a string with platform-specific syntax and semantics. + version of the application that is considered related to this web + app. This version is a string with platform-specific syntax and + semantics.

        The steps for processing the min_version member of an application are given by the following algorithm. The - algorithm takes an ExternalApplicationResource application. - This algorithm will return a string or undefined. + algorithm takes an ExternalApplicationResource + application. This algorithm will return a string or + undefined.

        1. Let value be the result of calling the @@ -3717,10 +3705,11 @@

          fingerprints member

          - The fingerprints member - of an ExternalApplicationResource dictionary represents a set - of cryptographic fingerprints used for verifying the application. - It is given as an array of fingerprint objects. + The fingerprints member of an + ExternalApplicationResource dictionary represents a set of + cryptographic fingerprints used for verifying the application. It is + given as an array of fingerprint + objects.

          A fingerprint object has two properties: type @@ -3730,9 +3719,10 @@

          The steps for processing the fingerprints member of an application are given by the following algorithm. The - algorithm takes an ExternalApplicationResource application. - This algorithm will return a list of fingerprint objects, possibly empty. + algorithm takes an ExternalApplicationResource + application. This algorithm will return a list of + fingerprint objects, possibly + empty.

          1. Let fingerprints be an empty list. @@ -4510,7 +4500,7 @@

    - +

    From 50541f16815630efcab7cc951361e4cfb4b04291 Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Thu, 28 Sep 2017 15:41:06 +0200 Subject: [PATCH 4/9] Add IDL processing --- index.html | 1175 ++++++++++++++-------------------------------------- 1 file changed, 301 insertions(+), 874 deletions(-) diff --git a/index.html b/index.html index 663260e71..7728dcc70 100644 --- a/index.html +++ b/index.html @@ -1380,7 +1380,7 @@

    -
    +

    Processing the manifest

    @@ -1416,10 +1416,13 @@

    inputting an JSON document into this algorithm is a processed manifest.

    +

    + We need to catch throws associated with enumerations in IDL + conversion as the spec might gain new values over time not supported + by all exising browsers. +

      -
    1. Let parsed manifest be an empty object. -
    2. -
    3. Let manifest be the result of Let json be the result of parsing text. If parsing throws an error: @@ -1428,19 +1431,19 @@

      Issue a developer warning with any details pertaining to the JSON parsing error.

    4. -
    5. Set manifest to be the result of Set json to be the result of parsing the string "{}".
    -
  • If Type(manifest) is not "object": +
  • If Type(json) is not Object:
    1. Issue a developer warning that the manifest needs to be an object.
    2. -
    3. Set manifest to be the result of Set json to be the result of parsing the string "{}".
    4. @@ -1450,95 +1453,60 @@

      Extension point: process any proprietary and/or other supported members at this point in the algorithm. -
    5. Let the default direction of parsed - manifest be the result of running the steps for processing - the dir member with manifest as the - argument. +
    6. Let WebAppManifest manifest be the result of + converting json to IDL dictionary value.
    7. -
    8. Let start URL of parsed manifest be the - result of running the steps for processing the - start_url member with manifest, - manifest URL, and document URL as arguments. +
    9. Let manifest["start_url"] be the result of + running the steps for post-processing the start_url + member with manifest, manifest URL, and + document URL as arguments.
    10. -
    11. Let service worker registration of parsed - manifest be the result of running the steps for processing - the serviceworker member with manifest, - manifest URL, and serviceworker as arguments. +
    12. Let manifest["display"] be the result of + running the steps for post-processing the display + member with manifest as the argument.
    13. -
    14. Let display mode of parsed manifest be the - result of running the steps for processing the - display member with manifest as the - argument. +
    15. Let manifest["lang"] be the result of running + the steps for post-processing the lang member + with manifest as the argument.
    16. -
    17. Let orientation of parsed manifest be the - result of running the steps for processing the - orientation member with manifest and - display mode as arguments. +
    18. Let manifest["scope"] be the result of running + the steps for post-processing the scope member + with manifest, manifest URL, document + URL, start URL as arguments.
    19. -
    20. Let name of parsed manifest be the result - of running the steps for processing the name - member with manifest as the argument. +
    21. Let manifest["theme_color"] be the result of + running the steps for post-processing the theme_color + member with manifest as argument.
    22. -
    23. Let description of parsed manifest be the - result of running the steps for processing the - description member with manifest as the +
    24. Let manifest["background_color"] be the result + of running the steps for post-processing the + background_color member with manifest as argument.
    25. -
    26. Let language of parsed manifest be the - result of running the steps for processing the lang - member with manifest as the argument. -
    27. -
    28. Let short name of parsed manifest be the - result of running the steps for processing the - short_name member with manifest as the - argument. +
    29. Let manifest["categories"] be the result of + running the steps for post-processing the categories + member with manifest as argument.
    30. -
    31. Let icons of parsed manifest be the result - of running the steps for processing an array of image - resources with manifest, manifest URL, and - "icons" as arguments. +
    32. Let manifest["icons"] be the result of running + the steps for post-processing ImageResource members with + manifest, manifest URL, and "icons" as arguments.
    33. -
    34. Let scope of parsed manifest be the result - of running the steps for processing the scope - member with manifest, manifest URL, - document URL, start URL as arguments. +
    35. Let manifest["screenshots"] be the result of + running the steps for post-processing ImageResource members + with manifest, manifest URL, and "screenshots" + as arguments.
    36. -
    37. Let related applications of parsed manifest - be the result of running the steps for processing the +
    38. Let manifest["related_applications"] be the + result of running the steps for processing the related_applications member with manifest as argument.
    39. -
    40. Let prefer related applications of parsed - manifest be the result of running the steps for processing - the prefer_related_applications member with - manifest as argument. -
    41. -
    42. Let theme color of parsed manifest be the - result of running the steps for processing the - theme_color member with manifest as - argument. -
    43. -
    44. Let background_color of parsed manifest be - the result of running the steps for processing the - background_color member with manifest as - argument. +
    45. Let manifest["serviceworker"] be the result of + running the steps for processing the serviceworker + member with manifest, manifest URL, and + serviceworker as arguments.
    46. -
    47. Let categories of parsed manifest be the - result of running the steps for processing the - categories member with manifest as - argument. -
    48. -
    49. Let iarc_rating_id of parsed manifest be - the result of running the steps for processing the - iarc_rating_id member with manifest as - argument. -
    50. -
    51. Let screenshots of parsed manifest be the - result of running the steps for processing an array of image - resources with manifest, manifest URL, and - "screenshots" as arguments. -
    52. -
    53. Return parsed manifest. +
    54. Return manifest.
  • @@ -1599,7 +1567,7 @@

    USVString? description; sequence<ImageResource>? icons; sequence<ImageResource>? screenshots; - sequence<CategoryType>? categories; + sequence<USVString>? categories; DOMString? iarc_rating_id; USVString? start_url; DisplayModeType? display; @@ -1698,47 +1666,9 @@

    [[!BIDI]].
  • If such a character is found and it is of bidirectional character - type AL or R, return "rtl". + type AL or R, return "rtl".
  • -
  • Otherwise, return "ltr". -
  • - -

    - The steps for processing the dir member is - given by the following algorithm. The algorithm takes a - manifest as an argument. This algorithm returns one of the - text-direction values. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "dir". -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. If Type(value) is "undefined", return - "auto". -
      4. -
      -
    4. -
    5. Otherwise, Trim(value), convert to lower-case, - and let direction be the result. -
    6. -
    7. If direction not one one the text-direction - values, then: -
        -
      1. - Issue a developer warning that the value is - invalid. -
      2. -
      3. Return "auto". -
      4. -
      -
    8. -
    9. Return direction. +
    10. Otherwise, return "ltr".

    @@ -1768,42 +1698,34 @@

    structurally valid.

    - The steps for processing the lang member is - given by the following algorithm. The algorithm takes a - manifest as an argument. This algorithm returns a string - or undefined. + The steps for post-processing the lang member + is given by the following algorithm. The algorithm takes a + WebAppManifest manifest as an argument. This + algorithm returns a DOMString?.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "lang". +
    2. Let V be manifest.lang.
    3. -
    4. If Type(value) is not "string": +
    5. If Type(V) is String:
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    6. -
    7. Otherwise, Trim(value) and let tag - be the result. -
    8. -
    9. If calling IsStructurallyValidLanguageTag with - tag as the argument returns false, then: -
        -
      1. - Issue a developer warning that the value is - invalid. +
      2. If calling IsStructurallyValidLanguageTag with + V as the argument returns false, then: +
          +
        1. + Issue a developer warning that the V is + invalid. +
        2. +
        3. Return null. +
        4. +
      3. -
      4. Return undefined. +
      5. Otherwise, return the result of calling the + CanonicalizeLanguageTag abstract operation, passing + V as the argument.
    10. -
    11. Otherwise, return the result of calling the - CanonicalizeLanguageTag abstract operation, passing - tag as the argument. +
    12. Return null

    @@ -1817,29 +1739,6 @@

    (e.g., amongst a list of other applications, or as a label for an icon).

    -

    - The steps for processing the name member is - given by the following algorithm. The algorithm takes a - manifest as an argument. This algorithm returns a string - or undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "name". -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    @@ -1851,29 +1750,6 @@

    be used where there is insufficient space to display the full name of the web application.

    -

    - The steps for processing the short_name - member is given by the following algorithm. The algorithm takes - a manifest as an argument. This algorithm returns a string - or undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "short_name". -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    @@ -1883,29 +1759,6 @@

    The description member allows the developer to describe the purpose of the web application.

    -

    - The steps for processing the description - member is given by the following algorithm. The algorithm takes - a manifest as an argument. This algorithm returns a string - or undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "description". -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    @@ -1918,40 +1771,31 @@

    context.

    - The steps for processing the scope member is - given by the following algorithm. The algorithm takes a - manifest manifest, a URL manifest - URL, a URL document URL, and a URL start - URL . This algorithm returns a URL or - undefined. + The steps for post-processing the scope + member is given by the following algorithm. The algorithm takes + a WebAppManifest manifest, a URL + manifest URL, a URL document URL, and a + URL start URL . This algorithm returns a URL or + null.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of the manifest - with argument "scope". +
    2. Let V be manifest.scope.
    3. -
    4. Let type be Type(value). +
    5. Let type be Type(V).
    6. -
    7. If type is not "string" or value is the - empty string, then: -
        -
      1. If type is not "undefined", issue - a developer warning that the type is unsupported. -
      2. -
      3. Return undefined. -
      4. -
      +
    8. If type is not String or V is + the empty string, then return null.
    9. -
    10. Let scope URL be a new URL using - value as input and manifest URL as - the base URL. +
    11. Let scope URL be a new URL using V + as input and manifest URL as the + base URL.
    12. If scope URL is failure:
    13. @@ -1966,7 +1810,7 @@

      same-origin as Document of the application context. -
    14. Return undefined. +
    15. Return null.
    @@ -1976,7 +1820,7 @@

    Issue a developer warning that the start URL is not within scope of the navigation scope. -
  • Return undefined. +
  • Return null.
  • @@ -1997,10 +1841,6 @@

    "operating system">OS's task switcher and/or system preferences.

    -

    - The icons member is processed using the steps for - processing an array of image resources. -

    If there are multiple equally appropriate icons in icons, a user agent MUST use the last one declared in order at the time that @@ -2075,38 +1915,18 @@

    fallback display mode.

    - The steps for processing the display member - are given by the following algorithm. The algorithm takes a manifest - manifest as an argument, and returns a string. + The steps for post-processing the display + member are given by the following algorithm. The algorithm + takes a WebAppManifest manifest as an argument, and + returns a DisplayModeType.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - passing "display" as the argument. -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is unsupported. -
      2. -
      3. Return the fallback display mode's value. -
      4. -
      +
    4. Let V be manifest["display"].
    5. -
    6. Otherwise, Trim(value), convert to lower-case, - and set value to be the result. -
    7. -
    8. If value does not match one of the display modes - values: -
        -
      1. - Issue a developer warning that the value is unsupported. -
      2. -
      3. Return the fallback display mode's value. -
      4. -
      +
    9. If Type(V) is null return the + fallback display mode's value.
    10. -
    11. Return value. +
    12. Return V.

    @@ -2150,44 +1970,6 @@

    orientation of a top-level browsing context (such as via [[!SCREEN-ORIENTATION]] API).

    -

    - The steps for processing the orientation - member are given by the following algorithm. The algorithm - takes a manifest manifest and display mode - display mode as an argument, and returns a string. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "orientation". -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value), convert to lower-case, - and set value to be the result. -
    6. -
    7. If value is not one of the OrientationLockType - enum values, or value is unsupported by the user agent, or - the value cannot be used together with display - mode: -
        -
      1. - Issue a developer warning. -
      2. -
      3. Return undefined. -
      4. -
      -
    8. -
    9. Return value. -
    10. -

    @@ -2208,31 +1990,22 @@

    created or any time thereafter.

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

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of the manifest - with argument "start_url". +
    2. Let V be manifest["start_url"].
    3. -
    4. Let type be Type(value). +
    5. Let type be Type(V).
    6. -
    7. If type is not "string" or value is the - empty string: -
        -
      1. If type is not "undefined", issue - a developer warning that the type is unsupported. -
      2. -
      3. Return a new URL whose input is - document URL. -
      4. -
      +
    8. If type is not String or V is + the empty string, return a new URL whose input is + document URL.
    9. -
    10. Let url be a new URL using value as +
    11. Let url be a new URL using V as input and manifest URL as the base URL.
    12. @@ -2314,66 +2087,42 @@

      The steps for processing the serviceworker member are given by the following algorithm. The algorithm - takes a manifest manifest. This algorithm returns a - registration object registration, which can be - undefined. + takes a WebAppManifest manifest. This algorithm + returns a registration object registration', which + can be null.

        -
      1. Let unprocessed registration be the result of calling - the [[\GetOwnProperty]] internal method of manifest - with argument "serviceworker". +
      2. Let registration be + manifest["serviceworker"]. +
      3. +
      4. If registration is null, return + null.
      5. Let src be the result of running the steps for processing the src member of a service worker with - unprocessed registration and manifest URL. -
      6. -
      7. If src is undefined, or if the result of - running is origin potentially trustworthy with the origin of - src is Not Trusted, issue a developer - warning, abort these steps and return undefined. -
      8. -
      9. Otherwise, let registration be an object with - properties src, scope, type - and use_cache. All properties initially set to - undefined. + registration and manifest URL.
      10. -
      11. Set registration's src property to be - src. +
      12. If the result of running is origin potentially trustworthy + with the origin of src is Not Trusted, + issue a developer warning, abort these steps and return + null.
      13. Let scope be the result of running the steps for processing the scope member of a service worker - passing unprocessed registration. -
      14. -
      15. If scope is undefined, issue a - developer warning, abort these steps and return - undefined. -
      16. -
      17. Otherwise, set registration's scope - property to be scope. + passing registration.
      18. Let type be the result of running the steps for processing the type member of a service worker - passing unprocessed registration. -
      19. -
      20. If type is undefined, issue a - developer warning, abort these steps and return - undefined. -
      21. -
      22. Otherwise, set registration's type - property to be type. + passing registration.
      23. -
      24. Let use cache be the result of running the steps +
      25. Let use_cache be the result of running the steps for processing the use_cache member of a service - worker passing unprocessed registration. + worker passing registration.
      26. -
      27. If use cache is undefined, issue a - developer warning, abort these steps and return - undefined. -
      28. -
      29. Otherwise, set registration's use_cache - property to be use cache. +
      30. Let registration' be a new object created as if by the + expression ({ src, scope, type, use_cache }).
      31. -
      32. Return registration. +
      33. Return registration'.
      @@ -2408,29 +2157,21 @@

      "theme-color".

      - The steps for processing the theme_color + The steps for post-processing the theme_color member are given by the following algorithm. The algorithm - takes a manifest as an argument. This algorithm returns a - string or undefined. + takes a WebAppManifest manifest as an argument. + This algorithm returns a USVString?.

        -
      1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "theme_color". +
      2. Let V be manifest["theme_color"].
      3. -
      4. If Type(value) is not "string": -
          -
        1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
        2. -
        3. Return undefined. -
        4. -
        +
      5. If Type(V) is not String return + null.
      6. Otherwise, let potential color be the result of running [[!CSS-SYNTAX-3]]'s parse a component value algorithm - with value as input. If parsing returns a syntax error, - return undefined. + with V as input. If parsing returns a syntax error, return + undefined.
      7. Let color be the result of attempting to parse potential color as a CSS color, as per [[!CSS-SYNTAX-3]]. @@ -2439,7 +2180,7 @@

      8. Issue a developer warning.
      9. -
      10. Return undefined. +
      11. Return null.
      @@ -2475,71 +2216,48 @@

      The steps for processing the related_applications member are given by the following algorithm. The algorithm - takes a manifest as an argument. This algorithm returns a list of - ExternalApplicationResources applications, which - can be empty. + takes a WebAppManifest manifest as an argument. + This algorithm returns an + Array<ExternalApplicationResource>.

        -
      1. Let applications be an empty list. +
      2. Let A be manifest["related_applications"].
      3. -
      4. Let unprocessed applications be the result of calling - the [[\GetOwnProperty]] internal method of manifest - with argument "related_applications". +
      5. Let A' be a new Array object created as if by the + expression [].
      6. -
      7. If unprocessed applications is an array, then: +
      8. For V in A:
          -
        1. For each potential application in the array: +
        2. if neither V["src"] nor V["url"] are + null:
            -
          1. Let platform be the result of running the - steps for processing the platform member of an - application with potential application. -
          2. -
          3. If platform is undefined, move - onto the next item if any are left. -
          4. -
          5. Let id be the result of running the steps - for processing the id member of an - application with potential application. +
          6. Let V' be a new object created as if by the + expression ({}).
          7. -
          8. Let url be the result of running the steps - for processing the url member of an - application with potential application. +
          9. Set V'["platform"] to be + V["platform"].
          10. -
          11. If both id and url are - undefined, move onto the next item if any are - left. +
          12. Set V'["id"] to be V["id"].
          13. -
          14. Let minVersion be the result of running the - steps for processing the min_version member - of an application with potential application. +
          15. Set V'["min_version"] to be + V["min_version"].
          16. -
          17. Let fingerprints be the result of running the - steps for processing the fingerprints member - of an application with potential application. +
          18. Set V'["url"] be the result of running the + steps for processing the url member of an + application with V.
          19. -
          20. Let application be an object with properties - platform, id, url, - min_version, and fingerprints - respectively set to platform, id, - url, minVersion, and - fingerprints. +
          21. Set V'["fingerprints"] be the result of + running the steps for processing the + fingerprints member of an application with + V.
          22. -
          23. Append application to applications. +
          24. Append V' to A'
      9. -
      10. Otherwise, if unprocessed applications is not - undefined: -
          -
        1. - Issue a developer warning that the type is not - supported. -
        2. -
        -
      11. -
      12. Return applications. +
      13. Return A'.

    @@ -2559,29 +2277,6 @@

    the user agent might want to suggest installing one of the related applications instead.

    -

    - The steps for processing the - prefer_related_applications member are given by - the following algorithm. The algorithm takes a manifest as an - argument. This algorithm returns a boolean. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "prefer_related_applications". -
    2. -
    3. If Type(value) is not "boolean": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return false. -
      4. -
      -
    4. -
    5. Return value. -
    6. -

    @@ -2603,29 +2298,21 @@

    application's stylesheet is available.

    - The steps for processing the background_color + The steps for post-processing the background_color member are given by the following algorithm. The algorithm - takes a manifest as an argument. This algorithm returns a - string or undefined. + takes a WebAppManifest manifest as an argument. + This algorithm returns a USVString?.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "background_color". +
    2. Let V be manifest["background_color"].
    3. -
    4. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      +
    5. If Type(V) is not String return + null.
    6. Otherwise, let potential color be the result of running [[!CSS-SYNTAX-3]]'s parse a component value algorithm - with value as input. If parsing returns a syntax error, - return undefined. + with V as input. If parsing returns a syntax error, return + null.
    7. Let color be the result of attempting to parse potential color as a CSS color, as per [[!CSS-SYNTAX-3]]. @@ -2634,7 +2321,7 @@

    8. Issue a developer warning.
    9. -
    10. Return undefined. +
    11. Return null.
    @@ -2658,43 +2345,32 @@

    keywords, catalogs and stores are not required to honor this hint.

    - The steps for processing the categories + The steps for post-processing the categories member are given by the following algorithm. The algorithm - takes a manifest as an argument. This algorithm returns an - array of strings or undefined. + takes a WebAppManifest manifest as an argument. + This algorithm returns an Array<USVString>.

      -
    1. Let categories be an empty list. +
    2. Let A be manifest["categories"].
    3. -
    4. Let unprocessed categories be the result of calling - the [[\GetOwnProperty]] internal method of manifest - with argument "categories". +
    5. Let n be the length of A.
    6. -
    7. If unprocessed categoriesis an array, then: -
        -
      1. For each potential category in the array: -
          -
        1. - Trim(value) and convert to ASCII - lowercase -
        2. -
        3. Append potential category to - categories -
        4. -
        -
      2. -
      +
    8. Initialize i to be 0.
    9. -
    10. Otherwise, if unprocessed categories is not - undefined +
    11. While i < n:
        +
      1. Let V be the value in A at index + i. +
      2. - Issue a developer warning that the type is not - supported. + Trim(V) and convert to ASCII lowercase + in place. +
      3. +
      4. Set i to i + 1.
    12. -
    13. Return categories +
    14. Return A.

    @@ -2707,8 +2383,8 @@

    Manifest authors are encouraged to use lower-case.

    - This specification does not define the particular - CategoryTypes for a the categories member. However, + This specification does not define the particular values for + USVStrings for a the categories member. However, the working group maintains a list of known values in our wiki. @@ -2734,29 +2410,6 @@

    is intended to be used to determine which ages the web application is appropriate for.

    -

    - The steps for processing the iarc_rating_id member - is given by the following algorithm. The algorithm takes a - manifest as an argument. This algorithm returns a string - or undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with argument "iarc_rating_id". -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    The following shows a very simple manifest with the @@ -2950,51 +2603,40 @@

    - The steps for processing a purpose member of an + The steps for processing the purpose member of an image are given by the following algorithm. The algorithm takes an ImageResource image. This algorithm will return a set.

      -
    1. Let purpose be an empty set. -
    2. -
    3. Let value be the result of calling the - [[\GetOwnProperty]] internal method of image - passing "purpose" as the argument. +
    4. Let S be an empty set.
    5. -
    6. Let type be Type(value). +
    7. Let V be image["purpose"].
    8. -
    9. If type is not "string", then: +
    10. If Type(V) is String:
        -
      1. If type is not "undefined", issue - a developer warning that the type is unsupported. -
      2. -
      3. Add "any" to purpose. +
      4. Let keywords be the result of splitting + V on spaces.
      5. -
      6. Return purpose. -
      7. -
      -
    11. -
    12. Let keywords be the result of splitting - value on spaces. -
    13. -
    14. For each keyword in keywords: -
        -
      1. Convert keyword to ASCII lowercase. -
      2. -
      3. If keyword is not one of the icon purposes, - or is already contained in keywords, issue a - developer warning and continue to the next keyword - skipping the sub-steps below. -
      4. -
      5. Otherwise, add keyword to purpose. +
      6. For each keyword in keywords: +
          +
        1. Convert keyword to ASCII lowercase. +
        2. +
        3. If keyword is not one of the icon + purposes, or is already contained in keywords, + issue a developer warning and continue to the next + keyword skipping the sub-steps below. +
        4. +
        5. Otherwise, add keyword to S. +
        6. +
    15. -
    16. if the size of purpose is 0, then add "any" to - purpose. +
    17. if the size of S is 0, then add "any" to + S.
    18. -
    19. Return purpose. +
    20. Return S.
    @@ -3041,41 +2683,31 @@

    display context (and ignore any that are inappropriate).

    - The steps for processing a sizes member of an + The steps for processing the sizes member of an image are given by the following algorithm. The algorithm takes an ImageResource image. This algorithm will return a set.

      -
    1. Let sizes be an empty set. +
    2. Let S be an empty set.
    3. -
    4. Let value be the result of calling the - [[\GetOwnProperty]] internal method of image - passing "sizes" as the argument. +
    5. Let V be image.sizes.
    6. -
    7. Let type be Type(value). +
    8. If Type(V) it not String, return + null.
    9. -
    10. If type is not "string", then: -
        -
      1. If type is not "undefined", issue - a developer warning that the type is unsupported. -
      2. -
      3. Return undefined. -
      4. -
      -
    11. -
    12. Otherwise, parse value as if it was a [[!HTML]] - sizes attribute and let keywords be the +
    13. Otherwise, parse V as if it was a [[!HTML]] + sizes attribute and let keywords be the result.
    14. For each keyword in keywords:
      1. Convert keyword to ASCII lowercase and add - the resulting string to sizes. + the resulting string to S.
    15. -
    16. Return sizes. +
    17. Return S.

    @@ -3096,23 +2728,10 @@

    URL or undefined.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of image - passing "src" as the argument. -
    2. -
    3. Let type be Type(value). -
    4. -
    5. If type is not "string", then: -
        -
      1. If type is not "undefined", issue a - developer warning that the type is unsupported. -
      2. -
      3. Return undefined. -
      4. -
      +
    6. Let V be image.src.
    7. -
    8. If Trim(value) is the empty string, then return - undefined. +
    9. If Type(V) it not String, return + null.
    10. Otherwise, parse value using manifest URL as the base URL and return the result. @@ -3140,23 +2759,10 @@

      string or undefined.

        -
      1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of potential - image passing "type" as the argument. +
      2. Let V be image["type"].
      3. -
      4. Let type be Type(value). -
      5. -
      6. If type is not "string", then: -
          -
        1. If type is not "undefined", issue a - developer warning that the type is unsupported. -
        2. -
        3. Return undefined. -
        4. -
        -
      7. -
      8. Trim(value) and set value to be resulting - string. +
      9. If Type(V) it not String, return + null.
      10. If value is not a valid MIME type or the value of type is not a supported media format, issue a developer @@ -3168,84 +2774,57 @@

    - Processing an array of image resources + Post-processing an array of image resources

    - The steps for processing an array of image resources are - given by the following algorithm. The algorithm takes a manifest, a - URL manifest URL, which is the URL from which the + The steps for post-processing ImageResource members + are given by the following algorithm. The algorithm takes a manifest, + a URL manifest URL, which is the URL from which the manifest was fetched, and a string that represents the member name of the member which contains the array of ImageResources. This algorithm returns a sequence of ImageResources, which can be empty.

      -
    1. Let images be an empty sequence. -
    2. -
    3. Let unprocessed images be the result of calling the - [[\GetOwnProperty]] internal method of manifest - with member name as the argument. -
    4. -
    5. If unprocessed images is an array, then: -
        -
      1. From unprocessed images, filter out any item where - HasOwnProperty(item, "src") returns false. -
      2. -
      3. For each potential image in the array: -
          -
        1. Let src be the result of running the steps - for processing the src member of an image - with potential image and manifest URL. -
        2. -
        3. If src is undefined, move onto - the next item in images (if any are left). -
        4. -
        5. Otherwise, let image be an object with - properties src, type, and - sizes. All properties initially set to - undefined. -
        6. -
        7. Set image's src property to be - src. -
        8. -
        9. Let type be the result of running the steps - for processing the type member of an image - passing potential image. -
        10. -
        11. If type is not undefined, set - image's type property to be - type. -
        12. -
        13. Let sizes be the list that result from running - the steps for processing a sizes member of an - image passing potential image. -
        14. -
        15. If sizes is not undefined, set - image's sizes property to be - sizes. -
        16. -
        17. Set image's purpose property to - be the result of running the steps for processing a - purpose member of an image passing - potential image. -
        18. -
        19. Append image to images. -
        20. -
        -
      4. -
      -
    6. -
    7. Otherwise, if unprocessed images is not - undefined: -
        -
      1. - Issue a developer warning that the type is not - supported. -
      2. -
      -
    8. -
    9. Return images. -
    10. +
        +
      1. Let A be manifest[member + name]. +
      2. +
      3. Remove from A all entries V where + V["src"] returns false +
      4. +
      5. Let n be the length of A. +
      6. +
      7. Initialize i to be 0. +
      8. +
      9. While i < n: +
          +
        1. Let V be the value in A at index + i. +
        2. +
        3. Let V["src"] be the result of running the + steps for processing the src member of an + image with V and manifest URL. +
        4. +
        5. Let V["type"] be the result of running the + steps for processing the type member of an + image with V and manifest URL. +
        6. +
        7. Let V["sizes"] be the result of running the + steps for processing the sizes member of an + image with V and manifest URL. +
        8. +
        9. Let V["purpose"] be the result of running the + steps for processing the purpose member of an + image with V and manifest URL. +
        10. +
        11. Set i to i + 1. +
        12. +
        +
      10. +
      11. Return A. +
      12. +

    @@ -3288,29 +2867,6 @@

    list of known platform values in our wiki.

    -

    - The steps for processing the platform member of an - application are given by the following algorithm. The algorithm - takes an ExternalApplicationResource application. - This algorithm will return a string or undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of application - passing "platform" as the argument. -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    @@ -3347,25 +2903,12 @@

    undefined.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of registration - passing "src" as the argument. -
    2. -
    3. Let type be Type(value). +
    4. Let V be registration["src"].
    5. -
    6. If type is not "string", then: -
        -
      1. If type is not "undefined", issue a - developer warning that the type is unsupported. -
      2. -
      3. Return undefined. -
      4. -
      -
    7. -
    8. If Trim(value) is the empty string, then return - undefined. +
    9. If Type(V) is not String or + V is the empty string, then return null.
    10. -
    11. Otherwise, parse value using manifest +
    12. Otherwise, parse V using manifest URL as the base URL and return the result.
    @@ -3388,26 +2931,11 @@

    undefined.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of registration - passing "scope" as the argument. +
    2. Let V be registration["scope"].
    3. -
    4. Let type be Type(value). +
    5. If V is null, return null.
    6. -
    7. If type is not "string", then: -
        -
      1. If type is not "undefined", issue a - developer warning that the type is unsupported and return - undefined. -
      2. -
      3. Return null. -
      4. -
      -
    8. -
    9. If Trim(value) is the empty string, then return - undefined. -
    10. -
    11. Otherwise, parse value using manifest +
    12. Otherwise, parse V using manifest URL as the base URL and return the result.
    @@ -3431,31 +2959,12 @@

    fetched. This algorithm will return a string.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of registration - passing "type" as the argument. -
    2. -
    3. Let type be Type(value). +
    4. Let V be registration["type"].
    5. -
    6. If type is not "string", then: -
        -
      1. If type is not "undefined", issue a - developer warning that the type is unsupported and return - undefined. -
      2. -
      3. Return "classic". -
      4. -
      -
    7. -
    8. If Trim(value) is the empty string, then: -
        -
      1. Issue a developer warning that the type is unsupported. -
      2. -
      3. Return undefined. -
      4. -
      +
    9. If V is null, return + "classic".
    10. -
    11. Otherwise, Trim(value) and return the result. +
    12. Otherwise, return V.

    @@ -3479,23 +2988,11 @@

    fetched. This algorithm will return a boolean.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of registration - passing "use_cache" as the argument. +
    2. Let V be registration["use_cache"].
    3. -
    4. Let type be Type(value). -
    5. -
    6. If type is not "boolean", then: -
        -
      1. If type is not "undefined", issue a - developer warning that the type is unsupported and return - undefined. -
      2. -
      3. Otherwise, return false -
      4. -
      +
    7. If V is null, return false.
    8. -
    9. Otherwise, return value. +
    10. Otherwise, return V.
    @@ -3610,24 +3107,12 @@

    This algorithm will return an URL or undefined.

      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of application - passing "url" as the argument. +
    2. Let V be application["url"].
    3. -
    4. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      +
    5. If V is null, return null.
    6. -
    7. Trim(value) and set value to be resulting - string. -
    8. -
    9. Otherwise, parse value and if the result is not - failure, return the result, otherwise return undefined. +
    10. Otherwise, parse V and if the result is not + failure, return the result, otherwise return null.
    @@ -3640,29 +3125,6 @@

    dictionary represents the id which is used to represent the application on the platform.

    -

    - The steps for processing the id member of an - application are given by the following algorithm. The algorithm - takes an ExternalApplicationResource application. - This algorithm will return a string or undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of application - passing "id" as the argument. -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    @@ -3675,30 +3137,6 @@

    app. This version is a string with platform-specific syntax and semantics.

    -

    - The steps for processing the min_version member of - an application are given by the following algorithm. The - algorithm takes an ExternalApplicationResource - application. This algorithm will return a string or - undefined. -

    -
      -
    1. Let value be the result of calling the - [[\GetOwnProperty]] internal method of application - passing "min_version" as the argument. -
    2. -
    3. If Type(value) is not "string": -
        -
      1. If Type(value) is not "undefined", issue - a developer warning that the type is not supported. -
      2. -
      3. Return undefined. -
      4. -
      -
    4. -
    5. Otherwise, Trim(value) and return the result. -
    6. -

    @@ -3720,52 +3158,36 @@

    The steps for processing the fingerprints member of an application are given by the following algorithm. The algorithm takes an ExternalApplicationResource - application. This algorithm will return a list of + application. This algorithm will return an array of fingerprint objects, possibly empty.

      -
    1. Let fingerprints be an empty list. +
    2. Let A be an empty array.
    3. -
    4. Let unprocessed fingerprints be the result of calling - the [[\GetOwnProperty]] internal method of - application passing "fingerprints" as the - argument. -
    5. -
    6. If unprocessed fingerprints is an array, then for each - potential fingerprint in unprocessed - fingerprints: +
    7. For each V in application["fingerprints"]:
        -
      1. Let type be the result of calling the - [[\GetOwnProperty]] internal method of potential - fingerprint passing "type" as an argument. +
      2. Let type be V["type"].
      3. -
      4. If Type(type) is not "string", then issue a +
      5. If Type(type) is not String, then issue a developer warning that the type is unsupported, and move on - to the next item in unprocessed fingerprints (if any - are left). + to the next item (if any are left).
      6. -
      7. Let value be the result of calling the - [[\GetOwnProperty]] internal method of potential - fingerprint passing "value" as an argument. +
      8. Let value be V["value"].
      9. -
      10. If Type(value) is not "string", then issue a - developer warning that the type is unsupported, and move on - to the next item in unprocessed fingerprints (if any - are left). +
      11. If Type(value) is not String, then + issue a developer warning that the type is unsupported, + and move on to the next item (if any are left).
      12. Let fingerprint be a fingerprint object, with its type member set to type and its value member set to value.
      13. -
      14. Append fingerprint to fingerprints. +
      15. Append fingerprint to A.
    8. -
    9. Otherwise, issue a developer warning that the type is - unsupported. -
    10. -
    11. Return fingerprints. +
    12. Return A.

    @@ -3822,6 +3244,11 @@

    "https://dev.w3.org/csswg/css-syntax/#parse-component-value">parse a component value is defined in [[!CSS-SYNTAX-3]].

    +

    + The algorithm to convert a ECMAScript object to IDL dictionary + value is defined in [[!WEBIDL]]. +

    The manifest-src, From 278816fcfcc3fd2805a546c4928552809a0ef928 Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Tue, 3 Oct 2017 13:01:08 +0200 Subject: [PATCH 5/9] Fix review comments from Matt --- index.html | 476 +++++++++++++++++++++++++---------------------------- 1 file changed, 220 insertions(+), 256 deletions(-) diff --git a/index.html b/index.html index 7728dcc70..95cd2be52 100644 --- a/index.html +++ b/index.html @@ -370,9 +370,9 @@

    an installation process's UI.
  • If obtaining the manifest succeeds, and the result of - running the steps for processing the serviceworker member - with manifest returns a valid registration, a - user agent can at this point + running the steps for post-processing the serviceworker + member with manifest returns a valid + registration, a user agent can at this point
    1. Let client be the top-level browsing context Document's of switching to another display mode.

      - When the display member is missing, or if there is no - valid display member, the user agent uses the - browser display mode as the default display - mode. As such, the user agent is REQUIRED to support the - browser display mode. + When the display member is + missing, or if there is no valid display member, the user agent uses the + browser display mode as the default display mode. + As such, the user agent is REQUIRED to support the browser + display mode.

      Each display mode, except browser, has a @@ -1453,18 +1454,15 @@

      Extension point: process any proprietary and/or other supported members at this point in the algorithm.

    2. -
    3. Let WebAppManifest manifest be the result of - converting json to IDL dictionary value. +
    4. Let manifest be the result of converting json to a + WebAppManifest.
    5. Let manifest["start_url"] be the result of running the steps for post-processing the start_url member with manifest, manifest URL, and document URL as arguments.
    6. -
    7. Let manifest["display"] be the result of - running the steps for post-processing the display - member with manifest as the argument. -
    8. Let manifest["lang"] be the result of running the steps for post-processing the lang member with manifest as the argument. @@ -1472,7 +1470,7 @@

    9. Let manifest["scope"] be the result of running the steps for post-processing the scope member with manifest, manifest URL, document - URL, start URL as arguments. + URL, manifest["start_url"] as arguments.
    10. Let manifest["theme_color"] be the result of running the steps for post-processing the theme_color @@ -1497,14 +1495,14 @@

      as arguments.

    11. Let manifest["related_applications"] be the - result of running the steps for processing the + result of running the steps for post-processing the related_applications member with manifest as argument.
    12. Let manifest["serviceworker"] be the result of - running the steps for processing the serviceworker - member with manifest, manifest URL, and - serviceworker as arguments. + running the steps for post-processing the + serviceworker member with manifest, + manifest URL, and serviceworker as arguments.
    13. Return manifest.
    14. @@ -1560,24 +1558,24 @@

                 dictionary WebAppManifest {
      -             TextDirectionType? dir;
      -             DOMString? lang;
      -             USVString? name;
      -             USVString? short_name;
      -             USVString? description;
      -             sequence<ImageResource>? icons;
      -             sequence<ImageResource>? screenshots;
      -             sequence<USVString>? categories;
      -             DOMString? iarc_rating_id;
      -             USVString? start_url;
      -             DisplayModeType? display;
      -             OrientationLockType? orientation;
      -             USVString? theme_color;
      -             USVString? background_color;
      -             USVString? scope;
      -             ServiceWorkerRegistration? serviceworker;
      -             sequence<ExternalApplicationResource>? related_applications;
      -             boolean? prefer_related_applications;
      +             TextDirectionType dir;
      +             DOMString lang;
      +             USVString name;
      +             USVString short_name;
      +             USVString description;
      +             sequence<ImageResource> icons;
      +             sequence<ImageResource> screenshots;
      +             sequence<USVString> categories;
      +             DOMString iarc_rating_id;
      +             USVString start_url;
      +             DisplayModeType display = "browser";
      +             OrientationLockType orientation;
      +             USVString theme_color;
      +             USVString background_color;
      +             USVString scope;
      +             ServiceWorkerRegistration serviceworker;
      +             sequence<ExternalApplicationResource> related_applications;
      +             boolean prefer_related_applications;
                 };
             

      @@ -1704,18 +1702,19 @@

      algorithm returns a DOMString?.

        -
      1. Let V be manifest.lang. +
      2. Let value be manifest.lang.
      3. -
      4. If Type(V) is String: +
      5. If Type(value) is String:
        1. If calling IsStructurallyValidLanguageTag with - V as the argument returns false, then: + value as the argument returns false, + then:
          1. - Issue a developer warning that the V is - invalid. + Issue a developer warning that the value + is invalid.
          2. -
          3. Return null. +
          4. Return undefined.
        2. @@ -1725,7 +1724,7 @@

      6. -
      7. Return null +
      8. Return undefined
      @@ -1776,26 +1775,26 @@

      a WebAppManifest manifest, a URL manifest URL, a URL document URL, and a URL start URL . This algorithm returns a URL or - null. + undefined.

        -
      1. Let V be manifest.scope. +
      2. Let value be manifest.scope.
      3. -
      4. Let type be Type(V). +
      5. Let type be Type(value).
      6. -
      7. If type is not String or V is - the empty string, then return null. +
      8. If type is not String or value + is the empty string, then return undefined.
      9. -
      10. Let scope URL be a new URL using V - as input and manifest URL as the - base URL. +
      11. Let scope URL be a new URL using + value as input and manifest URL as + the base URL.
      12. If scope URL is failure:
      13. @@ -1810,7 +1809,7 @@

        same-origin as Document of the application context. -
      14. Return null. +
      15. Return undefined.

    15. @@ -1820,7 +1819,7 @@

      Issue a developer warning that the start URL is not within scope of the navigation scope. -
    16. Return null. +
    17. Return undefined.
  • @@ -1911,24 +1910,7 @@

    The display member is a DisplayModeType, whose value is one of display modes values. The item represents the developer's preferred display mode for the web application. - When the member is missing or erroneous, the user agent MUST use the - fallback display mode. -

    -

    - The steps for post-processing the display - member are given by the following algorithm. The algorithm - takes a WebAppManifest manifest as an argument, and - returns a DisplayModeType.

    -
      -
    1. Let V be manifest["display"]. -
    2. -
    3. If Type(V) is null return the - fallback display mode's value. -
    4. -
    5. Return V. -
    6. -

    @@ -1997,15 +1979,15 @@

    This algorithm returns a URL.

      -
    1. Let V be manifest["start_url"]. +
    2. Let value be manifest["start_url"].
    3. -
    4. Let type be Type(V). +
    5. Let type be Type(value).
    6. -
    7. If type is not String or V is - the empty string, return a new URL whose input is - document URL. +
    8. If type is not String or value + is the empty string, return a new URL whose input + is document URL.
    9. -
    10. Let url be a new URL using V as +
    11. Let url be a new URL using value as input and manifest URL as the base URL.
    12. @@ -2085,44 +2067,43 @@

      they coalesce. If they have different script URLs, last one wins.

      - The steps for processing the serviceworker + The steps for post-processing the serviceworker member are given by the following algorithm. The algorithm takes a WebAppManifest manifest. This algorithm - returns a registration object registration', which - can be null. + returns a registration object registration, which + can be undefined.

      1. Let registration be manifest["serviceworker"].
      2. -
      3. If registration is null, return - null. +
      4. If registration is undefined, return + undefined.
      5. Let src be the result of running the steps for - processing the src member of a service worker with - registration and manifest URL. + post-processing the src member of a service worker + with registration and manifest URL.
      6. If the result of running is origin potentially trustworthy with the origin of src is Not Trusted, issue a developer warning, abort these steps and return - null. + undefined.
      7. Let scope be the result of running the steps for - processing the scope member of a service worker + post-processing the scope member of a service worker passing registration.
      8. Let type be the result of running the steps for - processing the type member of a service worker + post-processing the type member of a service worker passing registration.
      9. Let use_cache be the result of running the steps - for processing the use_cache member of a service + for post-processing the use_cache member of a service worker passing registration.
      10. -
      11. Let registration' be a new object created as if by the - expression ({ src, scope, type, use_cache }). -
      12. -
      13. Return registration'. +
      14. Return a new object created as if by the expression ({ + src, scope, type, + use_cache }).
      @@ -2163,15 +2144,15 @@

      This algorithm returns a USVString?.

        -
      1. Let V be manifest["theme_color"]. +
      2. Let value be manifest["theme_color"].
      3. -
      4. If Type(V) is not String return - null. +
      5. If Type(value) is not String + return undefined.
      6. Otherwise, let potential color be the result of running [[!CSS-SYNTAX-3]]'s parse a component value algorithm - with V as input. If parsing returns a syntax error, return - undefined. + with value as input. If parsing returns a syntax error, + return undefined.
      7. Let color be the result of attempting to parse potential color as a CSS color, as per [[!CSS-SYNTAX-3]]. @@ -2180,7 +2161,7 @@

      8. Issue a developer warning.
      9. -
      10. Return null. +
      11. Return undefined.
      @@ -2214,50 +2195,38 @@

      application.

      - The steps for processing the related_applications - member are given by the following algorithm. The algorithm - takes a WebAppManifest manifest as an argument. - This algorithm returns an + The steps for post-processing the + related_applications member are given by the + following algorithm. The algorithm takes a WebAppManifest + manifest as an argument. This algorithm returns an Array<ExternalApplicationResource>.

        -
      1. Let A be manifest["related_applications"]. -
      2. -
      3. Let A' be a new Array object created as if by the - expression []. +
      4. Let relatedApplications be a new Array object created + as if by the expression [].
      5. -
      6. For V in A: +
      7. For each app in + manifest["related_applications"]:
          -
        1. if neither V["src"] nor V["url"] are - null: +
        2. if neither app["src"] nor app["url"] + are undefined:
            -
          1. Let V' be a new object created as if by the - expression ({}). +
          2. Set app["url"] be the result of running the + steps for post-processing the url member of + an application with app.
          3. -
          4. Set V'["platform"] to be - V["platform"]. -
          5. -
          6. Set V'["id"] to be V["id"]. -
          7. -
          8. Set V'["min_version"] to be - V["min_version"]. -
          9. -
          10. Set V'["url"] be the result of running the - steps for processing the url member of an - application with V. -
          11. -
          12. Set V'["fingerprints"] be the result of - running the steps for processing the +
          13. Set app["fingerprints"] be the result of + running the steps for post-processing the fingerprints member of an application with - V. + app.
          14. -
          15. Append V' to A' +
          16. Append app to relatedApplications
      8. -
      9. Return A'. +
      10. Return relatedApplications.

    @@ -2304,15 +2273,15 @@

    This algorithm returns a USVString?.

      -
    1. Let V be manifest["background_color"]. +
    2. Let value be manifest["background_color"].
    3. -
    4. If Type(V) is not String return - null. +
    5. If Type(value) is not String + return undefined.
    6. Otherwise, let potential color be the result of running [[!CSS-SYNTAX-3]]'s parse a component value algorithm - with V as input. If parsing returns a syntax error, return - null. + with value as input. If parsing returns a syntax error, + return undefined.
    7. Let color be the result of attempting to parse potential color as a CSS color, as per [[!CSS-SYNTAX-3]]. @@ -2321,7 +2290,7 @@

    8. Issue a developer warning.
    9. -
    10. Return null. +
    11. Return undefined.
    @@ -2351,26 +2320,15 @@

    This algorithm returns an Array<USVString>.

      -
    1. Let A be manifest["categories"]. -
    2. -
    3. Let n be the length of A. -
    4. -
    5. Initialize i to be 0. -
    6. -
    7. While i < n: +
    8. For each category in + manifest["categories"]:
        -
      1. Let V be the value in A at index - i. -
      2. -
      3. - Trim(V) and convert to ASCII lowercase - in place. -
      4. -
      5. Set i to i + 1. +
      6. Convert category to ASCII lowercase in + place.
    9. -
    10. Return A. +
    11. Return categories.

    @@ -2384,8 +2342,8 @@

    This specification does not define the particular values for - USVStrings for a the categories member. However, - the working group maintains a USVStrings for the categories member. However, the + working group maintains a list of known values in our wiki.

    @@ -2603,20 +2561,20 @@

    - The steps for processing the purpose member of an - image are given by the following algorithm. The algorithm takes - an ImageResource image. This algorithm will return - a set. + The steps for post-processing the purpose member of + an image are given by the following algorithm. The algorithm + takes an ImageResource image. This algorithm will + return a set.

      -
    1. Let S be an empty set. +
    2. Let set be an empty set.
    3. -
    4. Let V be image["purpose"]. +
    5. Let value be image["purpose"].
    6. -
    7. If Type(V) is String: +
    8. If Type(value) is String:
      1. Let keywords be the result of splitting - V on spaces. + value on spaces.
      2. For each keyword in keywords:
          @@ -2627,16 +2585,16 @@

          issue a developer warning and continue to the next keyword skipping the sub-steps below. -
        1. Otherwise, add keyword to S. +
        2. Otherwise, add keyword to set.
    9. -
    10. if the size of S is 0, then add "any" to - S. +
    11. if the size of set is 0, then add "any" + to set.
    12. -
    13. Return S. +
    14. Return set.
    @@ -2683,31 +2641,31 @@

    display context (and ignore any that are inappropriate).

    - The steps for processing the sizes member of an - image are given by the following algorithm. The algorithm takes - an ImageResource image. This algorithm will return - a set. + The steps for post-processing the sizes member of + an image are given by the following algorithm. The algorithm + takes an ImageResource image. This algorithm will + return a set.

      -
    1. Let S be an empty set. +
    2. Let set be an empty set.
    3. -
    4. Let V be image.sizes. +
    5. Let value be image.sizes.
    6. -
    7. If Type(V) it not String, return - null. +
    8. If Type(value) it not String, + return undefined.
    9. -
    10. Otherwise, parse V as if it was a [[!HTML]] - sizes attribute and let keywords be the +
    11. Otherwise, parse value as if it was a [[!HTML]] + sizes attribute and let keywords be the result.
    12. For each keyword in keywords:
      1. Convert keyword to ASCII lowercase and add - the resulting string to S. + the resulting string to set.
    13. -
    14. Return S. +
    15. Return set.
    @@ -2720,7 +2678,7 @@

    from which a user agent can fetch the image's data.

    - The steps for processing the src member of an + The steps for post-processing the src member of an image are given by the following algorithm. The algorithm takes a ImageResource icon, and a URL manifest URL , which is the URL from which the @@ -2728,10 +2686,10 @@

    URL or undefined.

      -
    1. Let V be image.src. +
    2. Let value be image.src.
    3. -
    4. If Type(V) it not String, return - null. +
    5. If Type(value) it not String, + return undefined.
    6. Otherwise, parse value using manifest URL as the base URL and return the result. @@ -2753,16 +2711,16 @@

      must expect the resource to be an image.

      - The steps for processing the type member of an + The steps for post-processing the type member of an image are given by the following algorithm. The algorithm takes an image object as an argument, and returns either a string or undefined.

        -
      1. Let V be image["type"]. +
      2. Let value be image["type"].
      3. -
      4. If Type(V) it not String, return - null. +
      5. If Type(value) it not String, + return undefined.
      6. If value is not a valid MIME type or the value of type is not a supported media format, issue a developer @@ -2782,47 +2740,49 @@

        a URL manifest URL, which is the URL from which the manifest was fetched, and a string that represents the member name of the member which contains the array of - ImageResources. This algorithm returns a sequence of - ImageResources, which can be empty. + ImageResources. This algorithm returns an + Array<ImageResource>

            -
          1. Let A be manifest[member - name]. -
          2. -
          3. Remove from A all entries V where - V["src"] returns false -
          4. -
          5. Let n be the length of A. -
          6. -
          7. Initialize i to be 0. +
          8. Let imageResources be a new Array object created as + if by the expression [].
          9. -
          10. While i < n: +
          11. For each entry in manifest[member + name]:
              -
            1. Let V be the value in A at index - i. -
            2. -
            3. Let V["src"] be the result of running the - steps for processing the src member of an - image with V and manifest URL. -
            4. -
            5. Let V["type"] be the result of running the - steps for processing the type member of an - image with V and manifest URL. -
            6. -
            7. Let V["sizes"] be the result of running the - steps for processing the sizes member of an - image with V and manifest URL. -
            8. -
            9. Let V["purpose"] be the result of running the - steps for processing the purpose member of an - image with V and manifest URL. -
            10. -
            11. Set i to i + 1. +
            12. if entry["src"] is not undefined: +
                +
              1. Let image be a new object created as if by + the expression ({}). +
              2. +
              3. Let image["src"] be the result of running + the steps for post-processing the src + member of an image with entry and + manifest URL. +
              4. +
              5. Let image["type"] be the result of running + the steps for post-processing the type + member of an image with entry and + manifest URL. +
              6. +
              7. Let image["sizes"] be the result of running + the steps for post-processing the sizes + member of an image with entry and + manifest URL. +
              8. +
              9. Let image["purpose"] be the result of + running the steps for post-processing the + purpose member of an image with + entry and manifest URL. +
              10. +
              11. Append image to imageResources +
              12. +
          12. -
          13. Return A. +
          14. Return imageResources.
        @@ -2894,7 +2854,7 @@

        dictionary is a URL representing a service worker.

        - The steps for processing the src member of a + The steps for post-processing the src member of a service worker are given by the following algorithm. The algorithm takes a ServiceWorkerRegistration registration, and a URL manifest URL, @@ -2903,12 +2863,12 @@

        undefined.

          -
        1. Let V be registration["src"]. +
        2. Let value be registration["src"].
        3. -
        4. If Type(V) is not String or - V is the empty string, then return null. +
        5. If Type(value) is not String or + V is the empty string, then return undefined.
        6. -
        7. Otherwise, parse V using manifest +
        8. Otherwise, parse value using manifest URL as the base URL and return the result.
        @@ -2922,7 +2882,7 @@

        dictionary is the service worker's associated scope URL.

        - The steps for processing the scope member of a + The steps for post-processing the scope member of a service worker are given by the following algorithm. The algorithm takes a ServiceWorkerRegistration registration, and a URL manifest URL, @@ -2931,11 +2891,12 @@

        undefined.

          -
        1. Let V be registration["scope"]. +
        2. Let value be registration["scope"].
        3. -
        4. If V is null, return null. +
        5. If value is undefined, return + undefined.
        6. -
        7. Otherwise, parse V using manifest +
        8. Otherwise, parse value using manifest URL as the base URL and return the result.
        @@ -2951,7 +2912,7 @@

        type.

        - The steps for processing the type member of a + The steps for post-processing the type member of a service worker are given by the following algorithm. The algorithm takes a ServiceWorkerRegistration registration, and a URL manifest URL, @@ -2959,12 +2920,12 @@

        fetched. This algorithm will return a string.

          -
        1. Let V be registration["type"]. +
        2. Let value be registration["type"].
        3. -
        4. If V is null, return +
        5. If value is undefined, return "classic".
        6. -
        7. Otherwise, return V. +
        8. Otherwise, return value.
        @@ -2980,19 +2941,20 @@

        be used when fetching the service worker.

        - The steps for processing the use_cache member of a - service worker are given by the following algorithm. The + The steps for post-processing the use_cache member + of a service worker are given by the following algorithm. The algorithm takes a serviceworkerregistration registration, and a URL manifest URL, which is the URL from which the manifest was fetched. This algorithm will return a boolean.

          -
        1. Let V be registration["use_cache"]. +
        2. Let value be registration["use_cache"].
        3. -
        4. If V is null, return false. +
        5. If value is undefined, return + false.
        6. -
        7. Otherwise, return V. +
        8. Otherwise, return value.
        @@ -3101,18 +3063,19 @@

        found.

        - The steps for processing the url member of an + The steps for post-processing the url member of an application are given by the following algorithm. The algorithm takes an ExternalApplicationResource application. This algorithm will return an URL or undefined.

          -
        1. Let V be application["url"]. +
        2. Let value be application["url"].
        3. -
        4. If V is null, return null. +
        5. If value is undefined, return + undefined.
        6. -
        7. Otherwise, parse V and if the result is not - failure, return the result, otherwise return null. +
        8. Otherwise, parse value and if the result is not + failure, return the result, otherwise return undefined.
        @@ -3155,25 +3118,26 @@

        and semantics are platform-defined.

        - The steps for processing the fingerprints member of - an application are given by the following algorithm. The - algorithm takes an ExternalApplicationResource + The steps for post-processing the fingerprints + member of an application are given by the following algorithm. + The algorithm takes an ExternalApplicationResource application. This algorithm will return an array of fingerprint objects, possibly empty.

          -
        1. Let A be an empty array. +
        2. Let fingerprints be an empty array.
        3. -
        4. For each V in application["fingerprints"]: +
        5. For each entry in + application["fingerprints"]:
            -
          1. Let type be V["type"]. +
          2. Let type be entry["type"].
          3. If Type(type) is not String, then issue a developer warning that the type is unsupported, and move on to the next item (if any are left).
          4. -
          5. Let value be V["value"]. +
          6. Let value be entry["value"].
          7. If Type(value) is not String, then issue a developer warning that the type is unsupported, @@ -3183,11 +3147,11 @@

            with its type member set to type and its value member set to value.

          8. -
          9. Append fingerprint to A. +
          10. Append fingerprint to fingerprints.
        6. -
        7. Return A. +
        8. Return fingerprints.
        @@ -3218,9 +3182,9 @@

        As the manifest uses the JSON format, this specification relies on the types defined in [[!ECMA-404]] specification: namely object, array, number, string, - true, false, and null. Strict - type checking is not enforced by this specification. Instead, each - member's definition specifies the steps required to process a + true, false, and undefined. + Strict type checking is not enforced by this specification. Instead, + each member's definition specifies the steps required to process a particular member and what to do when a type does not match what is expected.

        @@ -3786,9 +3750,9 @@

        doing so, please follow the conventions used in this specification. In particular, use the extension point to hook into the steps for processing a manifest. Also, be sure to specify the - steps for processing your particular member in the manner set forth - in this specification. This will help keep this part of the platform - consistent. + steps for post-processing your particular member in the manner set + forth in this specification. This will help keep this part of the + platform consistent.

        To allow the community can easily find extensions, please add your From e4bfa1cf9b14c95e7cb3843dba110e9935a5b835 Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Tue, 10 Oct 2017 11:51:26 +0200 Subject: [PATCH 6/9] Fix new comments from Matt --- index.html | 59 ++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/index.html b/index.html index 95cd2be52..461ae8f91 100644 --- a/index.html +++ b/index.html @@ -1558,7 +1558,7 @@

                   dictionary WebAppManifest {
        -             TextDirectionType dir;
        +             TextDirectionType dir = "auto";
                      DOMString lang;
                      USVString name;
                      USVString short_name;
        @@ -1575,7 +1575,7 @@ 

        USVString scope; ServiceWorkerRegistration serviceworker; sequence<ExternalApplicationResource> related_applications; - boolean prefer_related_applications; + boolean prefer_related_applications = "false"; };

        @@ -2080,30 +2080,24 @@

      7. If registration is undefined, return undefined.
      8. -
      9. Let src be the result of running the steps for - post-processing the src member of a service worker - with registration and manifest URL. +
      10. Let registration["src"] be the result of running the + steps for post-processing the src member of a service + worker with registration and manifest URL.
      11. If the result of running is origin potentially trustworthy - with the origin of src is Not Trusted, - issue a developer warning, abort these steps and return - undefined. + with the origin of registration["src"] is Not + Trusted, issue a developer warning, abort these steps + and return undefined.
      12. -
      13. Let scope be the result of running the steps for - post-processing the scope member of a service worker - passing registration. +
      14. Let registration["scope"] be the result of running the + steps for post-processing the scope member of a + service worker passing registration.
      15. -
      16. Let type be the result of running the steps for - post-processing the type member of a service worker - passing registration. +
      17. Let registration["type"] be the result of running the + steps for post-processing the type member of a + service worker passing registration.
      18. -
      19. Let use_cache be the result of running the steps - for post-processing the use_cache member of a service - worker passing registration. -
      20. -
      21. Return a new object created as if by the expression ({ - src, scope, type, - use_cache }). +
      22. Return registration.
      @@ -2238,9 +2232,7 @@

      The prefer_related_applications member is a boolean value that is used as a hint for the user agent to say that related - applications should be preferred over the web application. The - user agent MUST consider the missing value as equivalent to have it - set to false. If the + applications should be preferred over the web application. If the prefer_related_applications is set to true, and the user agent wants to suggest to install the web application, the user agent might want to suggest installing one of the related @@ -2842,7 +2834,7 @@

      required USVString src; USVString scope; USVString type; - boolean use_cache; + boolean use_cache = "false"; };
      @@ -2940,23 +2932,6 @@

      "https://w3c.github.io/ServiceWorker/#dfn-use-cache">cache should be used when fetching the service worker.

      -

      - The steps for post-processing the use_cache member - of a service worker are given by the following algorithm. The - algorithm takes a serviceworkerregistration - registration, and a URL manifest URL, - which is the URL from which the manifest was - fetched. This algorithm will return a boolean. -

      -
        -
      1. Let value be registration["use_cache"]. -
      2. -
      3. If value is undefined, return - false. -
      4. -
      5. Otherwise, return value. -
      6. -

      Date: Tue, 10 Oct 2017 13:34:32 +0200 Subject: [PATCH 7/9] Fix fingerprints error --- index.html | 151 ++++++++++++++++------------------------------------- 1 file changed, 45 insertions(+), 106 deletions(-) diff --git a/index.html b/index.html index 461ae8f91..d70baaf29 100644 --- a/index.html +++ b/index.html @@ -2082,7 +2082,8 @@

    7. Let registration["src"] be the result of running the steps for post-processing the src member of a service - worker with registration and manifest URL. + worker with registration["src"] and manifest + URL.
    8. If the result of running is origin potentially trustworthy with the origin of registration["src"] is Not @@ -2091,11 +2092,7 @@

    9. Let registration["scope"] be the result of running the steps for post-processing the scope member of a - service worker passing registration. -
    10. -
    11. Let registration["type"] be the result of running the - steps for post-processing the type member of a - service worker passing registration. + service worker passing registration["scope"].
    12. Return registration.
    13. @@ -2207,12 +2204,7 @@

      1. Set app["url"] be the result of running the steps for post-processing the url member of - an application with app. -
      2. -
      3. Set app["fingerprints"] be the result of - running the steps for post-processing the - fingerprints member of an application with - app. + an application with app["url"].
      4. Append app to relatedApplications
      5. @@ -2833,7 +2825,7 @@

        dictionary ServiceWorkerRegistration { required USVString src; USVString scope; - USVString type; + USVString type = "classic"; boolean use_cache = "false"; }; @@ -2848,19 +2840,17 @@

        The steps for post-processing the src member of a service worker are given by the following algorithm. The - algorithm takes a ServiceWorkerRegistration - registration, and a URL manifest URL, - which is the URL from which the manifest was - fetched. This algorithm will return a URL or - undefined. + algorithm takes a USVString source URL, and a + URL manifest URL, which is the URL from + which the manifest was fetched. This algorithm will return + a URL or undefined.

          -
        1. Let value be registration["src"]. -
        2. -
        3. If Type(value) is not String or - V is the empty string, then return undefined. +
        4. If Type(source URL) is not String + or source URL is the empty string, then return + undefined.
        5. -
        6. Otherwise, parse value using manifest +
        7. Otherwise, parse source URL using manifest URL as the base URL and return the result.
        @@ -2876,19 +2866,16 @@

        The steps for post-processing the scope member of a service worker are given by the following algorithm. The - algorithm takes a ServiceWorkerRegistration - registration, and a URL manifest URL, - which is the URL from which the manifest was - fetched. This algorithm will return a URL or - undefined. + algorithm takes a USVString scope URL, and a + URL manifest URL, which is the URL from + which the manifest was fetched. This algorithm will return + a URL or undefined.

          -
        1. Let value be registration["scope"]. -
        2. -
        3. If value is undefined, return - undefined. +
        4. If scope URL is undefined, return + undefined
        5. -
        6. Otherwise, parse value using manifest +
        7. Otherwise, parse scope URL using manifest URL as the base URL and return the result.
        @@ -2903,23 +2890,6 @@

        "https://html.spec.whatwg.org/multipage/workers.html#workertype">worker type.

        -

        - The steps for post-processing the type member of a - service worker are given by the following algorithm. The - algorithm takes a ServiceWorkerRegistration - registration, and a URL manifest URL, - which is the URL from which the manifest was - fetched. This algorithm will return a string. -

        -
          -
        1. Let value be registration["type"]. -
        2. -
        3. If value is undefined, return - "classic". -
        4. -
        5. Otherwise, return value. -
        6. -
        @@ -2945,7 +2915,7 @@

        USVString url; DOMString id; USVString min_version; - USVString fingerprints; + sequence<Fingerprint> fingerprints; };

        @@ -2984,8 +2954,8 @@

        fingerprints
        - an array of fingerprint objects - used for verifying the application + an array of Fingerprint objects used for verifying the + application

        @@ -3040,17 +3010,16 @@

        The steps for post-processing the url member of an application are given by the following algorithm. The algorithm - takes an ExternalApplicationResource application. - This algorithm will return an URL or undefined. + takes a USVString application URL. This algorithm + will return an URL or undefined.

          -
        1. Let value be application["url"]. -
        2. -
        3. If value is undefined, return +
        4. If application URL is undefined, return undefined.
        5. -
        6. Otherwise, parse value and if the result is not - failure, return the result, otherwise return undefined. +
        7. Otherwise, parse application URL and if the + result is not failure, return the result, otherwise return + undefined.

        @@ -3076,59 +3045,29 @@

        semantics.

        -
        +

        fingerprints member

        +
        +            dictionary Fingerprint {
        +              USVString type;
        +              USVString value;
        +            };
        +        

        - The fingerprints member of an - ExternalApplicationResource dictionary represents a set of - cryptographic fingerprints used for verifying the application. It is - given as an array of fingerprint - objects. -

        -

        - A fingerprint object has two properties: type - and value. Each of these are strings, but their syntax - and semantics are platform-defined. + The fingerprints member of an + ExternalApplicationResource dictionary represents an array of + Fingerprints.

        - The steps for post-processing the fingerprints - member of an application are given by the following algorithm. - The algorithm takes an ExternalApplicationResource - application. This algorithm will return an array of - fingerprint objects, possibly - empty. + Each Fingerprints represents a set of cryptographic + fingerprints used for verifying the application. A fingerprint has + the following two properties: type and value. + Each of these are strings, but their syntax and semantics are + platform-defined.

        -
          -
        1. Let fingerprints be an empty array. -
        2. -
        3. For each entry in - application["fingerprints"]: -
            -
          1. Let type be entry["type"]. -
          2. -
          3. If Type(type) is not String, then issue a - developer warning that the type is unsupported, and move on - to the next item (if any are left). -
          4. -
          5. Let value be entry["value"]. -
          6. -
          7. If Type(value) is not String, then - issue a developer warning that the type is unsupported, - and move on to the next item (if any are left). -
          8. -
          9. Let fingerprint be a fingerprint object, - with its type member set to type and its - value member set to value. -
          10. -
          11. Append fingerprint to fingerprints. -
          12. -
          -
        4. -
        5. Return fingerprints. -
        6. -
        From f9f5fba1f82977cc62e0c26a58ae4c8b57337cfc Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Tue, 10 Oct 2017 14:35:18 +0200 Subject: [PATCH 8/9] Give values directly to algorithms --- index.html | 261 ++++++++++++++++++++++++----------------------------- 1 file changed, 120 insertions(+), 141 deletions(-) diff --git a/index.html b/index.html index d70baaf29..2e8f263fe 100644 --- a/index.html +++ b/index.html @@ -370,9 +370,9 @@

        an installation process's UI.
      6. If obtaining the manifest succeeds, and the result of - running the steps for post-processing the serviceworker - member with manifest returns a valid - registration, a user agent can at this point + running post-processing the serviceworker member with + manifest returns a valid registration, a user + agent can at this point
        1. Let client be the top-level browsing context Document's the user agent uses the first link element in tree order and ignores all subsequent link element with a manifest link type (even if the first - element was erroneous). See the steps for obtaining a + element was erroneous). See the steps for obtaining a manifest.

          - To obtain a manifest, the user agent MUST run the steps for obtaining a manifest. The + To obtain a manifest, the user agent MUST run the steps for + obtaining a manifest. The appropriate time to obtain the manifest is left up to implementations. A user agent MAY opt to delay fetching a manifest until after the document and its other resources have been fully @@ -1318,10 +1318,10 @@

          response's body.

        2. -
        3. Let manifest be the result of running the steps for - processing a manifest with text, manifest - URL, and the URL that represents the address of the - top-level browsing context. +
        4. 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.
        5. Return manifest and manifest URL.
        6. @@ -1409,7 +1409,7 @@

    - The steps for processing a manifest are given by the + The steps for processing a manifest are given by the following algorithm. The algorithm takes a text string as an argument, which represents a manifest, and a URL manifest URL, which represents the location of the @@ -1456,53 +1456,53 @@

  • Let manifest be the result of converting json to a - WebAppManifest. + WebAppManifest dictionary.
  • Let manifest["start_url"] be the result of - running the steps for post-processing the start_url - member with manifest, manifest URL, and - document URL as arguments. + running post-processing the start_url member + given manifest["start_url"], manifest + URL, and document URL.
  • Let manifest["lang"] be the result of running - the steps for post-processing the lang member - with manifest as the argument. + post-processing the lang member given + manifest["lang"].
  • Let manifest["scope"] be the result of running - the steps for post-processing the scope member - with manifest, manifest URL, document - URL, manifest["start_url"] as arguments. + post-processing the scope member given + manifest["scope"], manifest URL, + document URL, and manifest["start_url"].
  • Let manifest["theme_color"] be the result of - running the steps for post-processing the theme_color - member with manifest as argument. + running post-processing the theme_color member + given manifest["theme_color"].
  • Let manifest["background_color"] be the result - of running the steps for post-processing the - background_color member with manifest as - argument. + of running post-processing the background_color + member given manifest["background_color"].
  • Let manifest["categories"] be the result of - running the steps for post-processing the categories - member with manifest as argument. + running post-processing the categories member + given manifest["categories"].
  • Let manifest["icons"] be the result of running - the steps for post-processing ImageResource members with - manifest, manifest URL, and "icons" as arguments. + post-processing ImageResource members given + manifest["icons"], manifest URL, and + "icons".
  • Let manifest["screenshots"] be the result of - running the steps for post-processing ImageResource members - with manifest, manifest URL, and "screenshots" - as arguments. + running post-processing ImageResource members given + manifest["screenshots"], manifest URL, + and "screenshots".
  • Let manifest["related_applications"] be the - result of running the steps for post-processing the - related_applications member with manifest - as argument. + result of running post-processing the + related_applications member given + manifest["related_applications"].
  • Let manifest["serviceworker"] be the result of - running the steps for post-processing the - serviceworker member with manifest, - manifest URL, and serviceworker as arguments. + running post-processing the serviceworker member + given manifest["serviceworker"], manifest + URL, and serviceworker.
  • Return manifest.
  • @@ -1696,7 +1696,7 @@

    structurally valid.

    - The steps for post-processing the lang member + The steps for post-processing the lang member is given by the following algorithm. The algorithm takes a WebAppManifest manifest as an argument. This algorithm returns a DOMString?. @@ -1770,24 +1770,20 @@

    context.

    - The steps for post-processing the scope + The steps for post-processing the scope member is given by the following algorithm. The algorithm takes - a WebAppManifest manifest, a URL - manifest URL, a URL document URL, and a - URL start URL . This algorithm returns a URL or + an USVString scope URL, a URL manifest + URL, a URL document URL, and a URL start + URL. This algorithm returns a URL or undefined.

      -
    1. Let value be manifest.scope. -
    2. -
    3. Let type be Type(value). -
    4. -
    5. If type is not String or value - is the empty string, then return undefined. +
    6. If scope URL is the empty string, then return + undefined.
    7. -
    8. Let scope URL be a new URL using - value as input and manifest URL as - the base URL. +
    9. Let scope URL be a new URL using scope + URL as input and manifest URL as the + base URL.
    10. If scope URL is failure:
        @@ -1972,26 +1968,21 @@

        created or any time thereafter.

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

          -
        1. Let value be manifest["start_url"]. -
        2. -
        3. Let type be Type(value). -
        4. -
        5. If type is not String or value - is the empty string, return a new URL whose input - is document URL. +
        6. If start URL is the empty string, return a new + URL whose input is document URL.
        7. -
        8. Let url be a new URL using value as - input and manifest URL as the base - URL. +
        9. Let start URL be a new URL using + value as input and manifest URL as + the base URL.
        10. -
        11. If url is failure: +
        12. If start URL is failure:
        13. -
        14. If url is not same origin as document URL: +
        15. If start URL is not same origin as + document URL:
          1. Issue a developer warning that the start_url @@ -2013,7 +2005,7 @@

        16. -
        17. Otherwise, return url. +
        18. Otherwise, return start URL.
        @@ -2067,22 +2059,19 @@

        they coalesce. If they have different script URLs, last one wins.

        - The steps for post-processing the serviceworker + The steps for post-processing the serviceworker member are given by the following algorithm. The algorithm - takes a WebAppManifest manifest. This algorithm - returns a registration object registration, which - can be undefined. + takes a ServiceWorkerRegistration registration. + This algorithm returns a ServiceWorkerRegistration + registration, which can be undefined.

          -
        1. Let registration be - manifest["serviceworker"]. -
        2. If registration is undefined, return undefined.
        3. -
        4. Let registration["src"] be the result of running the - steps for post-processing the src member of a service - worker with registration["src"] and manifest +
        5. Let registration["src"] be the result of running + post-processing the src member of a service + worker given registration["src"] and manifest URL.
        6. If the result of running is origin potentially trustworthy @@ -2090,9 +2079,9 @@

          Trusted, issue a developer warning, abort these steps and return undefined.

        7. -
        8. Let registration["scope"] be the result of running the - steps for post-processing the scope member of a - service worker passing registration["scope"]. +
        9. Let registration["scope"] be the result of running + post-processing the scope member of a service + worker given registration["scope"].
        10. Return registration.
        11. @@ -2129,20 +2118,15 @@

          "theme-color".

          - The steps for post-processing the theme_color + The steps for post-processing the theme_color member are given by the following algorithm. The algorithm - takes a WebAppManifest manifest as an argument. - This algorithm returns a USVString?. + takes a USVString theme color as an argument. This + algorithm returns a USVString?.

            -
          1. Let value be manifest["theme_color"]. -
          2. -
          3. If Type(value) is not String - return undefined. -
          4. -
          5. Otherwise, let potential color be the result of - running [[!CSS-SYNTAX-3]]'s parse a component value algorithm - with value as input. If parsing returns a syntax error, +
          6. Let potential color be the result of running + [[!CSS-SYNTAX-3]]'s parse a component value algorithm with + theme color as input. If parsing returns a syntax error, return undefined.
          7. Let color be the result of attempting to parse @@ -2186,25 +2170,25 @@

            application.

            - The steps for post-processing the + The steps for post-processing the related_applications member are given by the - following algorithm. The algorithm takes a WebAppManifest - manifest as an argument. This algorithm returns an + following algorithm. The algorithm takes a + sequence<ExternalApplicationResource> related + applications as an argument. This algorithm returns an Array<ExternalApplicationResource>.

            1. Let relatedApplications be a new Array object created as if by the expression [].
            2. -
            3. For each app in - manifest["related_applications"]: +
            4. For each app in related applications:
              1. if neither app["src"] nor app["url"] are undefined:
                  -
                1. Set app["url"] be the result of running the - steps for post-processing the url member of - an application with app["url"]. +
                2. Set app["url"] be the result of running + post-processing the url member of an + application given app["url"].
                3. Append app to relatedApplications
                4. @@ -2251,21 +2235,16 @@

                  application's stylesheet is available.

                  - The steps for post-processing the background_color + The steps for post-processing the background_color member are given by the following algorithm. The algorithm - takes a WebAppManifest manifest as an argument. + takes a USVString background color as an argument. This algorithm returns a USVString?.

                    -
                  1. Let value be manifest["background_color"]. -
                  2. -
                  3. If Type(value) is not String - return undefined. -
                  4. -
                  5. Otherwise, let potential color be the result of - running [[!CSS-SYNTAX-3]]'s parse a component value algorithm - with value as input. If parsing returns a syntax error, - return undefined. +
                  6. Let potential color be the result of running + [[!CSS-SYNTAX-3]]'s parse a component value algorithm with + background color as input. If parsing returns a syntax + error, return undefined.
                  7. Let color be the result of attempting to parse potential color as a CSS color, as per [[!CSS-SYNTAX-3]]. @@ -2298,14 +2277,14 @@

                    keywords, catalogs and stores are not required to honor this hint.

                    - The steps for post-processing the categories + The steps for post-processing the categories member are given by the following algorithm. The algorithm - takes a WebAppManifest manifest as an argument. - This algorithm returns an Array<USVString>. + takes a sequence<USVString> categories as an + argument. This algorithm returns an + Array<USVString>.

                      -
                    1. For each category in - manifest["categories"]: +
                    2. For each category in categories:
                      1. Convert category to ASCII lowercase in place. @@ -2545,7 +2524,7 @@

                        - The steps for post-processing the purpose member of + The steps for post-processing the purpose member of an image are given by the following algorithm. The algorithm takes an ImageResource image. This algorithm will return a set. @@ -2625,7 +2604,7 @@

                        display context (and ignore any that are inappropriate).

                        - The steps for post-processing the sizes member of + The steps for post-processing the sizes member of an image are given by the following algorithm. The algorithm takes an ImageResource image. This algorithm will return a set. @@ -2662,7 +2641,7 @@

                        from which a user agent can fetch the image's data.

                        - The steps for post-processing the src member of an + The steps for post-processing the src member of an image are given by the following algorithm. The algorithm takes a ImageResource icon, and a URL manifest URL , which is the URL from which the @@ -2695,7 +2674,7 @@

                        must expect the resource to be an image.

                        - The steps for post-processing the type member of an + The steps for post-processing the type member of an image are given by the following algorithm. The algorithm takes an image object as an argument, and returns either a string or undefined. @@ -2719,7 +2698,7 @@

                        Post-processing an array of image resources

                        - The steps for post-processing ImageResource members + The steps for post-processing ImageResource members are given by the following algorithm. The algorithm takes a manifest, a URL manifest URL, which is the URL from which the manifest was fetched, and a string that represents the @@ -2741,24 +2720,24 @@

                        the expression ({}).

                      2. Let image["src"] be the result of running - the steps for post-processing the src - member of an image with entry and - manifest URL. + post-processing the src member of an + image given entry and manifest + URL.
                      3. Let image["type"] be the result of running - the steps for post-processing the type - member of an image with entry and - manifest URL. + post-processing the type member of an + image given entry and manifest + URL.
                      4. Let image["sizes"] be the result of running - the steps for post-processing the sizes - member of an image with entry and - manifest URL. + post-processing the sizes member of an + image given entry and manifest + URL.
                      5. Let image["purpose"] be the result of - running the steps for post-processing the - purpose member of an image with - entry and manifest URL. + running post-processing the purpose member + of an image given entry and manifest + URL.
                      6. Append image to imageResources
                      7. @@ -2838,7 +2817,7 @@

                        dictionary is a URL representing a service worker.

                        - The steps for post-processing the src member of a + The steps for post-processing the src member of a service worker are given by the following algorithm. The algorithm takes a USVString source URL, and a URL manifest URL, which is the URL from @@ -2864,7 +2843,7 @@

                        dictionary is the service worker's associated scope URL.

                        - The steps for post-processing the scope member of a + The steps for post-processing the scope member of a service worker are given by the following algorithm. The algorithm takes a USVString scope URL, and a URL manifest URL, which is the URL from @@ -3008,7 +2987,7 @@

                        found.

                        - The steps for post-processing the url member of an + The steps for post-processing the url member of an application are given by the following algorithm. The algorithm takes a USVString application URL. This algorithm will return an URL or undefined. @@ -3636,7 +3615,7 @@

                        Notes:
                        - Please refer to the steps for obtaining a manifest for + Please refer to the steps for obtaining a manifest for details about how to fetch and apply a manifest.
                        @@ -3662,11 +3641,11 @@

                        This specification is designed to be extensible. Other specifications are encouraged to define new members for the manifest. However, in doing so, please follow the conventions used in this specification. - In particular, use the extension point to hook into the - steps for processing a manifest. Also, be sure to specify the - steps for post-processing your particular member in the manner set - forth in this specification. This will help keep this part of the - platform consistent. + In particular, use the extension point to hook into the steps + for processing a manifest. Also, be sure to specify the steps + for post-processing your particular member in the manner set forth in + this specification. This will help keep this part of the platform + consistent.

                        To allow the community can easily find extensions, please add your From 54af83494d9280f7f37cd9117dd4ae139e98443e Mon Sep 17 00:00:00 2001 From: Kenneth Rohde Christiansen Date: Tue, 10 Oct 2017 15:11:19 +0200 Subject: [PATCH 9/9] Review comments from Tobie --- index.html | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/index.html b/index.html index 2e8f263fe..6b116a5ef 100644 --- a/index.html +++ b/index.html @@ -1458,50 +1458,50 @@

                        "to idl dictionary value">converting json to a WebAppManifest dictionary. -
                      8. Let manifest["start_url"] be the result of +
                      9. Set manifest["start_url"] to the result of running post-processing the start_url member - given manifest["start_url"], manifest + given manifest["start_url"], manifest URL, and document URL.
                      10. -
                      11. Let manifest["lang"] be the result of running +
                      12. Set manifest["lang"] to the result of running post-processing the lang member given - manifest["lang"]. + manifest["lang"].
                      13. -
                      14. Let manifest["scope"] be the result of running +
                      15. Set manifest["scope"] to the result of running post-processing the scope member given - manifest["scope"], manifest URL, - document URL, and manifest["start_url"]. + manifest["scope"], manifest URL, + document URL, and manifest["start_url"].
                      16. -
                      17. Let manifest["theme_color"] be the result of +
                      18. Set manifest["theme_color"] to the result of running post-processing the theme_color member - given manifest["theme_color"]. + given manifest["theme_color"].
                      19. -
                      20. Let manifest["background_color"] be the result +
                      21. Set manifest["background_color"] to the result of running post-processing the background_color - member given manifest["background_color"]. + member given manifest["background_color"].
                      22. -
                      23. Let manifest["categories"] be the result of +
                      24. Set manifest["categories"] to the result of running post-processing the categories member - given manifest["categories"]. + given manifest["categories"].
                      25. -
                      26. Let manifest["icons"] be the result of running +
                      27. Set manifest["icons"] to the result of running post-processing ImageResource members given - manifest["icons"], manifest URL, and + manifest["icons"], manifest URL, and "icons".
                      28. -
                      29. Let manifest["screenshots"] be the result of +
                      30. Set manifest["screenshots"] to the result of running post-processing ImageResource members given - manifest["screenshots"], manifest URL, + manifest["screenshots"], manifest URL, and "screenshots".
                      31. -
                      32. Let manifest["related_applications"] be the +
                      33. Set manifest["related_applications"] to the result of running post-processing the related_applications member given - manifest["related_applications"]. + manifest["related_applications"].
                      34. -
                      35. Let manifest["serviceworker"] be the result of +
                      36. Set manifest["serviceworker"] to the result of running post-processing the serviceworker member - given manifest["serviceworker"], manifest + given manifest["serviceworker"], manifest URL, and serviceworker.
                      37. Return manifest. @@ -1702,7 +1702,7 @@

                        algorithm returns a DOMString?.

                          -
                        1. Let value be manifest.lang. +
                        2. Let value be manifest["lang"].
                        3. If Type(value) is String:
                            @@ -2069,19 +2069,19 @@

                          1. If registration is undefined, return undefined.
                          2. -
                          3. Let registration["src"] be the result of running +
                          4. Set registration["src"] to the result of running post-processing the src member of a service - worker given registration["src"] and manifest + worker given registration["src"] and manifest URL.
                          5. If the result of running is origin potentially trustworthy - with the origin of registration["src"] is Not + with the origin of registration["src"] is Not Trusted, issue a developer warning, abort these steps and return undefined.
                          6. -
                          7. Let registration["scope"] be the result of running +
                          8. Set registration["scope"] to the result of running post-processing the scope member of a service - worker given registration["scope"]. + worker given registration["scope"].
                          9. Return registration.
                          10. @@ -2183,12 +2183,12 @@

                          11. For each app in related applications:
                              -
                            1. if neither app["src"] nor app["url"] +
                            2. if neither app["src"] nor app["url"] are undefined:
                                -
                              1. Set app["url"] be the result of running +
                              2. Set app["url"] to the result of running post-processing the url member of an - application given app["url"]. + application given app["url"].
                              3. Append app to relatedApplications
                              4. @@ -2532,7 +2532,7 @@

                                1. Let set be an empty set.
                                2. -
                                3. Let value be image["purpose"]. +
                                4. Let value be image["purpose"].
                                5. If Type(value) is String:
                                    @@ -2649,7 +2649,7 @@

                                    URL or undefined.

                                      -
                                    1. Let value be image.src. +
                                    2. Let value be image["src"].
                                    3. If Type(value) it not String, return undefined. @@ -2680,7 +2680,7 @@

                                      string or undefined.

                                        -
                                      1. Let value be image["type"]. +
                                      2. Let value be image["type"].
                                      3. If Type(value) it not String, return undefined. @@ -2714,27 +2714,27 @@

                                      4. For each entry in manifest[member name]:
                                          -
                                        1. if entry["src"] is not undefined: +
                                        2. If entry["src"] is not undefined:
                                          1. Let image be a new object created as if by the expression ({}).
                                          2. -
                                          3. Let image["src"] be the result of running +
                                          4. Set image["src"] to the result of running post-processing the src member of an image given entry and manifest URL.
                                          5. -
                                          6. Let image["type"] be the result of running +
                                          7. Set image["type"] to the result of running post-processing the type member of an image given entry and manifest URL.
                                          8. -
                                          9. Let image["sizes"] be the result of running +
                                          10. Set image["sizes"] to the result of running post-processing the sizes member of an image given entry and manifest URL.
                                          11. -
                                          12. Let image["purpose"] be the result of +
                                          13. Set image["purpose"] to the result of running post-processing the purpose member of an image given entry and manifest URL.