From a2f048c32a54c0cf0f1629e81150cc79ce870855 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 28 Sep 2007 13:20:48 +0000 Subject: [PATCH] apply 'hlsearchstyle' to frame documents --- chrome/content/vimperator/find.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/chrome/content/vimperator/find.js b/chrome/content/vimperator/find.js index 57824215..eeed6073 100644 --- a/chrome/content/vimperator/find.js +++ b/chrome/content/vimperator/find.js @@ -235,17 +235,22 @@ function Search() //{{{ if (!text) text = last_search_string; - // NOTE: setCaseSensitivity() in FF2 does NOT set the + // NOTE: gFindBar.setCaseSensitivity() in FF2 does NOT set the // accessibility.typeaheadfind.casesensitive pref as needed by // highlightDoc() gFindBar.mTypeAheadCaseSensitive = case_sensitive ? 1 : 0; gFindBar.highlightDoc("white", "black", text); - // TODO: seems fast enough for now - // NOTE: FF2 highlighting spans all have this id rather than a class attribute - var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]') - for (var i = 0; i < spans.snapshotLength; i++) - spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]); + // TODO: seems fast enough for now...just + // NOTE: FF2 highlighting spans all have the same id rather than a class attribute + (function(win) + { + for (var i = 0; i < win.frames.length; i++) + arguments.callee(win.frames[i]) + var spans = vimperator.buffer.evaluateXPath('//span[@id="__firefox-findbar-search-id"]', win.document) + for (var i = 0; i < spans.snapshotLength; i++) + spans.snapshotItem(i).setAttribute("style", vimperator.options["hlsearchstyle"]); + })(window.content); // recreate selection since _highlightDoc collapses the selection backwards getBrowser().fastFind.findNext();