From 9900def526ab287c4ce4f6ab39ec97a375c50cb3 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 9 Sep 2018 08:23:21 +0200 Subject: Revert "Add tabbrowser findbar styling for Linux and OSX" This reverts commit e4b01ba84463fbaf5209ae8d2bb6a612f491bb5b. --- application/palemoon/themes/linux/browser.css | 6 ------ application/palemoon/themes/osx/browser.css | 6 ------ 2 files changed, 12 deletions(-) (limited to 'application') diff --git a/application/palemoon/themes/linux/browser.css b/application/palemoon/themes/linux/browser.css index 987406264..c6587babc 100644 --- a/application/palemoon/themes/linux/browser.css +++ b/application/palemoon/themes/linux/browser.css @@ -1570,12 +1570,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- background-color: Window; } -.browserContainer > findbar { - background-color: -moz-dialog; - color: -moz-DialogText; - text-shadow: none; -} - /* Throbber */ #navigator-throbber { width: 16px; diff --git a/application/palemoon/themes/osx/browser.css b/application/palemoon/themes/osx/browser.css index 97073b161..a915af3a3 100644 --- a/application/palemoon/themes/osx/browser.css +++ b/application/palemoon/themes/osx/browser.css @@ -1601,12 +1601,6 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url- -moz-padding-start: 0px; } -.browserContainer > findbar { - background-color: -moz-dialog; - color: -moz-DialogText; - text-shadow: none; -} - /* ::::: throbber ::::: */ #navigator-throbber { -- cgit v1.2.3 From d9f762df868eff02b1afe663a72938c96d0f6597 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 9 Sep 2018 08:23:45 +0200 Subject: Revert "Add tabbrowser findbar styling" This reverts commit c96d9e5bdd064252c2b6d303c1db9209bf4814c9. --- application/palemoon/themes/windows/browser.css | 6 ------ 1 file changed, 6 deletions(-) (limited to 'application') diff --git a/application/palemoon/themes/windows/browser.css b/application/palemoon/themes/windows/browser.css index 1aefa428c..45f0e066c 100644 --- a/application/palemoon/themes/windows/browser.css +++ b/application/palemoon/themes/windows/browser.css @@ -1788,12 +1788,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- -moz-padding-start: 0px; } -.browserContainer > findbar { - background-color: -moz-dialog; - color: -moz-DialogText; - text-shadow: none; -} - /* ::::: throbber ::::: */ #navigator-throbber { -- cgit v1.2.3 From 95835c0acc5856aa56574a612549e2fb40260984 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 9 Sep 2018 08:24:37 +0200 Subject: Revert "[PALEMOON] Findbar - added the listener also to tabbrowser.xml, remove "_fastFind", a better focus() for the method "updateCurrentBrowser"" This reverts commit 63b10a9b4f8644550a89022b8d0d53ee26fc150b. --- application/palemoon/base/content/tabbrowser.xml | 70 ++++++++---------------- 1 file changed, 23 insertions(+), 47 deletions(-) (limited to 'application') diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index d5735149e..e99b813c9 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -1104,11 +1104,9 @@ this.mCurrentTab.removeAttribute("unread"); this.selectedTab.lastAccessed = Date.now(); - let oldFindBar = oldTab._findBar; - if (oldFindBar && - oldFindBar.findMode == oldFindBar.FIND_NORMAL && - !oldFindBar.hidden) - this._lastFindValue = oldFindBar._findField.value; + // Bug 666816 - TypeAheadFind support for e10s + if (!gMultiProcessBrowser) + this._fastFind.setDocShell(this.mCurrentBrowser.docShell); this.updateTitlebar(); @@ -1159,11 +1157,6 @@ // Adjust focus oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused); - if (this.isFindBarInitialized(oldTab)) { - let findBar = this.getFindBar(oldTab); - oldTab._findBarFocused = (!findBar.hidden && - findBar._findField.getAttribute("focused") == "true"); - } do { // When focus is in the tab bar, retain it there. if (document.activeElement == oldTab) { @@ -1199,12 +1192,11 @@ } } - // Focus the find bar if it was previously focused for that tab. - if (gFindBarInitialized && !gFindBar.hidden && - this.selectedTab._findBarFocused) { - gFindBar._findField.focus(); + // If the find bar is focused, keep it focused. + if (gFindBarInitialized && + !gFindBar.hidden && + gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true") break; - } // Otherwise, focus the content area. let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager); @@ -1622,6 +1614,7 @@ this.mTabListeners[position] = tabListener; this.mTabFilters[position] = filter; + b._fastFind = this.fastFind; b.droppedLinkHandler = handleDroppedLink; // If we just created a new tab that loads the default @@ -2873,6 +2866,21 @@ onget="return this.mCurrentBrowser.currentURI;" readonly="true"/> + null + + + + + + null false @@ -3176,28 +3184,6 @@ window.focus(); 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; } ]]> @@ -3264,11 +3250,6 @@ this.mCurrentBrowser); } 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); ]]> @@ -3523,7 +3504,6 @@ tab.setAttribute("onerror", "this.removeAttribute('image');"); this.adjustTabstrip(); - Services.prefs.addObserver("accessibility.typeaheadfind", this._prefObserver, false); Services.prefs.addObserver("browser.tabs.", this._prefObserver, false); window.addEventListener("resize", this, false); window.addEventListener("load", this, false); @@ -3539,7 +3519,6 @@ @@ -3605,9 +3584,6 @@ observe: function (subject, topic, data) { switch (data) { - case "accessibility.typeaheadfind": - this._findAsYouType = Services.prefs.getBoolPref(data); - break; case "browser.tabs.closeButtons": this.tabContainer.mCloseButtons = Services.prefs.getIntPref(data); this.tabContainer.adjustTabstrip(); -- cgit v1.2.3 From aa9cd0d77dcdfc9daddc4f8b78d4578d2507018d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 9 Sep 2018 08:25:50 +0200 Subject: Revert "Transfer findbar data to torn-off tabs." This reverts commit 333142b5af61c3fd67ad4e79467c03efb3641b20. --- application/palemoon/base/content/tabbrowser.xml | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'application') diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index e99b813c9..c14014003 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -2303,17 +2303,6 @@ this._swapBrowserDocShells(aOurTab, otherBrowser); } - // Handle findbar data (if any) - let otherFindBar = aOtherTab._findBar; - if (otherFindBar && - otherFindBar.findMode == otherFindBar.FIND_NORMAL) { - let ourFindBar = this.getFindBar(aOurTab); - ourFindBar._findField.value = otherFindBar._findField.value; - if (!otherFindBar.hidden) { - ourFindBar.onFindCommand(); - } - } - // Finish tearing down the tab that's going away. remoteBrowser._endRemoveTab(aOtherTab); -- cgit v1.2.3 From 1c455d9cb002b15e28c7e12883a57f020433ce5d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 9 Sep 2018 08:26:13 +0200 Subject: Revert "Minimal easy fix -- move findbar getters to tabbrowser." This reverts commit fb291846a59f9b8eaf8bba29e0d9794893e895bf. --- application/palemoon/base/content/browser.js | 21 ++++++++---- application/palemoon/base/content/tabbrowser.xml | 41 ------------------------ 2 files changed, 14 insertions(+), 48 deletions(-) (limited to 'application') diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index c7a2633d4..5cf43850a 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -53,13 +53,20 @@ var gEditUIVisible = true; // Smart getter for the findbar. If you don't wish to force the creation of // the findbar, check gFindBarInitialized first. - -this.__defineGetter__("gFindBar", function() { - return window.gBrowser.getFindBar(); -}); - -this.__defineGetter__("gFindBarInitialized", function() { - return window.gBrowser.isFindBarInitialized(); +var gFindBarInitialized = false; +XPCOMUtils.defineLazyGetter(window, "gFindBar", function() { + let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + let findbar = document.createElementNS(XULNS, "findbar"); + findbar.id = "FindToolbar"; + + let browserBottomBox = document.getElementById("browser-bottombox"); + browserBottomBox.insertBefore(findbar, browserBottomBox.firstChild); + + // Force a style flush to ensure that our binding is attached. + findbar.clientTop; + findbar.browser = gBrowser.mCurrentBrowser; + window.gFindBarInitialized = true; + return findbar; }); XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index c14014003..0390d165c 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -128,10 +128,6 @@ false - - "" - - - - - - - - - - - - Date: Sun, 9 Sep 2018 10:26:49 +0200 Subject: Ensure the findbar target content browser follows the active tab. --- application/palemoon/base/content/tabbrowser.xml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'application') diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 0390d165c..3de1c6be2 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -1041,6 +1041,11 @@ // Bug 666809 - SecurityUI support for e10s var webProgress = this.mCurrentBrowser.webProgress; var securityUI = this.mCurrentBrowser.securityUI; + + // Update global findbar with new content browser + if (gFindBarInitialized) { + gFindBar.browser = newBrowser; + } this._callProgressListeners(null, "onLocationChange", [webProgress, null, loc, 0], true, -- cgit v1.2.3