Skip to content

Commit

Permalink
Bug 1730167 - [devtools] Replace usage of isRemoteFrame with isFrameW…
Browse files Browse the repository at this point in the history
…ithChildTarget. 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
  • Loading branch information
nchevobbe committed Oct 1, 2021
1 parent a78829e commit 4d15b11
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions devtools/server/actors/accessibility/walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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
)
);
},

Expand Down
7 changes: 5 additions & 2 deletions devtools/server/actors/highlighters/tabbing-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader.lazyRequireGetter(
);
loader.lazyRequireGetter(
this,
["isRemoteFrame", "isWindowIncluded"],
["isFrameWithChildTarget", "isWindowIncluded"],
"devtools/shared/layout/utils",
true
);
Expand Down Expand Up @@ -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];
}
Expand Down
4 changes: 2 additions & 2 deletions devtools/server/actors/inspector/walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ loader.lazyRequireGetter(
"isDirectShadowHostChild",
"isMarkerPseudoElement",
"isNativeAnonymous",
"isRemoteFrame",
"isFrameWithChildTarget",
"isShadowHost",
"isShadowRoot",
"isTemplateElement",
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 4d15b11

Please sign in to comment.