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

About the term "top-level-browsing-context" #2322

Open
NE-SmallTown opened this issue Feb 5, 2017 · 5 comments
Open

About the term "top-level-browsing-context" #2322

NE-SmallTown opened this issue Feb 5, 2017 · 5 comments
Labels
clarification Standard could be clearer good first issue Ideal for someone new to a WHATWG standard or software project

Comments

@NE-SmallTown
Copy link

In the spec:

A browsing context that is not a nested browsing context has no parent browsing context, and is the top-level browsing context of all the browsing contexts for which it is an ancestor browsing context.

I think I can't understand what it means very well,could you give some little example?Thanks a lot.

@zcorpan zcorpan added the clarification Standard could be clearer label Feb 6, 2017
@zcorpan
Copy link
Member

zcorpan commented Feb 6, 2017

Consider this document:

<!-- a.html -->
<!doctype html>
<title>A</title>
<p>A</p>
<iframe src="b.html"></iframe>
<button onclick="window.open('c.html')">open</button>

When clicking the button, there will be three browsing contexts:

+-------------------------------------+
| A                                   |
|  +-----------------------+          |
|  | B                     |          |
|  |                       |          |
|  +-----------------------+ ( open ) |
|                                     |
|         +-------------------------------------+
|         | C                                   |
|         |                                     |
+---------|                                     |
          |                                     |
          |                                     |
          +-------------------------------------+
  • A is a top-level browsing context. It is the parent and ancestor of B.
  • B is a child browsing context (and document-tree child browsing context) of A.
  • C is a top-level browsing context and an auxillary browsing context. Its opener browsing context is A.

Does that help? If so, we can maybe convert the diagram to SVG and put this into the standard.

@NE-SmallTown
Copy link
Author

NE-SmallTown commented Feb 7, 2017

@zcorpan Thanks for your clarification!It does help for me.

Yes, I believe put this diagram into the standard will be helpful for others.In addition,I think you can simplify the words I mention above in this issue because it's a liitle huge and complex,or you can put this diagram into the standard and divide the sentence to many pieces and explain each the corresponding piece by using some words with the diagram.

For example:

In the spec:

A browsing context that is not a nested browsing context has no parent browsing context......

Then we can say something in the spec like A and C both are not a nested browsing and both haven't parent browsing context.......

This is just my thought,hope it would be helpful.

@zcorpan zcorpan reopened this Feb 7, 2017
@youzuosan
Copy link

nice

@zcorpan zcorpan added the good first issue Ideal for someone new to a WHATWG standard or software project label Feb 7, 2017
@ilya-loskutov
Copy link

@zcorpan could you clear up my misunderstanding, please?

The term of document-tree child browsing context is defined by the spec in the following way:

A browsing context child is a document-tree child browsing context of parent if child is a child browsing context and child's container is in a document tree.

In the other hand, in a document tree means

An element is in a document tree if its root is a document.

So this concept is concerned with DOM tree and its elements. Is it accurate to say that child's container, which is a broswing context, is a DOM element (node) and it is in a node tree?

@pshaughn
Copy link
Contributor

pshaughn commented Sep 5, 2021

https://html.spec.whatwg.org/#bc-container "The container of a browsing context bc is the browsing context container whose nested browsing context is bc, or null if there is no such element." "Certain elements (for example, iframe elements) can instantiate further browsing contexts. These elements are called browsing context containers." The container is never a browsing context. The container is a iframe/embed/object that has a browsing context, or it's null if the browsing context isn't nested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer good first issue Ideal for someone new to a WHATWG standard or software project
Development

No branches or pull requests

5 participants