Closed Bug 2025710 Opened 6 months ago Closed 5 months ago

Consider migrating from node.ownerGlobal to node.ownerDocGlobal

Categories

(Remote Protocol :: Agent, task, P3)

task

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: jdescottes, Unassigned, Mentored)

References

Details

(Whiteboard: [webdriver:backlog][lang=js])

After Bug 1470017 lands, the ownerGlobal property will no longer have the same value when a node is reparented to another document.

Before bug 1470017, node.ownerGlobal always points to the "live" global where the node lives, which means we always have node.ownerDocument.defaultView === node.ownerGlobal. But after this bug, if a node is moved from one document to another, the ownerGlobal property will still point to the original global.

In most cases we probably want the live "global", I don't think we have cases in remote where we need the original global. A new property was introduced: node.ownerDocGlobal, which is equal to (node.ownerDocument || node).ownerGlobal. The node.ownerDocument || node bit is here in order to handle document which doesn't have an ownerDocument.

We should probably replace all call sites for node.ownerGlobal with node.ownerDocGlobal

Mentor: jdescottes
Priority: -- → P3
Whiteboard: [webdriver:backlog][lang=js]

Note: we should wait until Bug 1470017 is resolved before taking this one

Bug 1470017 will address this directly.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.