зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1590050
- Walker findNodeFront should use selectors relevant to its rootNode r=rcaliman
Depends on D49939 Small fix on the findNodeFront helper. The walker should be able to calculate its depth without relying on consumers to remove selectors from the array passed to findNodeFront. Differential Revision: https://phabricator.services.mozilla.com/D49940 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
00444e4c1d
Коммит
ffb4c71377
|
@ -729,10 +729,6 @@ DevTools.prototype = {
|
|||
);
|
||||
const inspector = toolbox.getCurrentPanel();
|
||||
|
||||
// If the toolbox has been switched into a nested frame, we should first remove
|
||||
// selectors according to the frame depth.
|
||||
nodeSelectors.splice(0, toolbox.selectedFrameDepth);
|
||||
|
||||
// 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");
|
||||
|
|
|
@ -507,6 +507,15 @@ class WalkerFront extends FrontClassWithSpec(walkerSpec) {
|
|||
return querySelectors(nodeFront);
|
||||
};
|
||||
const nodeFront = await this.getRootNode();
|
||||
|
||||
// Check the "depth" of the walker.
|
||||
// The `nodeSelectors` array starts from the topmost document, if the walker
|
||||
// is targetting a nested iframe, the selectors needed to reach this iframe
|
||||
// need to be excluded from the query.
|
||||
const rootFrontSelectors = await nodeFront.getAllSelectors();
|
||||
const walkerDepth = rootFrontSelectors.length - 1;
|
||||
nodeSelectors.splice(0, walkerDepth);
|
||||
|
||||
return querySelectors(nodeFront);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче