From 4d15b11e27ce5a29b5b6124289bfdebab83564eb Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 1 Oct 2021 16:24:50 +0000 Subject: [PATCH] Bug 1730167 - [devtools] Replace usage of isRemoteFrame with isFrameWithChildTarget. r=ochameau. `isRemoteFrame` was used as a way to know if an iframe was tracked by its own target. Since we can now have dedicated targets for every iframe, we need to check if a given iframe is tracked by its dedicated target. Differential Revision: https://phabricator.services.mozilla.com/D126805 --- devtools/server/actors/accessibility/walker.js | 7 +++++-- devtools/server/actors/highlighters/tabbing-order.js | 7 +++++-- devtools/server/actors/inspector/walker.js | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/devtools/server/actors/accessibility/walker.js b/devtools/server/actors/accessibility/walker.js index 03b0f46c05abd..8991b6fefe7ff 100644 --- a/devtools/server/actors/accessibility/walker.js +++ b/devtools/server/actors/accessibility/walker.js @@ -32,7 +32,7 @@ loader.lazyRequireGetter( loader.lazyRequireGetter(this, "events", "devtools/shared/event-emitter"); loader.lazyRequireGetter( this, - ["getCurrentZoom", "isWindowIncluded", "isRemoteFrame"], + ["getCurrentZoom", "isWindowIncluded", "isFrameWithChildTarget"], "devtools/shared/layout/utils", true ); @@ -880,7 +880,10 @@ const AccessibleWalkerActor = ActorClassWithSpec(accessibleWalkerSpec, { // remote frame target should emit RDP events (hovered/picked/...). And // all other WalkerActor for intermediate iframe and top level document // targets should stay silent. - isRemoteFrame(event.originalTarget || event.target) + isFrameWithChildTarget( + this.targetActor, + event.originalTarget || event.target + ) ); }, diff --git a/devtools/server/actors/highlighters/tabbing-order.js b/devtools/server/actors/highlighters/tabbing-order.js index 891325f6694a2..29eeb7450c77c 100644 --- a/devtools/server/actors/highlighters/tabbing-order.js +++ b/devtools/server/actors/highlighters/tabbing-order.js @@ -13,7 +13,7 @@ loader.lazyRequireGetter( ); loader.lazyRequireGetter( this, - ["isRemoteFrame", "isWindowIncluded"], + ["isFrameWithChildTarget", "isWindowIncluded"], "devtools/shared/layout/utils", true ); @@ -118,7 +118,10 @@ class TabbingOrderHighlighter { if ( !endElm && focusableElements.length > 0 && - isRemoteFrame(focusableElements[focusableElements.length - 1]) + isFrameWithChildTarget( + this.highlighterEnv.targetActor, + focusableElements[focusableElements.length - 1] + ) ) { endElm = focusableElements[focusableElements.length - 1]; } diff --git a/devtools/server/actors/inspector/walker.js b/devtools/server/actors/inspector/walker.js index 3edce820409ef..371cc12822a0f 100644 --- a/devtools/server/actors/inspector/walker.js +++ b/devtools/server/actors/inspector/walker.js @@ -25,7 +25,7 @@ loader.lazyRequireGetter( "isDirectShadowHostChild", "isMarkerPseudoElement", "isNativeAnonymous", - "isRemoteFrame", + "isFrameWithChildTarget", "isShadowHost", "isShadowRoot", "isTemplateElement", @@ -725,7 +725,7 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, { isShadowHost(rawNode) || rawNode.nodeType != Node.ELEMENT_NODE || rawNode.children.length > 0 || - isRemoteFrame(rawNode) + isFrameWithChildTarget(this.targetActor, rawNode) ) { return undefined; }