Bug 1320095 Implement forwarder for onFindbarOpen() and other missing methods in the tabbrowser findbar object. r=IanN a=Ratty
Also update SeaMonkey's findbar.xml to sync with the toolkit findbar.xmlBug1320095onFindbarOpen.
Unified branch patch for SeaMonkey 2.48 and 2.49.
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -2778,45 +2778,69 @@
return this.finder.clipboardSearchString;
},
set clipboardSearchString(val) {
return this.finder.clipboardSearchString = val;
},
set caseSensitive(val) {
return this.finder.caseSensitive = val;
},
+ set entireWord(val) {
+ return this.finder.entireWord = val;
+ },
+ get highlighter() {
+ return this.finder.highlighter;
+ },
+ get matchesCountLimit() {
+ return this.finder.matchesCountLimit;
+ },
fastFind: function(aSearchString, aLinksOnly, aDrawOutline) {
this.finder.fastFind(aSearchString, aLinksOnly, aDrawOutline);
},
findAgain: function(aFindBackwards, aLinksOnly, aDrawOutline) {
this.finder.findAgain(aFindBackwards, aLinksOnly, aDrawOutline);
},
setSearchStringToSelection: function() {
return this.finder.setSearchStringToSelection();
},
- highlight: function(aHighlight, aWord) {
- this.finder.highlight(aHighlight, aWord);
+ highlight: function(...args) {
+ this.finder.highlight(...args);
},
getInitialSelection: function() {
this.finder.getInitialSelection();
},
+ getActiveSelectionText: function() {
+ return this.finder.getActiveSelectionText();
+ },
enableSelection: function() {
this.finder.enableSelection();
},
removeSelection: function() {
this.finder.removeSelection();
},
focusContent: function() {
this.finder.focusContent();
},
+ onFindbarClose: function() {
+ this.finder.onFindbarClose();
+ },
+ onFindbarOpen: function() {
+ this.finder.onFindbarOpen();
+ },
+ onModalHighlightChange: function(...args) {
+ return this.finder.onModalHighlightChange(...args);
+ },
+ onHighlightAllChange: function(...args) {
+ return this.finder.onHighlightAllChange(...args);
+ },
keyPress: function(aEvent) {
this.finder.keyPress(aEvent);
},
- requestMatchesCount: function(aWord, aMatchLimit, aLinksOnly) {
- this.finder.requestMatchesCount(aWord, aMatchLimit, aLinksOnly);
+ requestMatchesCount: function(...args) {
+ this.finder.requestMatchesCount(...args);
}
})
]]></field>
<property name="docShell"
onget="return this.mCurrentBrowser.docShell"
readonly="true"/>
--- a/suite/common/bindings/findbar.xml
+++ b/suite/common/bindings/findbar.xml
@@ -87,20 +87,27 @@
var prefsvc =
Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefsvc.removeObserver("accessibility.typeaheadfind.linksonly",
this._observer);
prefsvc.removeObserver("accessibility.typeaheadfind.casesensitive",
this._observer);
+ prefsvc.removeObserver("findbar.entireword", this._observer);
+ prefsvc.removeObserver("findbar.highlightAll", this._observer);
+ prefsvc.removeObserver("findbar.modalHighlight", this._observer);
+
prefsvc.removeObserver("accessibility.typeaheadfind.usefindbar",
this._suiteObserver);
prefsvc.removeObserver("accessibility.typeaheadfind.autostart",
this._suiteObserver);
+
+ // Clear all timers that might still be running.
+ this._cancelTimers();
]]></body>
</method>
<method name="_updateBrowserWithState">
<body><![CDATA[
window.messageManager.broadcastAsyncMessage("Findbar:UpdateState", {
findMode: this._findMode,
findAsYouType: this._findAsYouType,
@@ -114,20 +121,21 @@
switch (aMessage.name) {
case "Findbar:Mouseup":
if (!this.hidden && this._findMode != this.FIND_NORMAL)
this.close();
break;
case "Findbar:Keypress":
if (this._useFindbar)
- return this._onBrowserKeypress(aMessage.data);
+ return this._onBrowserKeypress(aMessage.data.fakeEvent,
+ aMessage.data.shouldFastFind);
break;
}
- return true;
+ return undefined;
]]></body>
</method>
<method name="startFastFind">
<parameter name="aMode"/>
<body><![CDATA[
if (this._findMode == aMode && this._quickFindTimeout) {
this._findField.select();