From 8a07c184822b25cdfa7313ad1cb29c853e42df62 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 18 Nov 2019 17:20:52 +0100 Subject: [PATCH] Editorial: nested browsing context is a member, not a type Also make more usage of a browsing context's container (document) where possible. --- source | 324 +++++++++++++++++++++++++++------------------------------ 1 file changed, 154 insertions(+), 170 deletions(-) diff --git a/source b/source index e466c2cac96..8b9007ba205 100644 --- a/source +++ b/source @@ -6827,7 +6827,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • If document is an iframe srcdoc document, then return the document base URL of document's browsing context's - browsing context container's node document.

  • + container document.

  • @@ -15456,9 +15456,8 @@ interface HTMLStyleElement : HTMLElement {

    A Document has a style sheet that is blocking scripts if its script-blocking style sheet counter is greater than 0, or if that Document has a non-null browsing context - that has a parent browsing context, and the script-blocking style sheet - counter of the parent browsing context's active document is - greater than 0.

    + whose container document is non-null and has a + script-blocking style sheet counter greater than 0.

    A Document has no style sheet that is blocking scripts if it does not have a style sheet that is blocking @@ -24758,7 +24757,7 @@ document.body.appendChild(wbr);

    <a href=help.html target=example rel=noopener>Help!</a>
    -

    These are equivalent and only navigate the parent browsing context:

    +

    These are equivalent and only navigate the parent browsing context:

    <a href=index.html target=_parent>Home</a>
    <a href=index.html target=_parent rel=noopener>Home</a>
    @@ -29920,23 +29919,23 @@ interface HTMLIFrameElement : HTMLElement { -

    The iframe element represents a nested browsing +

    The iframe element represents its nested browsing context.

    The src attribute gives the URL - of a page that the nested browsing context is to contain. The attribute, if present, - must be a valid non-empty URL potentially surrounded by spaces. If the nested browsing context is to contain. The attribute, if + present, must be a valid non-empty URL potentially surrounded by spaces. If the itemprop attribute is specified on an iframe element, then the src attribute must also be specified.

    The srcdoc attribute gives the content of the page that the - nested browsing context is to contain. The value of the attribute is the source of - an iframe srcdoc - document.

    + element's nested browsing context is to contain. The value of the attribute is the + source of an iframe srcdoc document.

    The srcdoc attribute, if present, must have a value using the HTML syntax that consists of the following syntactic components, in the @@ -30052,8 +30051,8 @@ interface HTMLIFrameElement : HTMLElement { and then set the element's nested browsing context to null.

    This happens without any unload events firing - (the nested browsing context and its Document are discarded, not discarded, not unloaded).

    @@ -30161,13 +30160,13 @@ interface HTMLIFrameElement : HTMLElement { loaded at the time of the new navigation, then the navigation must be completed with replacement enabled.

    -

    Similarly, if the nested browsing context's session history contained - only one Document when the process the iframe attributes - algorithm was invoked, and that was the about:blank Document created - when the nested browsing context was created, then any navigation required of the user agent in that algorithm must be completed - with replacement enabled.

    +

    Similarly, if the element's nested browsing context's session history + contained only one Document when the process the iframe + attributes algorithm was invoked, and that was the about:blank + Document created when the element's nested browsing context was created, + then any navigation required of the user agent in that algorithm + must be completed with replacement enabled.

    +

    When a Document in an iframe is marked as completely loaded, the user agent must run the iframe load event steps.

    @@ -30238,16 +30237,16 @@ interface HTMLIFrameElement : HTMLElement { about:blank page.

    If the user navigates away from this page, the - iframe's corresponding WindowProxy object will proxy new - Window objects for new Document objects, but the iframe's nested browsing context's WindowProxy object will + proxy new Window objects for new Document objects, but the src attribute will not change.


    The name attribute, if present, must be a - valid browsing context name. The given value is used to name the nested - browsing context if present when the nested browsing context is created.

    + valid browsing context name. The given value is used to name the element's + nested browsing context if present when that is created.


    @@ -30307,9 +30306,9 @@ interface HTMLIFrameElement : HTMLElement { attribute and then reload itself, effectively breaking out of the sandbox altogether.

    These flags only take effect when the nested browsing context of - the iframe is navigated. Removing them, or removing the - entire sandbox attribute, has no effect on an - already-loaded page.

    + the iframe element is navigated. Removing them, or + removing the entire sandbox attribute, has no effect on + an already-loaded page.

    Potentially hostile files should not be served from the same server as the file containing the iframe element. Sandboxing hostile content is of minimal help if an @@ -30467,8 +30466,8 @@ interface HTMLIFrameElement : HTMLElement {

    None of these attributes, allow, allowfullscreen or allowpaymentrequest, can grant access to a feature - in a nested browsing context if the iframe element's node - document is not already allowed to use that feature.

    + in an iframe element's nested browsing context if the element's + node document is not already allowed to use that feature.

    To determine whether a Document object document @@ -30795,9 +30794,9 @@ interface HTMLEmbedElement : HTMLElement {

  • element now represents its nested browsing context.

  • -
  • When the Document of the nested browsing context is - marked as completely loaded, queue a task to fire an event named

    When the Document of element's nested browsing + context is marked as completely loaded, queue a task to + fire an event named load at element.

  • @@ -31057,7 +31056,7 @@ interface HTMLObjectElement : HTMLElement {

    The object element can represent an external resource, which, depending on the - type of the resource, will either be treated as an image, as a nested browsing + type of the resource, will either be treated as an image, as a child browsing context, or as an external resource to be processed by a plugin.

    The data attribute, if present, specifies the @@ -31080,9 +31079,9 @@ interface HTMLObjectElement : HTMLElement { element, then the data attribute must also be specified.

    The name attribute, if present, must be a - valid browsing context name. The given value is used to name the nested - browsing context, if applicable, and if present when the nested browsing - context is created.

    + valid browsing context name. The given value is used to name the element's + nested browsing context, if applicable, and if present when the element's + nested browsing context is created.

    @@ -31536,7 +31535,7 @@ interface HTMLObjectElement : HTMLElement { data-x="event-load">load event is fired at the about:blank document itself.

    -

    The object element represents the nested browsing +

    The object element represents its nested browsing context.

    In certain situations, e.g., if the resource was fetched from an @@ -31546,8 +31545,8 @@ interface HTMLObjectElement : HTMLElement { data-x="navigate">navigation of the browsing context will be restarted so as to load the resource afresh from the network or a different application cache. Even if the resource is then found to have a different type, it is still used - as part of a nested browsing context: only the navigate algorithm - is restarted, not this object algorithm.

    + as part of a browsing context: only the navigate algorithm is + restarted, not this object algorithm.

    @@ -45931,7 +45930,7 @@ interface HTMLInputElement : HTMLElement { data-x="">https://streams.spec.whatwg.org/
    in the recent past, then the rendering might look like this:

    -

    A text box with an icon on the left followed by the text "spec.w" and a cursor, with a drop down button on the right hand side; with, below, a drop down box containing a list of six URLs on the left, with the first four having grayed out labels on the right; and a scroll bar to the right of the drop down box, indicating further values are available.

    +

    A text box with an icon on the left followed by the text "spec.w" and a cursor, with a drop down button on the right hand side; with, below, a drop down box containing a list of six URLs on the left, with the first four having grayed out labels on the right; and a scrollbar to the right of the drop down box, indicating further values are available.

    The first four URLs in this sample consist of the four URLs in the author-specified list that match the text the user has entered, sorted in some UA-defined manner (maybe by how frequently @@ -73571,9 +73570,9 @@ END:VCARD

    A browsing context container (e.g. an - iframe) is a focusable area, but key events routed to a browsing context - container get immediately routed to the nested browsing context's active - document. Similarly, in sequential focus navigation a browsing context + iframe) is a focusable area, but key events routed to a browsing + context container get immediately routed to its nested browsing context's + active document. Similarly, in sequential focus navigation a browsing context container essentially acts merely as a placeholder for its nested browsing context's active document.

    @@ -73631,13 +73630,11 @@ END:VCARD -
  • - -

    If current object is a Document in a nested browsing - context, let current object be its browsing context container, - and return to the step labeled loop.

    - -
  • +
  • If current object is a Document whose browsing context is a child browsing context, + then set current object to current object's browsing context's container and return to the step labeled loop.

  • @@ -73889,7 +73886,6 @@ END:VCARD as focusable areas:

      -
    • a elements that have an href attribute
    • @@ -73914,9 +73910,7 @@ END:VCARD
    • Editing hosts
    • -
    • Browsing context containers
    • - +
    • Browsing context containers
    @@ -74520,16 +74514,14 @@ END:VCARD
  • -
  • Otherwise, starting point is a focusable area in a - nested browsing context. Let starting point be that - nested browsing context's browsing context container, and return to the - step labeled loop.

    - -
  • - +
  • Otherwise, starting point is a focusable area in a child + browsing context. Set starting point to that child browsing + context's container and return to the step labeled + loop.

  • + @@ -74628,9 +74620,9 @@ END:VCARD routed. This is, roughly speaking, the focused element in the document.

    For the purposes of this API, when a child browsing context is focused, its - browsing context container is focused in the - parent browsing context. For example, if the user moves the focus to a text control - in an iframe, the iframe is the element returned by the container is focused + in the parent browsing context. For example, if the user moves the focus to a text + control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document.

    @@ -74680,7 +74672,7 @@ END:VCARD

    Moves the focus to the element.

    -

    If the element is a browsing context container, moves the focus to the +

    If the element is a browsing context container, moves the focus to its nested browsing context instead.

    By default, this method also scrolls the element into view. Providing the DragEventInit : MouseEventInit { about:blank, then return invocationOrigin.

  • If url is about:srcdoc, then return the origin of - browsingContext's browsing context container's node + browsingContext's container document.

  • Return url's origin.

  • @@ -78430,8 +78422,8 @@ dictionary DragEventInit : MouseEventInit { null or a Document object creator and browsing context group group:

    - +
    1. Let browsingContext be a new browsing context.

    2. @@ -78641,9 +78633,9 @@ dictionary DragEventInit : MouseEventInit { data-export="">auxiliary browsing contexts. Auxiliary browsing contexts are always top-level browsing contexts.

      -

      The transitive closure of parent browsing contexts - for a browsing context that is a nested browsing context gives the list - of ancestor browsing contexts.

      +

      The transitive closure of parent browsing + contexts for a browsing context that is a child browsing context + gives the list of ancestor browsing contexts.

      The list of the descendant browsing contexts of a Document d is the (ordered) list returned by the following algorithm:

      @@ -78891,11 +78883,10 @@ dictionary DragEventInit : MouseEventInit {
    3. If current is null, then return null.

    4. -
    5. If current is not a child browsing context, then return - null.

    6. +
    7. Let container be current's container.

    8. -
    9. Let container be current's browsing context - container.

    10. +
    11. If container is null, then return null.

    12. If container's node document's origin is not same origin-domain with the current settings object's same as the origin of the active document of B, or

    13. -
    14. The browsing context A is a nested browsing context with a - top-level browsing context, and its top-level browsing context is B, or
    15. +
    16. The browsing context A is a child browsing context and its + top-level browsing context is B, or
    17. The browsing context B is an auxiliary browsing context and A is familiar with B's opener @@ -80297,7 +80288,7 @@ dictionary WindowPostMessageOptions : PostMessageOptions active document's origin is not same origin with window's relevant settings object's origin and whose browsing context - name does not match the name of its browsing context container's does not match the name of its container's name content attribute value.

    18. Return the browsing context names of @@ -80352,9 +80343,9 @@ dictionary WindowPostMessageOptions : PostMessageOptions

    19. If objects contains a browsing context, then return the - WindowProxy object of the nested browsing context corresponding to the - first browsing context container in tree order whose nested - browsing context is in objects.

    20. + WindowProxy object of the nested browsing context of the first + browsing context container in tree order whose nested browsing + context is in objects.

    21. Otherwise, if objects has only one element, return that element.

      @@ -80504,7 +80495,7 @@ interface BarProp {
      window . scrollbars . visible
      -

      Returns true if the scroll bars are visible; otherwise, returns false.

      +

      Returns true if the scrollbars are visible; otherwise, returns false.

      window . statusbar . visible
      @@ -80701,7 +80692,7 @@ interface BarProp { referrer policy is the empty string, set document to document's browsing context's - browsing context container's node document.

    22. + container document.

    23. Return document's referrer policy.

    24. @@ -81577,16 +81568,12 @@ interface BarProp {
      The sandboxed plugins browsing context flag
      -
      - -

      This flag prevents content from instantiating plugins, whether - using the embed element, the object element, or through navigation of a nested browsing context, unless - those plugins can be secured.

      - -
      +

      This flag prevents content from instantiating plugins, + whether using the embed element, the object element, or through navigation of their nested browsing context, + unless those plugins can be secured.

      The sandboxed origin browsing context flag
      @@ -81810,9 +81797,9 @@ interface BarProp { popup sandboxing flag set must be empty. It is populated by the rules for choosing a browsing context.

      -

      Every browsing context that is a nested browsing context has an - iframe sandboxing flag set, which is a sandboxing flag set. - Which flags in a nested browsing context's iframe sandboxing flag +

      Every browsing context that is an iframe element's nested + browsing context has an iframe sandboxing flag set, which is a + sandboxing flag set. Which flags in an iframe sandboxing flag set are set at any particular time is determined by the iframe element's sandbox attribute.

      @@ -81840,12 +81827,13 @@ interface BarProp {
    25. If browsing context is a top-level browsing context, then: the flags set on the popup sandboxing flag set.

    26. -
    27. If browsing context is a nested browsing context, then: the - flags set on the iframe sandboxing flag set.

    28. +
    29. If browsing context is an iframe element's nested browsing + context, then: the flags set on the iframe sandboxing flag + set.

    30. -
    31. If browsing context is a nested browsing context, then: the - flags set on the parent browsing context's active document's - active sandboxing flag set.

    32. +
    33. If browsing context is a child browsing context, then: the flags + set on browsing context's container + document's active sandboxing flag set.

    34. @@ -81855,8 +81843,8 @@ interface BarProp {

      The session history of browsing contexts

      The sequence of Documents in a browsing context is its session - history. Each browsing context, including nested browsing contexts, has a distinct session history. A browsing + history. Each browsing context, including child browsing contexts, has a distinct session history. A browsing context's session history consists of a flat list of session history entries. Each session history entry consists, at a minimum, of a URL, and each entry may in addition have serialized state, @@ -83335,8 +83323,8 @@ interface Location { // but see also srcdoc document

      Reprocess the iframe - attributes of the browsing context's browsing context - container.

      + attributes of the browsing context's container.

      Otherwise
      @@ -83630,11 +83618,10 @@ interface Location { // but see also
      load
      events mode.

      -

      The user agent must take this nested browsing context out of the delaying +

      The user agent must take this child browsing context out of the delaying load events mode when this navigation algorithm later matures, or when it terminates (whether due to having @@ -83694,11 +83681,10 @@ interface Location { // but see also href attribute of an a element would only be evaluated when the link was followed, while such a URL in the src attribute of an iframe - element would be evaluated in the context of the iframe's own nested - browsing context when the iframe is being set up. Once evaluated, its - return value (if it was a string) would replace that browsing context's - Document, thus also changing the Window object of that - browsing context.

      + element would be evaluated in the context of the iframe's nested browsing + context when the iframe is being set up. Once evaluated, its return value + (if it was a string) would replace that browsing context's active + document, thus also changing the corresponding Window object.

      If resource is to be fetched using `GET`, and there are @@ -83767,9 +83753,8 @@ interface Location { // but see also id.

      -
    35. If browsingContext is a child browsing context and the - browsing context container of browsingContext has a browsing - context scope origin, then set request's

      If browsingContext's container is non-null + and has a browsing context scope origin, then set request's origin to that browsing context scope origin.

    36. @@ -84235,11 +84220,12 @@ interface Location { // but see also

      The creating a feature policy from a response algorithm makes use of origin. If document.domain has been used - for the browsing context container's node document, then its - origin cannot be same origin-domain with >origin, because - these steps run before the document is created, so it cannot itself yet have used - document.domain. Note that this means that Feature - Policy checks are less permissive compared to doing a same origin check instead.

      + for the browsingContext container + document, then its origin cannot be same origin-domain with + >origin, because these steps run before the document is created, so it + cannot itself yet have used document.domain. Note + that this means that Feature Policy checks are less permissive compared to doing a same + origin check instead.

      See below for some examples of this in action.

    @@ -85210,31 +85196,28 @@ new PaymentRequest(…); // Allowed to use

    The task source for the tasks mentioned above is the DOM manipulation task source.

    -
    Persisted user state restoration
    -

    When the user agent is to restore persisted user state from a history entry, it must run the following steps immediately:

      -
    1. If the entry has a scroll restoration mode, let scrollRestoration be that. Otherwise let scrollRestoration be "auto"

    2. If scrollRestoration is "manual" the user agent should not restore the scroll - position for the Document or any of its scrollable regions, with the exception of - any nested browsing contexts whose scroll restoration is controlled by their own history entry's - scroll restoration mode, otherwise, it may do so.

    3. + data-x="dom-ScrollRestoration-manual">manual", then the user agent should not restore the + scroll position for the Document or any of its scrollable regions, with the + exception of any child browsing contexts of + Document's browsing context whose scroll + restoration is controlled by their own history entry's scroll restoration mode, + otherwise, it may do so.

    4. Optionally, update other aspects of the document and its rendering, for instance values of form fields, that the user agent had previously recorded.

    5. -
    -

    This can even include updating the dir attribute @@ -85250,6 +85233,9 @@ new PaymentRequest(…); // Allowed to use assume any particular scroll position but rather are urged to set it to what they want it to be.

    + + +
    The PopStateEvent interface
    [Exposed=Window,
    @@ -94630,15 +94616,13 @@ function sendData(data) {
        
     
        
  • -

    The user agent must fire an event named beforeprint at the relevant global object of the - Document that is being printed, as well as any nested browsing contexts in it.

    + Document that is being printed, as well as any child browsing contexts in it.

    The beforeprint event can be used to annotate the printed copy, for instance adding the time at which the document was printed.

    -
  • @@ -94653,17 +94637,15 @@ function sendData(data) {
  • -

    The user agent must fire an event named afterprint at the relevant global object of the - Document that is being printed, as well as any nested browsing contexts in it.

    + Document that is being printed, as well as any child browsing contexts in it.

    The afterprint event can be used to revert annotations added in the earlier event, as well as showing post-printing UI. For instance, if a page is walking the user through the steps of applying for a home loan, the script could automatically advance to the next step after having printed a form or other.

    -
  • @@ -101754,7 +101736,7 @@ interface Storage { storage area does not change during the lifetime of a Document.

    In the case of an iframe being moved to another - Document, the nested browsing context is destroyed and a new one created.

    + Document, its nested browsing context is destroyed and a new one created.

    The sessionStorage attribute must return a Storage object associated with the Document's assigned session storage @@ -113946,6 +113928,7 @@ html, body { display: block; }

    none of the attributes for a property are found, or if the value of the attribute that was found cannot be parsed successfully, then a default value of 8px is expected to be used for that property instead.

    + @@ -113986,8 +113969,8 @@ html, body { display: block; }

    If the body element's node document's browsing context is a nested browsing context, - and the browsing context container of that nested browsing context is a + data-x="concept-document-bc">browsing context is a child browsing context, + and the container of that browsing context is a frame or iframe element, then the container frame element of the body element is that frame or iframe element. Otherwise, there is no container frame element.

    @@ -114000,21 +113983,22 @@ html, body { display: block; }
    -

    If a Document is in a nested browsing context, it is expected to be - positioned and sized to fit inside the content box of its browsing context - container. If a browsing context's browsing context container is - not being rendered, the browsing context is expected to have a +

    If a Document's browsing context is a + child browsing context, then it is expected to be positioned and sized to fit inside + the content box of the container of that + browsing context. If the container is not + being rendered, the browsing context is expected to have a viewport with zero width and zero height.

    -

    If the Document is in a nested browsing context, and the - browsing context container of that nested browsing context is a - frame or iframe element, and that element has a scrolling attribute, and that attribute's value is an ASCII +

    If a Document's browsing context is a + child browsing context, the container of that + browsing context is a frame or iframe element, that element + has a scrolling attribute, and that attribute's value is an ASCII case-insensitive match for the string "off", "noscroll", or "no", then the user agent is expected to - prevent any scroll bars from being shown for the viewport of the - nested browsing context, regardless of the 'overflow' property that - applies to that viewport.

    + prevent any scrollbars from being shown for the viewport of the + Document's browsing context, regardless of + the 'overflow' property that applies to that viewport.


    @@ -115314,10 +115298,10 @@ legend[align=right i] { intrinsic dimensions as the element. Other canvas elements are expected to be treated as ordinary elements in the rendering model.

    -

    An object element that represents an image, plugin, or nested - browsing context is expected to be treated as a replaced element. Other - object elements are expected to be treated as ordinary elements in the rendering - model.

    +

    An object element that represents an image, plugin, or its + nested browsing context is expected to be treated as a replaced element. + Other object elements are expected to be treated as ordinary elements in the + rendering model.

    The audio element, when it is exposing a user interface, is expected to be treated as a @@ -116195,7 +116179,7 @@ marquee { data-x="">size×avg + sbw, where size is the element's character width, avg is the average character width of the primary font of the element, in CSS pixels, and sbw is the width of a scroll bar, in CSS pixels, and sbw is the width of a scrollbar, in CSS pixels. (The element's 'letter-spacing' property does not affect the result.)

    @@ -116506,7 +116490,7 @@ marquee {

    The contents of a frame element that does not have a frameset parent are expected to be rendered as transparent black; the user agent is expected to not - render the nested browsing context in this case, and that nested browsing + render its nested browsing context in this case, and its nested browsing context is expected to have a viewport with zero width and zero height.

    @@ -117499,8 +117483,8 @@ interface HTMLFrameSetElement : HTMLElement {

    The frame - element defines a nested browsing context similar to the iframe - element, but rendered within a frameset element.

    + element has a nested browsing context similar to the iframe element, but + rendered within a frameset element.

    @@ -117556,13 +117540,13 @@ interface HTMLFrameSetElement : HTMLElement { loaded at the time of the new navigation, then the navigation must be completed with replacement enabled.

    -

    Similarly, if the nested browsing context's session history contained - only one Document when the process the frame attributes - algorithm was invoked, and that was the about:blank Document created - when the nested browsing context was created, then any navigation required of the user agent in that algorithm must be completed - with replacement enabled.

    +

    Similarly, if the element's nested browsing context's session history + contained only one Document when the process the frame + attributes algorithm was invoked, and that was the about:blank + Document created when its nested browsing context was created, then any + navigation required of the user agent in that algorithm must be + completed with replacement enabled.

    +