Bug 1539265 - Add ::marker pseudo-element handling to WalkerIndex. r=jdescottes
authorIan Moody <moz-ian@perix.co.uk>
Tue, 02 Apr 2019 07:46:02 +0000
changeset 467545 0b3e62a777486501d1cacc894f3838260ad5d27b
parent 467544 ad3465ab22b662cb6d4541ce465e16859eced1be
child 467546 98af58faaa11f32a300e37f59895f0f3df4b5ed4
push id112633
push usercbrindusan@mozilla.com
push dateTue, 02 Apr 2019 15:52:18 +0000
treeherdermozilla-inbound@a6c6359636f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1539265
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1539265 - Add ::marker pseudo-element handling to WalkerIndex. r=jdescottes So ::marker pseudo elements can be found via searching for "::marker" in the markup view. Differential Revision: https://phabricator.services.mozilla.com/D25109
devtools/server/actors/utils/walker-search.js
--- a/devtools/server/actors/utils/walker-search.js
+++ b/devtools/server/actors/utils/walker-search.js
@@ -88,17 +88,20 @@ WalkerIndex.prototype = {
     const documentWalker = this.walker.getDocumentWalker(this.doc);
     while (documentWalker.nextNode()) {
       const node = documentWalker.currentNode;
 
       if (node.nodeType === 1) {
         // For each element node, we get the tagname and all attributes names
         // and values
         const localName = node.localName;
-        if (localName === "_moz_generated_content_before") {
+        if (localName === "_moz_generated_content_marker") {
+          this._addToIndex("tag", node, "::marker");
+          this._addToIndex("text", node, node.textContent.trim());
+        } else if (localName === "_moz_generated_content_before") {
           this._addToIndex("tag", node, "::before");
           this._addToIndex("text", node, node.textContent.trim());
         } else if (localName === "_moz_generated_content_after") {
           this._addToIndex("tag", node, "::after");
           this._addToIndex("text", node, node.textContent.trim());
         } else {
           this._addToIndex("tag", node, node.localName);
         }