Bug 1465873 - part2: Update walker::children() to avoid updating refMap to detect pseudo elements;r=bgrins draft
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 27 Jun 2018 13:52:21 +0200
changeset 814183 6d591fb5c90e81a1aad2c5bef278765e2ca8cae8
parent 814182 2f5ad39436b98a833997851d98c950a817197f97
child 814184 892bbcc01923bdbf4819a0155d7f7fb7653557d1
push id115123
push userjdescottes@mozilla.com
push dateWed, 04 Jul 2018 17:42:29 +0000
reviewersbgrins
bugs1465873
milestone63.0a1
Bug 1465873 - part2: Update walker::children() to avoid updating refMap to detect pseudo elements;r=bgrins MozReview-Commit-ID: DId4pM2rGmb
devtools/server/actors/inspector/walker.js
--- a/devtools/server/actors/inspector/walker.js
+++ b/devtools/server/actors/inspector/walker.js
@@ -764,21 +764,21 @@ var WalkerActor = protocol.ActorClassWit
       // no direct children.
       hasFirst = hasLast = true;
     }
 
     if (isShadowHost) {
       // Use anonymous walkers to fetch ::before / ::after pseudo elements
       const firstChildWalker = this.getDocumentWalker(node.rawNode);
       const first = firstChildWalker.firstChild();
-      const hasBefore = first && this._ref(first).isBeforePseudoElement;
+      const hasBefore = first && first.nodeName === "_moz_generated_content_before";
 
       const lastChildWalker = this.getDocumentWalker(node.rawNode);
       const last = lastChildWalker.lastChild();
-      const hasAfter = last && this._ref(last).isAfterPseudoElement;
+      const hasAfter = last && last.nodeName === "_moz_generated_content_after";
 
       nodes = [
         // #shadow-root
         node.rawNode.openOrClosedShadowRoot,
         // ::before
         ...(hasBefore ? [first] : []),
         // shadow host direct children
         ...nodes,