From f25a54ead56240d65e71bd420bfbf80b21ca18c3 Mon Sep 17 00:00:00 2001 From: Sebastian Zartner Date: Wed, 12 Feb 2014 15:25:37 +0100 Subject: [PATCH] Issue 7179 (HTML search is broken in Aurora 29.0a2) http://code.google.com/p/fbug/issues/detail?id=7179 --- extension/content/firebug/html/htmlLib.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/extension/content/firebug/html/htmlLib.js b/extension/content/firebug/html/htmlLib.js index 091e4ee8fa..ca871e6d20 100644 --- a/extension/content/firebug/html/htmlLib.js +++ b/extension/content/firebug/html/htmlLib.js @@ -64,7 +64,7 @@ var HTMLLib = ++matchCount; var node = match.node; - var nodeBox = this.openToNode(node, match.isValue); + var nodeBox = this.openToNode(node, match.isValue, match.ownerElement); this.selectMatched(nodeBox, node, match, reverse); } @@ -111,14 +111,23 @@ var HTMLLib = function walkNode() { return reverse ? walker.previousNode() : walker.nextNode(); } var node; + var ownerElement; while (node = walkNode()) { - if (node.nodeType == Node.TEXT_NODE && HTMLLib.isSourceElement(node.parentNode)) + if (node.nodeType === Node.TEXT_NODE && HTMLLib.isSourceElement(node.parentNode)) continue; + if (node.nodeType === Node.ELEMENT_NODE) + ownerElement = node; + var m = this.checkNode(node, reverse, caseSensitive); if (m) + { + if (node.nodeType === Node.ATTRIBUTE_NODE) + m.ownerElement = ownerElement; + return m; + } } }; @@ -190,7 +199,7 @@ var HTMLLib = * * @private */ - this.openToNode = function(node, isValue) + this.openToNode = function(node, isValue, ownerElement) { if (node.nodeType == Node.ELEMENT_NODE) { @@ -199,7 +208,7 @@ var HTMLLib = } else if (node.nodeType == Node.ATTRIBUTE_NODE) { - var nodeBox = ioBox.openToObject(node.ownerElement); + var nodeBox = ioBox.openToObject(ownerElement); if (nodeBox) { var attrNodeBox = HTMLLib.findNodeAttrBox(nodeBox, node.name);