From a54567d9ba60c0d17870f26f506baec95a76b8bb Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Wed, 24 Aug 2005 19:19:06 +0000 Subject: [PATCH] Bug 256990: highlight breaks pages that style elements, patch by Ben Basson , r=mconnor --- toolkit/components/typeaheadfind/content/findBar.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/toolkit/components/typeaheadfind/content/findBar.js b/toolkit/components/typeaheadfind/content/findBar.js index abd24e4cbab8..6af95052ae2a 100755 --- a/toolkit/components/typeaheadfind/content/findBar.js +++ b/toolkit/components/typeaheadfind/content/findBar.js @@ -22,6 +22,7 @@ # Contributor(s): # Blake Ross (Original Author) # Masayuki Nakano +# Ben Basson # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -199,6 +200,7 @@ function highlightDoc(highBackColor, highTextColor, word, win) parent.removeChild(elem); parent.insertBefore(docfrag, next); + parent.normalize(); } else { // Somehow we didn't highlight this instance; just skip it. @@ -212,7 +214,8 @@ function highlightDoc(highBackColor, highTextColor, word, win) } var baseNode = doc.createElement("span"); - baseNode.setAttribute("style", "background-color: " + highBackColor + "; color: " + highTextColor + ";"); + baseNode.setAttribute("style", "background-color: " + highBackColor + "; color: " + highTextColor + ";" + + "display: inline; font-size: inherit; padding: 0;"); baseNode.setAttribute("id", "__firefox-findbar-search-id"); highlightText(word, baseNode);