@@ -60,25 +60,22 @@ this.inspectedNode = class extends ExtensionAPI {
6060 await inspector . pageStyle . getApplied ( node , option ) ;
6161
6262 return styles . map ( ( { rule } ) => {
63- const { actorID : ruleId } = rule ;
6463 let { declarations } = rule ;
6564 declarations = declarations . filter ( d => ! d . commentOffsets ) ;
66- return declarations . length
67- ? { ruleId, declarations, node : _getNodeInfo ( node ) }
68- : null ;
69- } ) . filter ( rule => ! ! rule ) ;
65+ return declarations . length ? declarations : null ;
66+ } ) . filter ( declarations => ! ! declarations ) ;
7067 } ;
7168
72- const _getStyle = async ( clientId ) => {
69+ const _getStyle = async ( clientId , actorID , skipPseudo ) => {
7370 await _setupClientIfNeeded ( clientId ) ;
7471
7572 const { inspector } = _clients . get ( clientId ) ;
7673 if ( ! inspector . selection . isConnected ( ) ) {
7774 return [ ] ;
7875 }
7976
80- const node = inspector . selection . nodeFront ;
81- return _getAppliedStyle ( inspector , node , { skipPseudo : true } ) ;
77+ const node = await inspector . walker . conn . getFrontByID ( actorID ) ;
78+ return _getAppliedStyle ( inspector , node , { skipPseudo } ) ;
8279 } ;
8380
8481 const _getStylesInSubtree = async ( clientId ) => {
@@ -98,6 +95,7 @@ this.inspectedNode = class extends ExtensionAPI {
9895
9996 const _getNodeInfo = node => {
10097 const {
98+ actorID,
10199 id,
102100 className,
103101 attributes,
@@ -107,6 +105,7 @@ this.inspectedNode = class extends ExtensionAPI {
107105 } = node ;
108106
109107 return {
108+ actorID,
110109 id,
111110 className : className . trim ( ) ,
112111 attributes,
@@ -163,8 +162,8 @@ this.inspectedNode = class extends ExtensionAPI {
163162 return _getNodesInSubtree ( clientId ) ;
164163 } ,
165164
166- async getStyle ( clientId ) {
167- return _getStyle ( clientId ) ;
165+ async getStyle ( clientId , actorID , skipPseudo ) {
166+ return _getStyle ( clientId , actorID , skipPseudo ) ;
168167 } ,
169168
170169 async getStylesInSubtree ( clientId ) {
0 commit comments