| 02:54 | <KiChjang> | what's the relationship between a browsing context and a window? |
| 02:56 | <Domenic> | KiChjang: depends on what you mean by a window |
| 02:56 | <KiChjang> | Domenic, i mean it by the HTML spec's definition of a window |
| 02:56 | <KiChjang> | https://html.spec.whatwg.org/multipage/browsers.html#window |
| 02:56 | <Domenic> | KiChjang: you mean the Window class? |
| 02:56 | <KiChjang> | yes |
| 02:56 | <KiChjang> | well, the window object |
| 02:57 | <Domenic> | OK, so not the thing that has many tabs on a computer |
| 02:57 | <Domenic> | A browsing context has many windows |
| 02:57 | <Domenic> | it navigates from one to the next |
| 02:57 | <Domenic> | its WindowProxy proxies to a different Window upon each navigation |
| 02:58 | <KiChjang> | can there be a browsing context without a window? |
| 02:58 | <Domenic> | I think so, if you e.g. remove an iframe |
| 02:58 | <KiChjang> | and vice versa? |
| 02:58 | <Domenic> | i have to remember what happens when you remove an iframe... |
| 02:59 | <KiChjang> | well, let's not complicate things by considering iframes first |
| 02:59 | <KiChjang> | let's just consider the normal case where you only have tabs or windows |
| 02:59 | <Domenic> | OK, without iframes then all browsing contexts will have at least one Window and all Windows will belong to a browsing context |
| 03:00 | <KiChjang> | and i assume a browsing context has its own unique document as well? |
| 03:00 | <Domenic> | It's not quite that simple... |
| 03:00 | <Domenic> | Each browsing context has an active document |
| 03:01 | <Domenic> | but there can be up to two documents per Window (due to about:blank) and many Windows per document (due to document.open()) |
| 03:03 | <KiChjang> | what does it mean when a document is inactive? |
| 03:03 | <KiChjang> | as in, it's not being displayed? |
| 03:05 | <Domenic> | Basically, yes. |
| 03:06 | <KiChjang> | but there's no active window... |
| 03:08 | <KiChjang> | basically, i'm trying to determine that whether i can trust that there's going to be a browsing context, if i'm given a window |
| 03:08 | <KiChjang> | looks like the answer is yes |
| 03:08 | <KiChjang> | since all windows belong to a browsing context |
| 03:09 | <KiChjang> | but is it the same as the browsing context that a particular element's owner document's browsing context? |
| 03:09 | <KiChjang> | s/that/of/ |
| 03:10 | <KiChjang> | no wait |
| 03:10 | <KiChjang> | is it the same as the browsing context that a particular element's owner document contains? |
| 03:43 | <Domenic> | Not necessarily, e.g. for document.implementation.createDocument() |
| 03:43 | <Domenic> | (and elements from there) |
| 03:43 | <Domenic> | Those documents do not have a browsing context |
| 03:44 | <Domenic> | Same for template contents |
| 03:46 | <Domenic> | And I think the bc can go away even if the Window is still around, given detached iframes. (If JS captures the window value) |