This repository was archived by the owner on Jul 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
extension/experiments/inspectedNode Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,30 +51,8 @@ this.inspectedNode = class extends ExtensionAPI {
5151 } ;
5252
5353 const _getSubtreeNodes = async ( node ) => {
54- if ( ! node . hasChildren ) {
55- return [ ] ;
56- }
57-
58- const nodes = [ ] ;
59-
60- // At first, get the children cache in nodeFront.
61- let children = await node . treeChildren ( ) ;
62-
63- if ( children . length === 0 ) {
64- // Otherwise, get via the walker.
65- await node . walkerFront . children ( node ) ;
66- children = await node . treeChildren ( ) ;
67- }
68-
69- // We see element type only
70- children = children . filter ( node => node . nodeType === ELEMENT_NODE ) ;
71-
72- for ( const child of children ) {
73- nodes . push ( child ) ;
74- nodes . push ( ...( await _getSubtreeNodes ( child ) ) ) ;
75- }
76-
77- return nodes ;
54+ const result = await node . walkerFront . querySelectorAll ( node , "*" ) ;
55+ return await result . items ( ) ;
7856 }
7957
8058 const _getAppliedStyle = async ( inspector , node , option ) => {
You can’t perform that action at this time.
0 commit comments