Add a JS helper to check if a document is the current active document of a browsing context
Categories
(Core :: DOM: Core & HTML, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: smaug, Assigned: smaug)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
and BC shouldn't be in bfcache or anything like that
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
What should happen if one plays with document.implementation.createHTMLDocument().body ?
Should that body element be treated as being in an active document/window?
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
This should get tested as part of bug 1692468 and others.
This is exposing https://searchfox.org/mozilla-central/rev/99c3ccc2f02c5fff7c9850f7a0770ee92cc693f6/dom/base/Document.cpp#12730 to privileged JS.
If one wants to check if an element in a data document (document.implementation.createHTMLDocument().body for example) is in a window which is active,
something like element.ownerGlobal?.document.isActive() should work.
Comment 5•2 years ago
|
||
bugherder |
Comment 6•2 years ago
|
||
Assuming I've reverse engineered the context correctly, yes the question is really "is the node's ownerGlobal's current document active". The point is to exclude things in bfcache or that are otherwise unreachable, not to require that the node is connected to the root node of an active document.
Description
•