mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Revert "[PALEMOON] Findbar - added the listener also to tabbrowser.xml, remove "_fastFind", a better focus() for the method "updateCurrentBrowser""
This reverts commit 63b10a9b4f8644550a89022b8d0d53ee26fc150b.
This commit is contained in:
parent
e044dab0bb
commit
79cddc2b9c
1 changed files with 23 additions and 47 deletions
|
|
@ -1104,11 +1104,9 @@
|
||||||
this.mCurrentTab.removeAttribute("unread");
|
this.mCurrentTab.removeAttribute("unread");
|
||||||
this.selectedTab.lastAccessed = Date.now();
|
this.selectedTab.lastAccessed = Date.now();
|
||||||
|
|
||||||
let oldFindBar = oldTab._findBar;
|
// Bug 666816 - TypeAheadFind support for e10s
|
||||||
if (oldFindBar &&
|
if (!gMultiProcessBrowser)
|
||||||
oldFindBar.findMode == oldFindBar.FIND_NORMAL &&
|
this._fastFind.setDocShell(this.mCurrentBrowser.docShell);
|
||||||
!oldFindBar.hidden)
|
|
||||||
this._lastFindValue = oldFindBar._findField.value;
|
|
||||||
|
|
||||||
this.updateTitlebar();
|
this.updateTitlebar();
|
||||||
|
|
||||||
|
|
@ -1159,11 +1157,6 @@
|
||||||
|
|
||||||
// Adjust focus
|
// Adjust focus
|
||||||
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
|
oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused);
|
||||||
if (this.isFindBarInitialized(oldTab)) {
|
|
||||||
let findBar = this.getFindBar(oldTab);
|
|
||||||
oldTab._findBarFocused = (!findBar.hidden &&
|
|
||||||
findBar._findField.getAttribute("focused") == "true");
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
// When focus is in the tab bar, retain it there.
|
// When focus is in the tab bar, retain it there.
|
||||||
if (document.activeElement == oldTab) {
|
if (document.activeElement == oldTab) {
|
||||||
|
|
@ -1199,12 +1192,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Focus the find bar if it was previously focused for that tab.
|
// If the find bar is focused, keep it focused.
|
||||||
if (gFindBarInitialized && !gFindBar.hidden &&
|
if (gFindBarInitialized &&
|
||||||
this.selectedTab._findBarFocused) {
|
!gFindBar.hidden &&
|
||||||
gFindBar._findField.focus();
|
gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true")
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise, focus the content area.
|
// Otherwise, focus the content area.
|
||||||
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||||
|
|
@ -1622,6 +1614,7 @@
|
||||||
this.mTabListeners[position] = tabListener;
|
this.mTabListeners[position] = tabListener;
|
||||||
this.mTabFilters[position] = filter;
|
this.mTabFilters[position] = filter;
|
||||||
|
|
||||||
|
b._fastFind = this.fastFind;
|
||||||
b.droppedLinkHandler = handleDroppedLink;
|
b.droppedLinkHandler = handleDroppedLink;
|
||||||
|
|
||||||
// If we just created a new tab that loads the default
|
// If we just created a new tab that loads the default
|
||||||
|
|
@ -2873,6 +2866,21 @@
|
||||||
onget="return this.mCurrentBrowser.currentURI;"
|
onget="return this.mCurrentBrowser.currentURI;"
|
||||||
readonly="true"/>
|
readonly="true"/>
|
||||||
|
|
||||||
|
<field name="_fastFind">null</field>
|
||||||
|
<property name="fastFind"
|
||||||
|
readonly="true">
|
||||||
|
<getter>
|
||||||
|
<![CDATA[
|
||||||
|
if (!this._fastFind) {
|
||||||
|
this._fastFind = Components.classes["@mozilla.org/typeaheadfind;1"]
|
||||||
|
.createInstance(Components.interfaces.nsITypeAheadFind);
|
||||||
|
this._fastFind.init(this.docShell);
|
||||||
|
}
|
||||||
|
return this._fastFind;
|
||||||
|
]]>
|
||||||
|
</getter>
|
||||||
|
</property>
|
||||||
|
|
||||||
<field name="_lastSearchString">null</field>
|
<field name="_lastSearchString">null</field>
|
||||||
<field name="_lastSearchHighlight">false</field>
|
<field name="_lastSearchHighlight">false</field>
|
||||||
|
|
||||||
|
|
@ -3176,28 +3184,6 @@
|
||||||
window.focus();
|
window.focus();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Findbar:Keypress":
|
|
||||||
let tab = this.getTabForBrowser(browser);
|
|
||||||
// If the find bar for this tab is not yet alive, only initialize
|
|
||||||
// it if there's a possibility FindAsYouType will be used.
|
|
||||||
// There's no point in doing it for most random keypresses.
|
|
||||||
if (!this.isFindBarInitialized(tab) &&
|
|
||||||
aMessage.data.shouldFastFind) {
|
|
||||||
let shouldFastFind = this._findAsYouType;
|
|
||||||
if (!shouldFastFind) {
|
|
||||||
// Please keep in sync with toolkit/content/widgets/findbar.xml
|
|
||||||
const FAYT_LINKS_KEY = "'";
|
|
||||||
const FAYT_TEXT_KEY = "/";
|
|
||||||
let charCode = aMessage.data.fakeEvent.charCode;
|
|
||||||
let key = charCode ? String.fromCharCode(charCode) : null;
|
|
||||||
shouldFastFind = key == FAYT_LINKS_KEY || key == FAYT_TEXT_KEY;
|
|
||||||
}
|
|
||||||
if (shouldFastFind) {
|
|
||||||
// Make sure we return the result.
|
|
||||||
return this.getFindBar(tab).receiveMessage(aMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
]]></body>
|
]]></body>
|
||||||
</method>
|
</method>
|
||||||
|
|
@ -3264,11 +3250,6 @@
|
||||||
this.mCurrentBrowser);
|
this.mCurrentBrowser);
|
||||||
}
|
}
|
||||||
messageManager.addMessageListener("DOMWebNotificationClicked", this);
|
messageManager.addMessageListener("DOMWebNotificationClicked", this);
|
||||||
|
|
||||||
// To correctly handle keypresses for potential FindAsYouType, while
|
|
||||||
// the tab's find bar is not yet initialized.
|
|
||||||
this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
|
|
||||||
messageManager.addMessageListener("Findbar:Keypress", this);
|
|
||||||
]]>
|
]]>
|
||||||
</constructor>
|
</constructor>
|
||||||
|
|
||||||
|
|
@ -3523,7 +3504,6 @@
|
||||||
tab.setAttribute("onerror", "this.removeAttribute('image');");
|
tab.setAttribute("onerror", "this.removeAttribute('image');");
|
||||||
this.adjustTabstrip();
|
this.adjustTabstrip();
|
||||||
|
|
||||||
Services.prefs.addObserver("accessibility.typeaheadfind", this._prefObserver, false);
|
|
||||||
Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
|
Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
|
||||||
window.addEventListener("resize", this, false);
|
window.addEventListener("resize", this, false);
|
||||||
window.addEventListener("load", this, false);
|
window.addEventListener("load", this, false);
|
||||||
|
|
@ -3539,7 +3519,6 @@
|
||||||
|
|
||||||
<destructor>
|
<destructor>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
Services.prefs.removeObserver("accessibility.typeaheadfind", this._prefObserver);
|
|
||||||
Services.prefs.removeObserver("browser.tabs.", this._prefObserver);
|
Services.prefs.removeObserver("browser.tabs.", this._prefObserver);
|
||||||
]]>
|
]]>
|
||||||
</destructor>
|
</destructor>
|
||||||
|
|
@ -3605,9 +3584,6 @@
|
||||||
|
|
||||||
observe: function (subject, topic, data) {
|
observe: function (subject, topic, data) {
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case "accessibility.typeaheadfind":
|
|
||||||
this._findAsYouType = Services.prefs.getBoolPref(data);
|
|
||||||
break;
|
|
||||||
case "browser.tabs.closeButtons":
|
case "browser.tabs.closeButtons":
|
||||||
this.tabContainer.mCloseButtons = Services.prefs.getIntPref(data);
|
this.tabContainer.mCloseButtons = Services.prefs.getIntPref(data);
|
||||||
this.tabContainer.adjustTabstrip();
|
this.tabContainer.adjustTabstrip();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue