Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify how "child browsing contexts" works #1336

Closed
domenic opened this issue May 28, 2016 · 7 comments · Fixed by #6315
Closed

Clarify how "child browsing contexts" works #1336

domenic opened this issue May 28, 2016 · 7 comments · Fixed by #6315
Assignees
Labels

Comments

@domenic
Copy link
Member

domenic commented May 28, 2016

As noted in #1312 (comment), current usage is ambiguous. The spec says:

If the browsing context container element E is in the Document D, then P is said to be the parent browsing context of C and C is said to be a child browsing context of P.

i.e., it defines "browsing context C is a child browsing context of browsing context P".

Later the spec says:

Because they are nested through an element, child browsing contexts are always tied to a specific Document in their parent browsing context.

In practice, how the phrase "child browsing context" is used is usually by referring to a document's child browsing contexts, or sometimes a window. This is not really well-defined.

Later in the spec when defining window.length, it says:

The number of child browsing contexts of a Window object W is the number of child browsing contexts that are nested through elements that are in a Document that is the active document of the Window object's associated Document object's browsing context.

This concept of "child browsing contexts that are nested through elements that are in a Document" maybe is equivalent to "the document's child browsing contexts", but I am not sure. Later, in [[GetOwnProperty]] for WindowProxy, the spec uses

the indexth child browsing context of the Document that is nested through an element that is in W's Document, sorted in the order that the elements nesting those browsing contexts were most recently inserted into the Document, the WindowProxy object of the most recently inserted browsing context container's nested browsing context being last.


I'd suggest centralizing these definitions and defining:

  • C is a child browsing context of P
  • A Window object's child browsing contexts (an ordered list) + the number of child browsing contexts of a Window W (which should be the cardinality of that list)
  • A Document object's child browsing contexts
  • A Document object's descendant browsing contexts
  • Optionally: a Window object's same-origin child browsing contexts (could be used for "child browsing context name property set")

Then an audit should be done of all places in the spec that use "child browsing context" to see if we can re-frame them in terms of one of these definitions. E.g. I think [[GetOwnProperty]] should use the Window object's child browsing contexts.

I could work on this but maybe @annevk wants to give it a shot?

@annevk
Copy link
Member

annevk commented May 29, 2016

Optionally: a Window object's same-origin child browsing contexts (could be used for "child browsing context name property set")

Cannot be used for that purpose as discussed in #1337.

We should also more clearly define that E has a browsing context internal slot that can be either null or a browsing context.

@annevk
Copy link
Member

annevk commented Oct 25, 2016

I think you ended up cleaning this up, but I can't find all the commits. 7b56772 seems to be one of them.

@domenic
Copy link
Member Author

domenic commented Oct 26, 2016

It looks like some of the issues were solved, but the fact that we still talk about a document's child browsing contexts or a Window's child browsing contexts remains. It should be pretty easy to clean up though now. Maybe I can give it a go soon.

@annevk
Copy link
Member

annevk commented Oct 21, 2019

I think this is a subset of #5020.

@annevk
Copy link
Member

annevk commented Nov 22, 2019

Basically whenever we use child browsing context in a hierarchical way there's an issue of sorts. And it would prolly make sense to give documents a child browsing context collection of sorts.

@annevk
Copy link
Member

annevk commented Jan 28, 2021

@domenic did 7b4964a sufficiently improve this in order to close this issue?

@domenic
Copy link
Member Author

domenic commented Jan 28, 2021

I just did a re-audit and, upon finishing it, realized the results are the same as your comment in #1336 (comment) .

We should be able to fix the discard and abort cases pretty easily. We could leave the plugin case alone for now. And then use #5096 and #5103 to track the remaining. But, I don't think we should close this until we fix the discard and abort cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants