зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1610562 - take into account multiple browsing contexts when getting a node from content DOM reference. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D60545 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
12e43d2102
Коммит
139344118f
|
@ -730,8 +730,7 @@ DevTools.prototype = {
|
|||
// new-node-front tells us when the node has been selected, whether the
|
||||
// browser is remote or not.
|
||||
const onNewNode = inspector.selection.once("new-node-front");
|
||||
|
||||
const nodeFront = await inspector.walker.getNodeActorFromContentDomReference(
|
||||
const nodeFront = await inspector.inspectorFront.getNodeActorFromContentDomReference(
|
||||
domReference
|
||||
);
|
||||
|
||||
|
@ -771,7 +770,7 @@ DevTools.prototype = {
|
|||
startTime
|
||||
);
|
||||
const inspectorFront = await toolbox.target.getFront("inspector");
|
||||
const nodeFront = await inspectorFront.walker.getNodeActorFromContentDomReference(
|
||||
const nodeFront = await inspectorFront.getNodeActorFromContentDomReference(
|
||||
domReference
|
||||
);
|
||||
// Select the accessible object in the panel and wait for the event that
|
||||
|
|
|
@ -168,22 +168,24 @@ class InspectorFront extends FrontClassWithSpec(inspectorSpec) {
|
|||
return this.walker.gripToNodeFront(grip);
|
||||
}
|
||||
|
||||
const { contentDomReference } = grip;
|
||||
const { browsingContextId } = contentDomReference;
|
||||
return this.getNodeActorFromContentDomReference(grip.contentDomReference);
|
||||
}
|
||||
|
||||
// If the grip lives in the same browsing context id than the current one, we can
|
||||
// directly use the current walker.
|
||||
// TODO: When Bug 1578745 lands, we might want to force using `this.walker` as well
|
||||
// when the new pref is set to false.
|
||||
async getNodeActorFromContentDomReference(contentDomReference) {
|
||||
const { browsingContextId } = contentDomReference;
|
||||
// If the contentDomReference lives in the same browsing context id than the
|
||||
// current one, we can directly use the current walker.
|
||||
// TODO: When Bug 1578745 lands, we might want to force using `this.walker`
|
||||
// as well when the new pref is set to false.
|
||||
if (this.targetFront.browsingContextID === browsingContextId) {
|
||||
return this.walker.getNodeActorFromContentDomReference(
|
||||
contentDomReference
|
||||
);
|
||||
}
|
||||
|
||||
// If the contentDomReference has a different browsing context than the current one,
|
||||
// we are either in Fission or in the Multiprocess Browser Toolbox, so we need to
|
||||
// retrieve the walker of the BrowsingContextTarget.
|
||||
// If the contentDomReference has a different browsing context than the
|
||||
// current one, we are either in Fission or in the Multiprocess Browser
|
||||
// Toolbox, so we need to retrieve the walker of the BrowsingContextTarget.
|
||||
const descriptor = await this.targetFront.client.mainRoot.getBrowsingContextDescriptor(
|
||||
browsingContextId
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче