diff -Nru thunderbird-60.7.2+build2/browser/app/blocklist.xml thunderbird-60.8.0+build1/browser/app/blocklist.xml --- thunderbird-60.7.2+build2/browser/app/blocklist.xml 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/browser/app/blocklist.xml 2019-07-05 08:03:08.000000000 +0000 @@ -1,5 +1,5 @@ - + @@ -2324,10 +2324,6 @@ - - - - @@ -3205,6 +3201,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3240,12 +3304,12 @@ https://get.adobe.com/flashplayer/ - + https://get.adobe.com/flashplayer/ - + diff -Nru thunderbird-60.7.2+build2/browser/app/profile/firefox.js thunderbird-60.8.0+build1/browser/app/profile/firefox.js --- thunderbird-60.7.2+build2/browser/app/profile/firefox.js 2019-06-25 10:31:28.000000000 +0000 +++ thunderbird-60.8.0+build1/browser/app/profile/firefox.js 2019-07-05 08:03:08.000000000 +0000 @@ -1171,10 +1171,6 @@ pref("services.sync.prefs.sync.browser.newtabpage.enabled", true); pref("services.sync.prefs.sync.browser.newtabpage.pinned", true); pref("services.sync.prefs.sync.browser.offline-apps.notify", true); -pref("services.sync.prefs.sync.browser.safebrowsing.phishing.enabled", true); -pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true); -pref("services.sync.prefs.sync.browser.safebrowsing.downloads.enabled", true); -pref("services.sync.prefs.sync.browser.safebrowsing.passwords.enabled", true); pref("services.sync.prefs.sync.browser.search.update", true); pref("services.sync.prefs.sync.browser.sessionstore.restore_on_demand", true); pref("services.sync.prefs.sync.browser.startup.homepage", true); @@ -1194,7 +1190,6 @@ pref("services.sync.prefs.sync.dom.disable_window_flip", true); pref("services.sync.prefs.sync.dom.disable_window_move_resize", true); pref("services.sync.prefs.sync.dom.event.contextmenu.enabled", true); -pref("services.sync.prefs.sync.extensions.personas.current", true); pref("services.sync.prefs.sync.extensions.update.enabled", true); pref("services.sync.prefs.sync.intl.accept_languages", true); pref("services.sync.prefs.sync.layout.spellcheckDefault", true); @@ -1205,8 +1200,6 @@ pref("services.sync.prefs.sync.network.cookie.lifetime.days", true); pref("services.sync.prefs.sync.network.cookie.thirdparty.sessionOnly", true); pref("services.sync.prefs.sync.permissions.default.image", true); -pref("services.sync.prefs.sync.pref.advanced.images.disable_button.view_image", true); -pref("services.sync.prefs.sync.pref.advanced.javascript.disable_button.advanced", true); pref("services.sync.prefs.sync.pref.downloads.disable_button.edit_actions", true); pref("services.sync.prefs.sync.pref.privacy.disable_button.cookie_exceptions", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.cache", true); @@ -1225,15 +1218,16 @@ pref("services.sync.prefs.sync.privacy.reduceTimerPrecision", true); pref("services.sync.prefs.sync.privacy.resistFingerprinting.reduceTimerPrecision.microseconds", true); pref("services.sync.prefs.sync.privacy.resistFingerprinting.reduceTimerPrecision.jitter", true); -pref("services.sync.prefs.sync.security.OCSP.enabled", true); -pref("services.sync.prefs.sync.security.OCSP.require", true); pref("services.sync.prefs.sync.security.default_personal_cert", true); -pref("services.sync.prefs.sync.security.tls.version.min", true); -pref("services.sync.prefs.sync.security.tls.version.max", true); pref("services.sync.prefs.sync.services.sync.syncedTabs.showRemoteIcons", true); pref("services.sync.prefs.sync.signon.rememberSignons", true); pref("services.sync.prefs.sync.spellchecker.dictionary", true); -pref("services.sync.prefs.sync.xpinstall.whitelist.required", true); + +// A preference which, if false, means sync will only apply incoming preference +// changes if there's already a local services.sync.prefs.sync.* control pref. +// If true, all incoming preferences will be applied and the local "control +// pref" updated accordingly. +pref("services.sync.prefs.dangerously_allow_arbitrary", false); // A preference that controls whether we should show the icon for a remote tab. // This pref has no UI but exists because some people may be concerned that diff -Nru thunderbird-60.7.2+build2/browser/config/version_display.txt thunderbird-60.8.0+build1/browser/config/version_display.txt --- thunderbird-60.7.2+build2/browser/config/version_display.txt 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/browser/config/version_display.txt 2019-07-05 08:03:09.000000000 +0000 @@ -1 +1 @@ -60.7.2esr +60.8.0esr diff -Nru thunderbird-60.7.2+build2/browser/config/version.txt thunderbird-60.8.0+build1/browser/config/version.txt --- thunderbird-60.7.2+build2/browser/config/version.txt 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/browser/config/version.txt 2019-07-05 08:03:09.000000000 +0000 @@ -1 +1 @@ -60.7.2 +60.8.0 diff -Nru thunderbird-60.7.2+build2/comm/calendar/base/src/calCachedCalendar.js thunderbird-60.8.0+build1/comm/calendar/base/src/calCachedCalendar.js --- thunderbird-60.7.2+build2/comm/calendar/base/src/calCachedCalendar.js 2019-06-25 10:33:21.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/calendar/base/src/calCachedCalendar.js 2019-07-05 08:04:33.000000000 +0000 @@ -876,7 +876,7 @@ defineForwards(calCachedCalendar.prototype, "mUncachedCalendar", ["setProperty", "deleteProperty", "isInvitation", "getInvitedAttendee", "canNotify"], - ["type", "aclManager", "aclEntry"], + ["providerID", "type", "aclManager", "aclEntry"], ["id", "name", "uri", "readOnly"]); defineForwards(calCachedCalendar.prototype, "mCachedCalendar", ["getItem", "getItems", "startBatch", "endBatch"], [], []); diff -Nru thunderbird-60.7.2+build2/comm/calendar/resources/content/datetimepickers/datetimepickers.xml thunderbird-60.8.0+build1/comm/calendar/resources/content/datetimepickers/datetimepickers.xml --- thunderbird-60.7.2+build2/comm/calendar/resources/content/datetimepickers/datetimepickers.xml 2019-06-25 10:33:21.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/calendar/resources/content/datetimepickers/datetimepickers.xml 2019-07-05 08:04:33.000000000 +0000 @@ -1772,15 +1772,13 @@ = numFreeBytesInBuffer) { int64_t growBy = (numBytesInStream - numFreeBytesInBuffer) * 2 + 1; - // GrowBuffer cannot handles over 4GB size + // GrowBuffer cannot handle over 4GB size. if (m_dataBufferSize + growBy > PR_UINT32_MAX) return nullptr; // try growing buffer by twice as much as we need. diff -Nru thunderbird-60.7.2+build2/comm/mailnews/news/src/nsNNTPProtocol.cpp thunderbird-60.8.0+build1/comm/mailnews/news/src/nsNNTPProtocol.cpp --- thunderbird-60.7.2+build2/comm/mailnews/news/src/nsNNTPProtocol.cpp 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/mailnews/news/src/nsNNTPProtocol.cpp 2019-07-05 08:04:34.000000000 +0000 @@ -2134,6 +2134,7 @@ { nsresult rv = NS_OK; char *line = m_lineStreamBuffer->ReadNextLine(inputStream, line_length, pauseForMoreData, &rv, true); + if (pauseForMoreData) { uint64_t inlength = 0; @@ -2145,6 +2146,8 @@ return rv; } + if (!line) return NS_OK; + if (m_newsFolder) m_newsFolder->NotifyDownloadedLine(line, m_key); diff -Nru thunderbird-60.7.2+build2/comm/suite/base/content/utilityOverlay.js thunderbird-60.8.0+build1/comm/suite/base/content/utilityOverlay.js --- thunderbird-60.7.2+build2/comm/suite/base/content/utilityOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/base/content/utilityOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -922,7 +922,7 @@ var suffix = 1; aBaseName = validateFileName(aBaseName); var suggestion = aBaseName + aExtension; - while (aExistingNames.indexOf(suggestion) != -1) + while (aExistingNames.includes(suggestion)) { suffix++; suggestion = aBaseName + "(" + suffix + ")" + aExtension; diff -Nru thunderbird-60.7.2+build2/comm/suite/base/content/viewApplyThemeOverlay.js thunderbird-60.8.0+build1/comm/suite/base/content/viewApplyThemeOverlay.js --- thunderbird-60.7.2+build2/comm/suite/base/content/viewApplyThemeOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/base/content/viewApplyThemeOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -21,7 +21,7 @@ }); } -const gAddonListener = { +var gAddonListener = { onEnabling: function(val) {}, onEnabled: function(val) {}, onDisabling: function(val) {}, diff -Nru thunderbird-60.7.2+build2/comm/suite/browser/linkToolbarHandler.js thunderbird-60.8.0+build1/comm/suite/browser/linkToolbarHandler.js --- thunderbird-60.7.2+build2/comm/suite/browser/linkToolbarHandler.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/browser/linkToolbarHandler.js 2019-07-05 08:04:34.000000000 +0000 @@ -143,7 +143,7 @@ this.hasItems = false; } -const linkToolbarHandler = new LinkToolbarHandler(); +var linkToolbarHandler = new LinkToolbarHandler(); var gLanguageBundle; function LinkElementDecorator(element) { diff -Nru thunderbird-60.7.2+build2/comm/suite/browser/linkToolbarOverlay.js thunderbird-60.8.0+build1/comm/suite/browser/linkToolbarOverlay.js --- thunderbird-60.7.2+build2/comm/suite/browser/linkToolbarOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/browser/linkToolbarOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -210,5 +210,5 @@ } } -const linkToolbarUI = new LinkToolbarUI; +var linkToolbarUI = new LinkToolbarUI; diff -Nru thunderbird-60.7.2+build2/comm/suite/browser/navigator.js thunderbird-60.8.0+build1/comm/suite/browser/navigator.js --- thunderbird-60.7.2+build2/comm/suite/browser/navigator.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/browser/navigator.js 2019-07-05 08:04:34.000000000 +0000 @@ -45,7 +45,7 @@ var gURIFixup = null; // Listeners for updating zoom value in status bar -const ZoomListeners = +var ZoomListeners = { // Identifies the setting in the content prefs database. @@ -130,7 +130,7 @@ //cached elements var gBrowser = null; -const gTabStripPrefListener = +var gTabStripPrefListener = { domain: "browser.tabs.autoHide", observe: function(subject, topic, prefName) @@ -147,7 +147,7 @@ } }; -const gHomepagePrefListener = +var gHomepagePrefListener = { domain: "browser.startup.homepage", observe: function(subject, topic, prefName) @@ -160,7 +160,7 @@ } }; -const gStatusBarPopupIconPrefListener = +var gStatusBarPopupIconPrefListener = { domain: "privacy.popups.statusbar_icon_enabled", observe: function(subject, topic, prefName) @@ -178,7 +178,7 @@ }; // popup window permission change listener -const gPopupPermListener = { +var gPopupPermListener = { observe: function(subject, topic, data) { if (topic == "popup-perm-close") { @@ -194,7 +194,7 @@ } }; -const gFormSubmitObserver = { +var gFormSubmitObserver = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver, Ci.nsIObserver]), @@ -889,7 +889,7 @@ // On X, we're not currently able to account for the size of the window // border. Use 28px as a guess (titlebar + bottom window border) - if (navigator.appVersion.indexOf("X11") != -1) + if (navigator.appVersion.includes("X11")) defaultHeight -= 28; // On small screens, default to maximized state @@ -1217,7 +1217,7 @@ var targetURI = getWebNavigation().currentURI.spec; // if we're already viewing a translated page, then just reload - if (targetURI.indexOf(serviceDomain) >= 0) + if (targetURI.includes(serviceDomain)) BrowserReload(); else { loadURI(encodeURI(service) + encodeURIComponent(targetURI)); @@ -1706,7 +1706,7 @@ var exclude = datasource.GetTarget(aboutValue, excludeProp, true); if (exclude instanceof Ci.nsIRDFLiteral) { - searchPanelExists = (exclude.Value.indexOf("navigator:browser") < 0); + searchPanelExists = !exclude.Value.includes("navigator:browser"); } else { // panel exists and no exclude set searchPanelExists = true; @@ -3325,7 +3325,7 @@ form.enctype == "application/x-www-form-urlencoded") { postData = formData.join("&"); } else { // get - spec += spec.indexOf("?") != -1 ? "&" : "?"; + spec += spec.includes("?") ? "&" : "?"; spec += formData.join("&"); } diff -Nru thunderbird-60.7.2+build2/comm/suite/browser/tabbrowser.xml thunderbird-60.8.0+build1/comm/suite/browser/tabbrowser.xml --- thunderbird-60.7.2+build2/comm/suite/browser/tabbrowser.xml 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/browser/tabbrowser.xml 2019-07-05 08:04:34.000000000 +0000 @@ -1037,7 +1037,7 @@ // XXX https://bugzilla.mozilla.org/show_bug.cgi?id=22183#c239 // (only for schemes that support a host) try { - if (docElement.getAttribute("chromehidden").indexOf("location") != -1) { + if (docElement.getAttribute("chromehidden").includes("location")) { var uri = this.mURIFixup.createExposableURI(aBrowser.currentURI); if (uri.schemeIs("about")) newTitle = uri.spec + sep + newTitle; @@ -2075,7 +2075,7 @@ if (!aListener) throw Cr.NS_ERROR_INVALID_ARG; - if (this.mProgressListeners.indexOf(aListener) != -1) + if (this.mProgressListeners.includes(aListener)) throw Cr.NS_ERROR_FAILURE; // push() does not disturb possibly ongoing iterations. @@ -2088,7 +2088,7 @@ { diff -Nru thunderbird-60.7.2+build2/comm/suite/browser/test/browser/browser_popupNotification.js thunderbird-60.8.0+build1/comm/suite/browser/test/browser/browser_popupNotification.js --- thunderbird-60.7.2+build2/comm/suite/browser/test/browser/browser_popupNotification.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/browser/test/browser/browser_popupNotification.js 2019-07-05 08:04:34.000000000 +0000 @@ -756,7 +756,7 @@ }); // One down event to open the popup - EventUtils.synthesizeKey("VK_DOWN", { altKey: (navigator.platform.indexOf("Mac") == -1) }); + EventUtils.synthesizeKey("VK_DOWN", { altKey: !navigator.platform.includes("Mac") }); } function loadURI(uri, callback) { diff -Nru thunderbird-60.7.2+build2/comm/suite/components/bindings/notification.xml thunderbird-60.8.0+build1/comm/suite/components/bindings/notification.xml --- thunderbird-60.7.2+build2/comm/suite/components/bindings/notification.xml 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/bindings/notification.xml 2019-07-05 08:04:34.000000000 +0000 @@ -1427,7 +1427,7 @@ diff -Nru thunderbird-60.7.2+build2/comm/suite/components/dataman/content/dataman.js thunderbird-60.8.0+build1/comm/suite/components/dataman/content/dataman.js --- thunderbird-60.7.2+build2/comm/suite/components/dataman/content/dataman.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/dataman/content/dataman.js 2019-07-05 08:04:34.000000000 +0000 @@ -211,7 +211,7 @@ aTree.view.selection.clearSelection(); // Find out which current rows match a cached selection and add them to the selection. for (let row = 0; row < aTree.view.rowCount; row++) - if (aCachedIDs.indexOf(aIDFunction(row)) != -1) + if (aCachedIDs.includes(aIDFunction(row))) aTree.view.selection.toggleSelect(row); }, } @@ -776,7 +776,7 @@ var sType = aType || this.selectfield.value; for (let domain in this.domainObjects) { if (this.domainObjects[domain].displayTitle - .toLocaleLowerCase().indexOf(lcSearch) != -1 && + .toLocaleLowerCase().includes(lcSearch) && (sType == "all" || this.domainObjects[domain]["has" + sType])) this.displayedDomains.push(this.domainObjects[domain]); } @@ -1162,7 +1162,7 @@ var domainList = []; for (let cookie of this.cookies) { let domain = gDomains.getDomainFromHost(cookie.rawHost); - if (domainList.indexOf(domain) == -1) + if (!domainList.includes(domain)) domainList.push(domain); } gDomains.resetFlagToDomains("hasCookies", domainList); @@ -2286,7 +2286,7 @@ let domainList = []; for (let lSignon of this.allSignons) { let domain = gDomains.getDomainFromHost(lSignon.hostname); - if (domainList.indexOf(domain) == -1) + if (!domainList.includes(domain)) domainList.push(domain); } gDomains.resetFlagToDomains("hasPasswords", domainList); @@ -2722,7 +2722,7 @@ var domainList = []; for (let lStorage of this.storages) { let domain = gDomains.getDomainFromHost(lStorage.rawHost); - if (domainList.indexOf(domain) == -1) + if (!domainList.includes(domain)) domainList.push(domain); } gDomains.resetFlagToDomains("hasStorage", domainList); @@ -3000,8 +3000,8 @@ var lcSearch = aSearchString.toLocaleLowerCase(); this.displayedFormdata = this.formdata.filter( function(aFd) { - return aFd.fieldname.toLocaleLowerCase().indexOf(lcSearch) != -1 || - aFd.value.toLocaleLowerCase().indexOf(lcSearch) != -1; + return aFd.fieldname.toLocaleLowerCase().includes(lcSearch) || + aFd.value.toLocaleLowerCase().includes(lcSearch); }); this.sort(null, false, false); gDataman.restoreSelectionFromIDs(this.tree, this._getObjID, selectionCache); diff -Nru thunderbird-60.7.2+build2/comm/suite/components/feeds/WebContentConverter.js thunderbird-60.8.0+build1/comm/suite/components/feeds/WebContentConverter.js --- thunderbird-60.7.2+build2/comm/suite/components/feeds/WebContentConverter.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/feeds/WebContentConverter.js 2019-07-05 08:04:34.000000000 +0000 @@ -327,7 +327,7 @@ throw("Permission denied to add " + uri.spec + " as a content or protocol handler"); // If the uri doesn't contain '%s', it won't be a good handler - if (uri.spec.indexOf("%s") < 0) + if (!uri.spec.includes("%s")) throw NS_ERROR_DOM_SYNTAX_ERR; return uri; diff -Nru thunderbird-60.7.2+build2/comm/suite/components/helpviewer/content/help.js thunderbird-60.8.0+build1/comm/suite/components/helpviewer/content/help.js --- thunderbird-60.7.2+build2/comm/suite/components/helpviewer/content/help.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/helpviewer/content/help.js 2019-07-05 08:04:34.000000000 +0000 @@ -262,7 +262,7 @@ var datasources = getAttribute(helpFileDS, panelDef, NC_DATASOURCES, ""); var panelPlatforms = getAttribute(helpFileDS, panelDef, NC_PLATFORM, null); - if (panelPlatforms && panelPlatforms.split(/\s+/).indexOf(platform) == -1) + if (panelPlatforms && !panelPlatforms.split(/\s+/).includes(platform)) continue; // ignore datasources for other platforms // empty datasources are valid on search panel definitions @@ -353,7 +353,7 @@ NC_PLATFORM, platform); - if (nodePlatforms.split(/\s+/).indexOf(platform) == -1) { // node is for another platform + if (!nodePlatforms.split(/\s+/).includes(platform)) { // node is for another platform var currentNode = currentTarget.QueryInterface(Ci.nsIRDFNode); // "false" because we don't want to renumber elements in the container RDFC.RemoveElement(currentNode, false); diff -Nru thunderbird-60.7.2+build2/comm/suite/components/nsSuiteGlue.js thunderbird-60.8.0+build1/comm/suite/components/nsSuiteGlue.js --- thunderbird-60.7.2+build2/comm/suite/components/nsSuiteGlue.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/nsSuiteGlue.js 2019-07-05 08:04:34.000000000 +0000 @@ -37,9 +37,9 @@ return tmp.require("devtools/server/main").DebuggerServer; }); -const global = this; +var global = this; -const listeners = { +var listeners = { mm: { // PLEASE KEEP THIS LIST IN SYNC WITH THE MOBILE LISTENERS IN nsBrowserGlue.js "RemoteLogins:findLogins": ["LoginManagerParent"], @@ -1166,7 +1166,7 @@ var dictList = o1.value; // If the preference contains an invalid dictionary, set it to a valid // dictionary, any dictionary will do. - if (dictList.length && dictList.indexOf(prefValue) < 0) + if (dictList.length && !dictList.includes(prefValue)) Services.prefs.setCharPref(prefName, dictList[0]); }, @@ -1475,7 +1475,7 @@ * PermissionUI.jsm for an example of how to provide a new prompt * from an add-on. */ -const ContentPermissionIntegration = { +var ContentPermissionIntegration = { /** * Creates a PermissionPrompt for a given permission type and * nsIContentPermissionRequest. diff -Nru thunderbird-60.7.2+build2/comm/suite/components/permissions/content/cookieViewer.js thunderbird-60.8.0+build1/comm/suite/components/permissions/content/cookieViewer.js --- thunderbird-60.7.2+build2/comm/suite/components/permissions/content/cookieViewer.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/permissions/content/cookieViewer.js 2019-07-05 08:04:34.000000000 +0000 @@ -603,9 +603,9 @@ { var filterSet = []; for (let cookie of allCookies) { - if (cookie.rawHost.indexOf(aFilterValue) != -1 || - cookie.name.indexOf(aFilterValue) != -1 || - cookie.value.indexOf(aFilterValue) != -1) + if (cookie.rawHost.includes(aFilterValue) || + cookie.name.includes(aFilterValue) || + cookie.value.includes(aFilterValue)) filterSet.push(cookie); } return filterSet; diff -Nru thunderbird-60.7.2+build2/comm/suite/components/places/PlacesUIUtils.jsm thunderbird-60.8.0+build1/comm/suite/components/places/PlacesUIUtils.jsm --- thunderbird-60.7.2+build2/comm/suite/components/places/PlacesUIUtils.jsm 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/places/PlacesUIUtils.jsm 2019-07-05 08:04:34.000000000 +0000 @@ -26,7 +26,7 @@ const gInContentProcess = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT; const FAVICON_REQUEST_TIMEOUT = 60 * 1000; // Map from windows to arrays of data about pending favicon loads. -let gFaviconLoadDataMap = new Map(); +var gFaviconLoadDataMap = new Map(); const ITEM_CHANGED_BATCH_NOTIFICATION_THRESHOLD = 10; @@ -35,7 +35,7 @@ const PREF_LOAD_BOOKMARKS_IN_BACKGROUND = "browser.tabs.loadBookmarksInBackground"; const PREF_LOAD_BOOKMARKS_IN_TABS = "browser.tabs.loadBookmarksInTabs"; -let InternalFaviconLoader = { +var InternalFaviconLoader = { /** * This gets called for every inner window that is destroyed. * In the parent process, we process the destruction ourselves. In the child process, diff -Nru thunderbird-60.7.2+build2/comm/suite/components/places/tests/unit/test_leftpane_corruption_handling.js thunderbird-60.8.0+build1/comm/suite/components/places/tests/unit/test_leftpane_corruption_handling.js --- thunderbird-60.7.2+build2/comm/suite/components/places/tests/unit/test_leftpane_corruption_handling.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/places/tests/unit/test_leftpane_corruption_handling.js 2019-07-05 08:04:34.000000000 +0000 @@ -170,7 +170,7 @@ Assert.equal(count(obj1), count(obj2)); for (let prop in obj1) { // Skip everchanging values. - if (SKIP_PROPS.indexOf(prop) != -1) + if (SKIP_PROPS.includes(prop)) continue; // Skip undefined objects, otherwise we hang on them. if (!obj1[prop]) diff -Nru thunderbird-60.7.2+build2/comm/suite/components/pref/content/pref-applicationManager.js thunderbird-60.8.0+build1/comm/suite/components/pref/content/pref-applicationManager.js --- thunderbird-60.7.2+build2/comm/suite/components/pref/content/pref-applicationManager.js 2019-06-25 10:33:24.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/pref/content/pref-applicationManager.js 2019-07-05 08:04:34.000000000 +0000 @@ -2,11 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -// As pref-applications.js is always loaded, we can (and should!) reuse -// the nsI* constants from there, if needed also any services we need. - -ChromeUtils.import("resource://gre/modules/Services.jsm"); - var gAppManagerDialog = { _removed: [], @@ -30,6 +25,9 @@ var apps = this.handlerInfo.possibleApplicationHandlers.enumerate(); while (apps.hasMoreElements()) { let app = apps.getNext(); + if (!gApplicationsPane.isValidHandlerApp(app)) + continue; + app.QueryInterface(Ci.nsIHandlerApp); var item = list.appendItem(app.name); item.className = "listitem-iconic"; diff -Nru thunderbird-60.7.2+build2/comm/suite/components/pref/content/pref-applications.js thunderbird-60.8.0+build1/comm/suite/components/pref/content/pref-applications.js --- thunderbird-60.7.2+build2/comm/suite/components/pref/content/pref-applications.js 2019-06-25 10:33:24.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/pref/content/pref-applications.js 2019-07-05 08:04:34.000000000 +0000 @@ -5,29 +5,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); +ChromeUtils.import("resource:///modules/ShellService.jsm"); function Startup() { gApplicationsPane.init(); } +XPCOMUtils.defineLazyServiceGetters(this, { + gCategoryManager: ["@mozilla.org/categorymanager;1", "nsICategoryManager"], + gHandlerService: ["@mozilla.org/uriloader/handler-service;1", "nsIHandlerService"], + gMIMEService: ["@mozilla.org/mime;1", "nsIMIMEService"], + gWebContentConverterService: ["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1", "nsIWebContentConverterService"], +}); + //****************************************************************************// // Constants & Enumeration Values -// global services -var handlerSvc = Cc["@mozilla.org/uriloader/handler-service;1"] - .getService(Ci.nsIHandlerService); -var categoryMgr = Cc["@mozilla.org/categorymanager;1"] - .getService(Ci.nsICategoryManager); -var mimeSvc = Cc["@mozilla.org/mime;1"] - .getService(Ci.nsIMIMEService); -var converterSvc = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] - .getService(Ci.nsIWebContentConverterService); -var shellSvc = null; -if ("@mozilla.org/suite/shell-service;1" in Cc) - shellSvc = Cc["@mozilla.org/suite/shell-service;1"] - .getService(Ci.nsIShellService); - const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed"; const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed"; const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed"; @@ -183,8 +177,8 @@ if (this.primaryExtension) { var extension = this.primaryExtension.toUpperCase(); - return document.getElementById("bundlePrefApplications") - .getFormattedString("fileEnding", [extension]); + return gApplicationsPane._prefsBundle.getFormattedString("fileEnding", + [extension]); } return this.type; @@ -199,23 +193,23 @@ // Make sure the preferred handler is in the set of possible handlers. if (aNewValue) - this.addPossibleApplicationHandler(aNewValue) + this.addPossibleApplicationHandler(aNewValue); }, get possibleApplicationHandlers() { return this.wrappedHandlerInfo.possibleApplicationHandlers; }, - addPossibleApplicationHandler: function(aNewHandler) { - try { - if (this.possibleApplicationHandlers.indexOf(0, aNewHandler) != -1) + addPossibleApplicationHandler(aNewHandler) { + var possibleApps = this.possibleApplicationHandlers.enumerate(); + while (possibleApps.hasMoreElements()) { + if (possibleApps.getNext().equals(aNewHandler)) return; - } catch (e) { } this.possibleApplicationHandlers.appendElement(aNewHandler); }, - removePossibleApplicationHandler: function(aHandler) { + removePossibleApplicationHandler(aHandler) { var defaultApp = this.preferredApplicationHandler; if (defaultApp && aHandler.equals(defaultApp)) { // If the app we remove was the default app, we must make sure @@ -224,10 +218,13 @@ this.preferredApplicationHandler = null; } - try { - var handlerIdx = this.possibleApplicationHandlers.indexOf(0, aHandler); - this.possibleApplicationHandlers.removeElementAt(handlerIdx); - } catch (e) { + var handlers = this.possibleApplicationHandlers; + for (var i = 0; i < handlers.length; ++i) { + var handler = handlers.queryElementAt(i, Ci.nsIHandlerApp); + if (handler.equals(aHandler)) { + handlers.removeElementAt(i); + break; + } } }, @@ -262,6 +259,14 @@ }, set preferredAction(aNewValue) { + // If the action is to use the plugin, + // we must set the preferred action to "save to disk". + // But only if it's not currently the preferred action. + if ((aNewValue == kActionUsePlugin) && + (this.preferredAction != Ci.nsIHandlerInfo.saveToDisk)) { + aNewValue = Ci.nsIHandlerInfo.saveToDisk; + } + // We don't modify the preferred action if the new action is to use a plugin // because handler info objects don't understand our custom "use plugin" // value. Also, leaving it untouched means that we can automatically revert @@ -342,10 +347,10 @@ handledOnlyByPlugin: undefined, get isDisabledPluginType() { - return this._getDisabledPluginTypes().indexOf(this.type) != -1; + return this._getDisabledPluginTypes().includes(this.type); }, - _getDisabledPluginTypes: function() { + _getDisabledPluginTypes() { var types = ""; if (Services.prefs.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES)) @@ -356,22 +361,22 @@ return types ? types.split(",") : []; }, - disablePluginType: function() { + disablePluginType() { var disabledPluginTypes = this._getDisabledPluginTypes(); - if (disabledPluginTypes.indexOf(this.type) == -1) + if (!disabledPluginTypes.includes(this.type)) disabledPluginTypes.push(this.type); Services.prefs.setCharPref(PREF_DISABLED_PLUGIN_TYPES, disabledPluginTypes.join(",")); // Update the category manager so existing browser windows update. - categoryMgr.deleteCategoryEntry("Gecko-Content-Viewers", - this.type, - false); + gCategoryManager.deleteCategoryEntry("Gecko-Content-Viewers", + this.type, + false); }, - enablePluginType: function() { + enablePluginType() { var disabledPluginTypes = this._getDisabledPluginTypes(); var type = this.type; @@ -381,8 +386,8 @@ disabledPluginTypes.join(",")); // Update the category manager so existing browser windows update. - categoryMgr. - addCategoryEntry("Gecko-Content-Viewers", + gCategoryManager.addCategoryEntry( + "Gecko-Content-Viewers", this.type, "@mozilla.org/content/plugin/document-loader-factory;1", false, @@ -393,8 +398,8 @@ //**************************************************************************// // Storage - store: function() { - handlerSvc.store(this.wrappedHandlerInfo); + store() { + gHandlerService.store(this.wrappedHandlerInfo); }, @@ -409,7 +414,7 @@ return this._getIcon(32); }, - _getIcon: function(aSize) { + _getIcon(aSize) { if (this.primaryExtension) return "moz-icon://goat." + this.primaryExtension + "?size=" + aSize; @@ -450,12 +455,13 @@ } FeedHandlerInfo.prototype = { + __proto__: HandlerInfoWrapper.prototype, + //**************************************************************************// // nsIHandlerInfo get description() { - return document.getElementById("bundlePrefApplications") - .getString(this.typeClass); + return gApplicationsPane._prefsBundle.getString(this.typeClass); }, get preferredApplicationHandler() { @@ -471,7 +477,7 @@ var uri = document.getElementById(this._prefSelectedWeb).value; if (!uri) return null; - return converterSvc.getWebContentHandlerByURI(this.type, uri); + return gWebContentConverterService.getWebContentHandlerByURI(this.type, uri); case "messenger": default: @@ -496,7 +502,7 @@ // only uses the "auto handler" when the selected reader is a web handler. // We also don't have to unregister it when the user turns on "always ask" // (i.e. preview in browser), since that also overrides the auto handler. - converterSvc.setAutoHandler(this.type, aNewValue); + gWebContentConverterService.setAutoHandler(this.type, aNewValue); } }, @@ -513,14 +519,7 @@ _inner: [], _removed: [], - QueryInterface: function(aIID) { - if (aIID.equals(Ci.nsIMutableArray) || - aIID.equals(Ci.nsIArray) || - aIID.equals(Ci.nsISupports)) - return this; - - throw Cr.NS_ERROR_NO_INTERFACE; - }, + QueryInterface: XPCOMUtils.generateQI([Ci.nsIMutableArray, Ci.nsIArray]), get length() { return this._inner.length; @@ -545,7 +544,7 @@ queryElementAt: function(aIndex, aInterface) { return this._inner[aIndex].QueryInterface(aInterface); - } + }, }; // Add the selected local app if it's different from the OS default handler. @@ -562,12 +561,10 @@ this._possibleApplicationHandlers.appendElement(preferredApp); } - if (converterSvc) { - // Add the registered web handlers. There can be any number of these. - var webHandlers = converterSvc.getContentHandlers(this.type, {}); - for (let webHandler of webHandlers) - this._possibleApplicationHandlers.appendElement(webHandler); - } + // Add the registered web handlers. There can be any number of these. + var webHandlers = gWebContentConverterService.getContentHandlers(this.type); + for (let webHandler of webHandlers) + this._possibleApplicationHandlers.appendElement(webHandler); return this._possibleApplicationHandlers; }, @@ -579,7 +576,7 @@ var defaultFeedReader = null; try { - defaultFeedReader = shellSvc.defaultFeedReader; + defaultFeedReader = ShellService.defaultFeedReader; } catch(ex) { // no default reader @@ -603,7 +600,7 @@ get hasDefaultHandler() { try { - if (shellSvc.defaultFeedReader) + if (ShellService.defaultFeedReader) return true; } catch(ex) { @@ -680,7 +677,7 @@ }, set alwaysAskBeforeHandling(aNewValue) { - if (aNewValue == true) + if (aNewValue) document.getElementById(this._prefSelectedAction).value = "ask"; else document.getElementById(this._prefSelectedAction).value = "reader"; @@ -709,7 +706,7 @@ // so we when the controller calls store() after modifying the handlers, // the only thing we need to store is the removal of possible handlers // XXX Should we hold off on making the changes until this method gets called? - store: function() { + store() { for (let app of this._possibleApplicationHandlers._removed) { if (app instanceof Ci.nsILocalHandlerApp) { let pref = document.getElementById(PREF_FEED_SELECTED_APP); @@ -722,7 +719,8 @@ } else { app.QueryInterface(Ci.nsIWebContentHandlerInfo); - converterSvc.removeContentHandler(app.contentType, app.uri); + gWebContentConverterService.removeContentHandler(app.contentType, + app.uri); } } this._possibleApplicationHandlers._removed = []; @@ -739,8 +737,6 @@ // The type class is used for setting icons through CSS for types that don't // explicitly set their icons. typeClass: "webFeed", - - __proto__: HandlerInfoWrapper.prototype }; var feedHandlerInfo = { @@ -749,8 +745,8 @@ _prefSelectedWeb: PREF_FEED_SELECTED_WEB, _prefSelectedAction: PREF_FEED_SELECTED_ACTION, _prefSelectedReader: PREF_FEED_SELECTED_READER, - typeClass: "webFeed" -} + typeClass: "webFeed", +}; var videoFeedHandlerInfo = { __proto__: new FeedHandlerInfo(TYPE_MAYBE_VIDEO_FEED), @@ -758,8 +754,8 @@ _prefSelectedWeb: PREF_VIDEO_FEED_SELECTED_WEB, _prefSelectedAction: PREF_VIDEO_FEED_SELECTED_ACTION, _prefSelectedReader: PREF_VIDEO_FEED_SELECTED_READER, - typeClass: "videoPodcastFeed" -} + typeClass: "videoPodcastFeed", +}; var audioFeedHandlerInfo = { __proto__: new FeedHandlerInfo(TYPE_MAYBE_AUDIO_FEED), @@ -767,8 +763,8 @@ _prefSelectedWeb: PREF_AUDIO_FEED_SELECTED_WEB, _prefSelectedAction: PREF_AUDIO_FEED_SELECTED_ACTION, _prefSelectedReader: PREF_AUDIO_FEED_SELECTED_READER, - typeClass: "audioPodcastFeed" -} + typeClass: "audioPodcastFeed", +}; //****************************************************************************// @@ -808,7 +804,7 @@ //**************************************************************************// // Initialization & Destruction - init: function() { + init() { // Initialize shortcuts to some commonly accessed elements & values. this._brandShortName = document.getElementById("bundleBrand").getString("brandShortName"); @@ -861,7 +857,7 @@ Services.obs.notifyObservers(window, "app-handler-pane-loaded"); }, - destroy: function() { + destroy() { this._list.removeEventListener("command", this); this._list.removeEventListener("select", this); window.removeEventListener("unload", this); @@ -884,20 +880,13 @@ //**************************************************************************// // nsISupports - QueryInterface: function(aIID) { - if (aIID.equals(Ci.nsIObserver) || - aIID.equals(Ci.nsIDOMEventListener || - aIID.equals(Ci.nsISupports))) - return this; - - throw Cr.NS_ERROR_NO_INTERFACE; - }, - + QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, + Ci.nsIDOMEventListener]), //**************************************************************************// // nsIObserver - observe: function (aSubject, aTopic, aData) { + observe(aSubject, aTopic, aData) { // Rebuild the list when there are changes to preferences that influence // whether or not to show certain entries in the list. if (aTopic == "nsPref:changed" && !this._storingAction) { @@ -919,7 +908,7 @@ //**************************************************************************// // nsIDOMEventListener - handleEvent: function(aEvent) { + handleEvent(aEvent) { switch (aEvent.type) { case "unload": this.destroy(); @@ -961,13 +950,13 @@ //**************************************************************************// // Composed Model Construction - _loadData: function() { + _loadData() { this._loadFeedHandler(); this._loadPluginHandlers(); this._loadApplicationHandlers(); }, - _loadFeedHandler: function() { + _loadFeedHandler() { this._handledTypes[TYPE_MAYBE_FEED] = feedHandlerInfo; feedHandlerInfo.handledOnlyByPlugin = false; @@ -998,7 +987,7 @@ * So even if we could use enabledPlugin to get the plugin that would be used, * we'd still need to check the pref ourselves to find out if it's enabled. */ - _loadPluginHandlers: function() { + _loadPluginHandlers() { let pluginHost = Cc["@mozilla.org/plugin/host;1"] .getService(Ci.nsIPluginHost); for (let pluginTag of pluginHost.getPluginTags()) { @@ -1008,7 +997,7 @@ handlerInfoWrapper = this._handledTypes[type]; else { let wrappedHandlerInfo = - mimeSvc.getFromTypeAndExtension(type, null); + gMIMEService.getFromTypeAndExtension(type, null); handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo); handlerInfoWrapper.handledOnlyByPlugin = true; this._handledTypes[type] = handlerInfoWrapper; @@ -1022,8 +1011,8 @@ /** * Load the set of handlers defined by the application datastore. */ - _loadApplicationHandlers: function() { - var wrappedHandlerInfos = handlerSvc.enumerate(); + _loadApplicationHandlers() { + var wrappedHandlerInfos = gHandlerService.enumerate(); while (wrappedHandlerInfos.hasMoreElements()) { let wrappedHandlerInfo = wrappedHandlerInfos.getNext().QueryInterface(Ci.nsIHandlerInfo); @@ -1045,7 +1034,7 @@ //**************************************************************************// // View Construction - _rebuildVisibleTypes: function() { + _rebuildVisibleTypes() { // Reset the list of visible types and the visible type description counts. this._visibleTypes = []; this._visibleTypeDescriptionCount = {}; @@ -1084,7 +1073,7 @@ } }, - _rebuildView: function() { + _rebuildView() { // Clear the list of entries (the first 2 elements are and // , they should never get removed). while (this._list.childNodes.length > 2) @@ -1120,10 +1109,10 @@ } }, - _matchesFilter: function(aType) { + _matchesFilter(aType) { var filterValue = this._filter.value.toLowerCase(); - return this._describeType(aType).toLowerCase().indexOf(filterValue) != -1 || - this._describePreferredAction(aType).toLowerCase().indexOf(filterValue) != -1; + return this._describeType(aType).toLowerCase().includes(filterValue) || + this._describePreferredAction(aType).toLowerCase().includes(filterValue); }, /** @@ -1136,7 +1125,7 @@ * @param aHandlerInfo {nsIHandlerInfo} the type being described * @returns {string} a description of the type */ - _describeType: function(aHandlerInfo) { + _describeType(aHandlerInfo) { if (this._visibleTypeDescriptionCount[aHandlerInfo.description] > 1) return this._prefsBundle.getFormattedString("typeDescriptionWithType", [aHandlerInfo.description, @@ -1157,7 +1146,7 @@ * is being described * @returns {string} a description of the action */ - _describePreferredAction: function(aHandlerInfo) { + _describePreferredAction(aHandlerInfo) { // alwaysAskBeforeHandling overrides the preferred action, so if that flag // is set, then describe that behavior instead. For most types, this is // the "alwaysAsk" string, but for the feed type we show something special. @@ -1165,8 +1154,7 @@ if (isFeedType(aHandlerInfo.type)) return this._prefsBundle.getFormattedString("previewInApp", [this._brandShortName]); - else - return this._prefsBundle.getString("alwaysAsk"); + return this._prefsBundle.getString("alwaysAsk"); } switch (aHandlerInfo.preferredAction) { @@ -1218,7 +1206,7 @@ * * @returns {boolean} whether or not it's valid */ - isValidHandlerApp: function(aHandlerApp) { + isValidHandlerApp(aHandlerApp) { if (!aHandlerApp) return false; @@ -1237,7 +1225,7 @@ return false; }, - _isValidHandlerExecutable: function(aExecutable) { + _isValidHandlerExecutable(aExecutable) { var file = Services.dirsvc.get("XREExeF", Ci.nsIFile); return aExecutable && @@ -1252,7 +1240,7 @@ * Note that this would not work from onselect on the listbox because * the XBL needs to be applied _before_ calling this function! */ - rebuildActionsMenu: function() { + rebuildActionsMenu() { var typeItem = this._list.selectedItem; var handlerInfo = this._handledTypes[typeItem.type]; var cell = @@ -1423,12 +1411,14 @@ } // Create a menu item for selecting a local application. -#ifdef XP_WIN - // On Windows, selecting an application to open another application - // would be meaningless so we special case executables. - var executableType = mimeSvc.getTypeFromExtension("exe"); - if (handlerInfo.type != executableType) -#endif + let canOpenWithOtherApp = true; + if (AppConstants.platform == "win") { + // On Windows, selecting an application to open another application + // would be meaningless so we special case executables. + let executableType = gMIMEService.getTypeFromExtension("exe"); + canOpenWithOtherApp = handlerInfo.type != executableType; + } + if (canOpenWithOtherApp) { let menuItem = document.createElement("menuitem"); menuItem.setAttribute("class", "handler-action"); @@ -1473,7 +1463,7 @@ /** * Sort the list when the user clicks on a column header. */ - sort: function (event) { + sort(event) { var column = event.target; // If the user clicked on a new sort column, remove the direction indicator @@ -1496,7 +1486,10 @@ /** * Sort the list of visible types by the current sort column/direction. */ - _sortVisibleTypes: function() { + _sortVisibleTypes() { + if (!this._sortColumn) + return; + var t = this; function sortByType(a, b) { @@ -1526,7 +1519,7 @@ //**************************************************************************// // Changes - onSelectAction: function(aActionItem) { + onSelectAction(aActionItem) { this._storingAction = true; try { @@ -1537,7 +1530,7 @@ } }, - _storeAction: function(aActionItem) { + _storeAction(aActionItem) { var typeItem = this._list.selectedItem; var handlerInfo = this._handledTypes[typeItem.type]; @@ -1582,7 +1575,7 @@ } }, - manageApp: function() { + manageApp() { var typeItem = this._list.selectedItem; var handlerInfo = this._handledTypes[typeItem.type]; @@ -1605,7 +1598,7 @@ } }, - chooseApp: function() { + chooseApp() { var handlerApp; let onSelectionDone = function() { // Rebuild the actions menu whether the user picked an app or canceled. @@ -1638,8 +1631,9 @@ if (isFeedType(handlerInfo.type)) { // MIME info will be null, create a temp object. - params.mimeInfo = mimeSvc.getFromTypeAndExtension(handlerInfo.type, - handlerInfo.primaryExtension); + params.mimeInfo = + gMIMEService.getFromTypeAndExtension(handlerInfo.type, + handlerInfo.primaryExtension); } else { params.mimeInfo = handlerInfo.wrappedHandlerInfo; } @@ -1686,7 +1680,7 @@ } }, - _setIconClassForPreferredAction: function(aHandlerInfo, aElement) { + _setIconClassForPreferredAction(aHandlerInfo, aElement) { // If this returns true, the attribute that CSS sniffs for was set to something // so you shouldn't manually set an icon URI. // This removes the existing actionIcon attribute if any, even if returning false. @@ -1717,7 +1711,7 @@ return false; }, - _getIconURLForPreferredAction: function(aHandlerInfo) { + _getIconURLForPreferredAction(aHandlerInfo) { switch (aHandlerInfo.preferredAction) { case Ci.nsIHandlerInfo.useSystemDefault: return this._getIconURLForSystemDefault(aHandlerInfo); @@ -1733,7 +1727,7 @@ return null; }, - _getIconURLForHandlerApp: function(aHandlerApp) { + _getIconURLForHandlerApp(aHandlerApp) { if (aHandlerApp instanceof Ci.nsILocalHandlerApp) return this._getIconURLForFile(aHandlerApp.executable); @@ -1742,14 +1736,14 @@ return this._getIconURLForWebApp(aHandlerApp.uriTemplate); if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo) - return this._getIconURLForWebApp(aHandlerApp.uri) + return this._getIconURLForWebApp(aHandlerApp.uri); } // We know nothing about other kinds of handler apps. return ""; }, - _getIconURLForFile: function(aFile) { + _getIconURLForFile(aFile) { var fph = Services.io.getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler); var urlSpec = fph.getURLSpecFromFile(aFile); @@ -1757,7 +1751,7 @@ return "moz-icon://" + urlSpec + "?size=16"; }, - _getIconURLForWebApp: function(aWebAppURITemplate) { + _getIconURLForWebApp(aWebAppURITemplate) { var uri = Services.io.newURI(aWebAppURITemplate); // Unfortunately we need to use favicon.ico here, but we don't know @@ -1768,7 +1762,7 @@ return /^https?/.test(uri.scheme) ? uri.resolve("/favicon.ico") : ""; }, - _getIconURLForSystemDefault: function(aHandlerInfo) { + _getIconURLForSystemDefault(aHandlerInfo) { // Handler info objects for MIME types on some OSes implement a property bag // interface from which we can get an icon for the default app, so if we're // dealing with a MIME type on one of those OSes, then try to get the icon. diff -Nru thunderbird-60.7.2+build2/comm/suite/components/pref/content/pref-languages-add.js thunderbird-60.8.0+build1/comm/suite/components/pref/content/pref-languages-add.js --- thunderbird-60.7.2+build2/comm/suite/components/pref/content/pref-languages-add.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/pref/content/pref-languages-add.js 2019-07-05 08:04:34.000000000 +0000 @@ -21,7 +21,7 @@ { for (var i = 0; i < gLanguageNames.length; i++) { - if (gSelectedLanguages.indexOf(gLanguageNames[i][1]) == -1) + if (!gSelectedLanguages.includes(gLanguageNames[i][1])) gAvailableLanguages.appendItem(gLanguageNames[i][0], gLanguageNames[i][1]); } @@ -101,8 +101,8 @@ let languageId = languageIds[i]; if (IsRFC1766LangTag(languageId)) { - if (addedLang.indexOf(languageId) == -1 && - gSelectedLanguages.indexOf(languageId) == -1) + if (!addedLang.includes(languageId) && + !gSelectedLanguages.includes(languageId)) addedLang.push(languageId); } else diff -Nru thunderbird-60.7.2+build2/comm/suite/components/pref/jar.mn thunderbird-60.8.0+build1/comm/suite/components/pref/jar.mn --- thunderbird-60.7.2+build2/comm/suite/components/pref/jar.mn 2019-06-25 10:33:24.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/pref/jar.mn 2019-07-05 08:04:34.000000000 +0000 @@ -12,7 +12,7 @@ content/communicator/pref/pref-appearance.js (content/pref-appearance.js) content/communicator/pref/pref-appearance.xul (content/pref-appearance.xul) content/communicator/pref/pref-applications.xul (content/pref-applications.xul) -* content/communicator/pref/pref-applications.js (content/pref-applications.js) + content/communicator/pref/pref-applications.js (content/pref-applications.js) content/communicator/pref/pref-applicationManager.js (content/pref-applicationManager.js) content/communicator/pref/pref-applicationManager.xul (content/pref-applicationManager.xul) content/communicator/pref/pref-cache.js (content/pref-cache.js) diff -Nru thunderbird-60.7.2+build2/comm/suite/components/sessionstore/nsSessionStore.js thunderbird-60.8.0+build1/comm/suite/components/sessionstore/nsSessionStore.js --- thunderbird-60.7.2+build2/comm/suite/components/sessionstore/nsSessionStore.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/sessionstore/nsSessionStore.js 2019-07-05 08:04:34.000000000 +0000 @@ -1377,7 +1377,7 @@ let normalTabsLen = tabbrowser.tabs.length - tabbrowser._numPinnedTabs; for (let i = 0; i < tabbrowser.tabs.length; i++) { let tab = tabbrowser.tabs[i]; - if (homePages.indexOf(tab.linkedBrowser.currentURI.spec) != -1) { + if (homePages.includes(tab.linkedBrowser.currentURI.spec)) { removableTabs.push(tab); } } @@ -2660,7 +2660,7 @@ // make sure to reset the capabilities and attributes, in case this tab gets reused var disallow = (tabData.disallow)?tabData.disallow.split(","):[]; CAPABILITIES.forEach(function(aCapability) { - browser.docShell["allow" + aCapability] = disallow.indexOf(aCapability) == -1; + browser.docShell["allow" + aCapability] = !disallow.includes(aCapability); }); for (let name in this.xulAttributes) tab.removeAttribute(name); @@ -3129,7 +3129,7 @@ } else if (value && typeof value.indexOf == "function" && node.options) { Array.from(node.options).forEach(function(aOpt, aIx) { - aOpt.selected = value.indexOf(aIx) > -1; + aOpt.selected = value.includes(aIx); // Only fire the event here if this wasn't selected by default if (!aOpt.defaultSelected) @@ -3199,7 +3199,7 @@ restoreWindowFeatures: function sss_restoreWindowFeatures(aWindow, aWinData) { var hidden = (aWinData.hidden)?aWinData.hidden.split(","):[]; WINDOW_HIDEABLE_FEATURES.forEach(function(aItem) { - aWindow[aItem].visible = hidden.indexOf(aItem) == -1; + aWindow[aItem].visible = !hidden.includes(aItem); }); if (aWinData.isPopup) diff -Nru thunderbird-60.7.2+build2/comm/suite/components/shell/nsGNOMEShellService.cpp thunderbird-60.8.0+build1/comm/suite/components/shell/nsGNOMEShellService.cpp --- thunderbird-60.7.2+build2/comm/suite/components/shell/nsGNOMEShellService.cpp 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/shell/nsGNOMEShellService.cpp 2019-07-05 08:04:34.000000000 +0000 @@ -40,6 +40,8 @@ #include #include +using namespace mozilla; + struct ProtocolAssociation { uint16_t app; const char* protocol; @@ -190,7 +192,7 @@ nsAutoCString handler; nsCOMPtr gioApp; - for (unsigned i = 0; i < mozilla::ArrayLength(gProtocols); i++) { + for (unsigned i = 0; i < ArrayLength(gProtocols); i++) { if (aApps & gProtocols[i].app) { nsDependentCString protocol(gProtocols[i].protocol); if (!gProtocols[i].essential) @@ -239,7 +241,7 @@ } // set handler for the protocols - for (unsigned int i = 0; i < mozilla::ArrayLength(gProtocols); ++i) { + for (unsigned int i = 0; i < ArrayLength(gProtocols); ++i) { if (aApps & gProtocols[i].app) { if (appInfo && (gProtocols[i].essential || aClaimAllTypes)) { nsDependentCString protocol(gProtocols[i].protocol); @@ -249,7 +251,7 @@ } if (aClaimAllTypes) { - for (unsigned int i = 0; i < mozilla::ArrayLength(gMimeTypes); i++) { + for (unsigned int i = 0; i < ArrayLength(gMimeTypes); i++) { if (aApps & gMimeTypes[i].app) { nsDependentCString type(gMimeTypes[i].mimeType); appInfo->SetAsDefaultForMimeType(type); diff -Nru thunderbird-60.7.2+build2/comm/suite/components/shell/ShellService.jsm thunderbird-60.8.0+build1/comm/suite/components/shell/ShellService.jsm --- thunderbird-60.7.2+build2/comm/suite/components/shell/ShellService.jsm 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/shell/ShellService.jsm 2019-07-05 08:04:34.000000000 +0000 @@ -13,7 +13,7 @@ /** * Internal functionality to save and restore the docShell.allow* properties. */ -let ShellServiceInternal = { +var ShellServiceInternal = { /** * Used to determine whether or not to offer "Set as desktop background" * functionality. Even if shell service is available it is not diff -Nru thunderbird-60.7.2+build2/comm/suite/components/sidebar/content/sidebarOverlay.js thunderbird-60.8.0+build1/comm/suite/components/sidebar/content/sidebarOverlay.js --- thunderbird-60.7.2+build2/comm/suite/components/sidebar/content/sidebarOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/sidebar/content/sidebarOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -531,7 +531,7 @@ { var exclude = node.getAttribute('exclude'); return ( exclude && exclude != '' && - exclude.indexOf(sidebarObj.component) != -1 ); + exclude.includes(sidebarObj.component)); } sbPanel.prototype.is_excluded = function () diff -Nru thunderbird-60.7.2+build2/comm/suite/components/sync/content/syncSetup.js thunderbird-60.8.0+build1/comm/suite/components/sync/content/syncSetup.js --- thunderbird-60.7.2+build2/comm/suite/components/sync/content/syncSetup.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/sync/content/syncSetup.js 2019-07-05 08:04:34.000000000 +0000 @@ -131,9 +131,9 @@ // Only open the dialog if username + password are actually correct. Weave.Service.login(); - if ([Weave.LOGIN_FAILED_INVALID_PASSPHRASE, + if (![Weave.LOGIN_FAILED_INVALID_PASSPHRASE, Weave.LOGIN_FAILED_NO_PASSPHRASE, - Weave.LOGIN_SUCCEEDED].indexOf(Weave.Status.login) == -1) + Weave.LOGIN_SUCCEEDED].includes(Weave.Status.login)) return; // Hide any errors about the passphrase, we know it's not right. diff -Nru thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_394759_basic.js thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_394759_basic.js --- thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_394759_basic.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_394759_basic.js 2019-07-05 08:04:34.000000000 +0000 @@ -33,7 +33,7 @@ is(ss.getClosedWindowCount(), closedWindowCount + 1, "The closed window was added to Recently Closed Windows"); let data = JSON.parse(ss.getClosedWindowData())[0]; - ok(data.title == testURL && JSON.stringify(data).indexOf(uniqueText) > -1, + ok(data.title == testURL && JSON.stringify(data).includes(uniqueText), "The closed window data was stored correctly"); // reopen the closed window and ensure its integrity diff -Nru thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_408470.js thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_408470.js --- thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_408470.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_408470.js 2019-07-05 08:04:34.000000000 +0000 @@ -26,7 +26,7 @@ newTab.linkedBrowser.removeEventListener("load", loadListener2, true); let states = Array.from(newTab.linkedBrowser.contentDocument.styleSheets, aSS => !aSS.disabled); - let correct = states.indexOf(true) == aIx && states.indexOf(true, aIx + 1) == -1; + let correct = states.indexOf(true) == aIx && !states.includes(true, aIx + 1); if (/^fail_/.test(ssTitle)) ok(!correct, "didn't restore stylesheet " + ssTitle); diff -Nru thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_448741.js thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_448741.js --- thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_448741.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_448741.js 2019-07-05 08:04:34.000000000 +0000 @@ -20,7 +20,7 @@ function cleaningObserver(aSubject, aTopic, aData) { ok(aTopic == "sessionstore-state-write", "observed correct topic?"); ok(aSubject instanceof Ci.nsISupportsString, "subject is a string?"); - ok(aSubject.data.indexOf(uniqueValue) > -1, "data contains our value?"); + ok(aSubject.data.includes(uniqueValue), "data contains our value?"); // find the data for the newly added tab and delete it let state = JSON.parse(aSubject.data); @@ -43,7 +43,7 @@ function checkingObserver(aSubject, aTopic, aData) { ok(valueWasCleaned && aSubject instanceof Ci.nsISupportsString, "ready to check the cleaned state?"); - ok(aSubject.data.indexOf(uniqueValue) == -1, "data no longer contains our value?"); + ok(!aSubject.data.includes(uniqueValue), "data no longer contains our value?"); // clean up getBrowser().removeTab(tab); diff -Nru thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_493467.js thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_493467.js --- thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_493467.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_493467.js 2019-07-05 08:04:34.000000000 +0000 @@ -38,7 +38,7 @@ tabState = JSON.parse(ss.getTabState(tab)); let disallow = tabState.disallow.split(","); permissions.forEach(function(aName) { - ok(disallow.indexOf(aName) > -1, "Saved state of allow" + aName); + ok(disallow.includes(aName), "Saved state of allow" + aName); }); // IF A TEST FAILS, please add the missing permission's name (without the // leading "allow") to nsSessionStore.js's CAPABILITIES array. Thanks. diff -Nru thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_522545.js thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_522545.js --- thunderbird-60.7.2+build2/comm/suite/components/tests/browser/browser_522545.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/tests/browser/browser_522545.js 2019-07-05 08:04:34.000000000 +0000 @@ -155,7 +155,7 @@ // userTypedValue and userTypedClear set. getBrowser().addTabsProgressListener({ onLocationChange: function (aBrowser) { - if (uris.indexOf(aBrowser.currentURI.spec) > -1) { + if (uris.includes(aBrowser.currentURI.spec)) { getBrowser().removeTabsProgressListener(this); firstLocationChange(); } diff -Nru thunderbird-60.7.2+build2/comm/suite/components/tests/chrome/test_idcheck.xul thunderbird-60.8.0+build1/comm/suite/components/tests/chrome/test_idcheck.xul --- thunderbird-60.7.2+build2/comm/suite/components/tests/chrome/test_idcheck.xul 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/components/tests/chrome/test_idcheck.xul 2019-07-05 08:04:34.000000000 +0000 @@ -79,7 +79,7 @@ dump(" Tree 1:\n"); DumpElementTree(idList[i]); } - if (aIgnorableIDs.indexOf(id) < 0) + if (!aIgnorableIDs.includes(id)) { // if the id is not in our ignore list, show its status ok(!duplicate, "check id: " + filename + "#" + id); diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/components/compose/content/MsgComposeCommands.js thunderbird-60.8.0+build1/comm/suite/mailnews/components/compose/content/MsgComposeCommands.js --- thunderbird-60.7.2+build2/comm/suite/mailnews/components/compose/content/MsgComposeCommands.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/components/compose/content/MsgComposeCommands.js 2019-07-05 08:04:34.000000000 +0000 @@ -3318,7 +3318,7 @@ function removeQueryPart(aURL, aQuery) { // Quick pre-check. - if (aURL.indexOf(aQuery) < 0) + if (!aURL.includes(aQuery)) return aURL; let indexQM = aURL.indexOf("?"); diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/content/mailTasksOverlay.js thunderbird-60.8.0+build1/comm/suite/mailnews/content/mailTasksOverlay.js --- thunderbird-60.7.2+build2/comm/suite/mailnews/content/mailTasksOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/content/mailTasksOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -140,7 +140,7 @@ } } -const biffObserver = +var biffObserver = { observe: function observe(subject, topic, state) { diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/content/mailWidgets.xml thunderbird-60.8.0+build1/comm/suite/mailnews/content/mailWidgets.xml --- thunderbird-60.7.2+build2/comm/suite/mailnews/content/mailWidgets.xml 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/content/mailWidgets.xml 2019-07-05 08:04:34.000000000 +0000 @@ -879,7 +879,7 @@ // custom attribute to style the unavailable menulist item menulist.setAttribute("unavailable", - this.valueIds.indexOf(typedValue) < 0); + !this.valueIds.includes(typedValue)); // add a hidden menulist item if value is missing let menuitem = menulist.getElementsByAttribute("value", this.value).item(0); diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/content/mailWindowOverlay.js thunderbird-60.8.0+build1/comm/suite/mailnews/content/mailWindowOverlay.js --- thunderbird-60.7.2+build2/comm/suite/mailnews/content/mailWindowOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/content/mailWindowOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -609,7 +609,7 @@ var curKeys = msgHdr.getStringProperty("keywords"); if (msgHdr.label) curKeys += " $label" + msgHdr.label; - var addKey = (" " + curKeys + " ").indexOf(" " + key + " ") < 0; + var addKey = !(" " + curKeys + " ").includes(" " + key + " "); ToggleMessageTag(key, addKey); return; } @@ -704,7 +704,7 @@ for (var i = 0; i < tagCount; ++i) { var taginfo = tagArray[i]; - var removeKey = (" " + curKeys + " ").indexOf(" " + taginfo.key + " ") > -1; + var removeKey = (" " + curKeys + " ").includes(" " + taginfo.key + " "); if (taginfo.ordinal.includes("~AUTOTAG") && !removeKey) continue; diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/content/msgHdrViewOverlay.js thunderbird-60.8.0+build1/comm/suite/mailnews/content/msgHdrViewOverlay.js --- thunderbird-60.7.2+build2/comm/suite/mailnews/content/msgHdrViewOverlay.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/content/msgHdrViewOverlay.js 2019-07-05 08:04:34.000000000 +0000 @@ -495,7 +495,7 @@ var fromMailboxes = kMailboxSeparator + msgHeaderParser.extractHeaderAddressMailboxes( currentHeaderData.from.headerValue) + kMailboxSeparator; - if (fromMailboxes.indexOf(senderMailbox) >= 0) + if (fromMailboxes.includes(senderMailbox)) delete currentHeaderData.sender; } @@ -706,7 +706,7 @@ if (label) { var labelKey = "$label" + label; - if (msgKeyArray.indexOf(labelKey) < 0) + if (!msgKeyArray.includes(labelKey)) msgKeyArray.unshift(labelKey); } diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/content/msgMail3PaneWindow.js thunderbird-60.8.0+build1/comm/suite/mailnews/content/msgMail3PaneWindow.js --- thunderbird-60.7.2+build2/comm/suite/mailnews/content/msgMail3PaneWindow.js 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/content/msgMail3PaneWindow.js 2019-07-05 08:04:34.000000000 +0000 @@ -271,11 +271,11 @@ if (msgHdr) { var hdrs = hdrParser.headers; - if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) { + if (hdrs && hdrs.includes("X-attachment-size:")) { msgHdr.OrFlags(Ci.nsMsgMessageFlags .Attachment); } - if (hdrs && hdrs.indexOf("X-image-size:") > 0) { + if (hdrs && hdrs.includes("X-image-size:")) { msgHdr.setStringProperty("imageSize", "1"); } } @@ -557,7 +557,7 @@ { return currentLoadedFolder.msgDatabase.dBFolderInfo .getCharProperty("searchFolderUri").split("|") - .indexOf(msgFolderUri) != -1; + .includes(msgFolderUri); } // Is aFolder the currently loaded folder? @@ -646,7 +646,7 @@ } } -const MailPrefObserver = { +var MailPrefObserver = { observe: function observe(subject, topic, prefName) { if (topic == "nsPref:changed") { if (prefName == "mail.pane_config.dynamic") { diff -Nru thunderbird-60.7.2+build2/comm/suite/mailnews/content/tabmail.xml thunderbird-60.8.0+build1/comm/suite/mailnews/content/tabmail.xml --- thunderbird-60.7.2+build2/comm/suite/mailnews/content/tabmail.xml 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/mailnews/content/tabmail.xml 2019-07-05 08:04:34.000000000 +0000 @@ -316,7 +316,7 @@ @@ -326,8 +326,9 @@ = 0) - this.tabMonitors.splice(this.tabMonitors.indexOf(aTabMonitor), 1); + let index = this.tabMonitors.indexOf(aTabMonitor); + if (index >= 0) + this.tabMonitors.splice(index, 1); ]]> diff -Nru thunderbird-60.7.2+build2/comm/suite/modules/SitePermissions.jsm thunderbird-60.8.0+build1/comm/suite/modules/SitePermissions.jsm --- thunderbird-60.7.2+build2/comm/suite/modules/SitePermissions.jsm 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/modules/SitePermissions.jsm 2019-07-05 08:04:34.000000000 +0000 @@ -20,7 +20,7 @@ * automatically cleared once the browser stops existing * (once there are no other references to the browser object); */ -const TemporaryBlockedPermissions = { +var TemporaryBlockedPermissions = { // This is a three level deep map with the following structure: // // Browser => { diff -Nru thunderbird-60.7.2+build2/comm/suite/modules/WindowsJumpLists.jsm thunderbird-60.8.0+build1/comm/suite/modules/WindowsJumpLists.jsm --- thunderbird-60.7.2+build2/comm/suite/modules/WindowsJumpLists.jsm 2019-06-25 10:33:22.000000000 +0000 +++ thunderbird-60.8.0+build1/comm/suite/modules/WindowsJumpLists.jsm 2019-07-05 08:04:34.000000000 +0000 @@ -384,7 +384,7 @@ // Do not add items to recent that have already been added to frequent. if (this._frequentHashList && - this._frequentHashList.indexOf(aResult.uri) != -1) { + this._frequentHashList.includes(aResult.uri)) { return; } diff -Nru thunderbird-60.7.2+build2/config/milestone.txt thunderbird-60.8.0+build1/config/milestone.txt --- thunderbird-60.7.2+build2/config/milestone.txt 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/config/milestone.txt 2019-07-05 08:03:10.000000000 +0000 @@ -10,4 +10,4 @@ # hardcoded milestones in the tree from these two files. #-------------------------------------------------------- -60.7.2 +60.8.0 diff -Nru thunderbird-60.7.2+build2/debian/changelog thunderbird-60.8.0+build1/debian/changelog --- thunderbird-60.7.2+build2/debian/changelog 2019-06-25 10:58:41.000000000 +0000 +++ thunderbird-60.8.0+build1/debian/changelog 2019-07-05 21:12:01.000000000 +0000 @@ -1,3 +1,12 @@ +thunderbird (1:60.8.0+build1-0ubuntu0.18.10.1) cosmic; urgency=medium + + * New upstream stable release (60.8.0build1) + + * Add patch to fix some "error: missing documentation for macro" errors + - debian/patch/fix-missing-docs-error.patch + + -- Olivier Tilloy Fri, 05 Jul 2019 23:12:01 +0200 + thunderbird (1:60.7.2+build2-0ubuntu0.18.10.1) cosmic; urgency=medium * New upstream stable release (60.7.2build2) diff -Nru thunderbird-60.7.2+build2/debian/patches/fix-missing-docs-error.patch thunderbird-60.8.0+build1/debian/patches/fix-missing-docs-error.patch --- thunderbird-60.7.2+build2/debian/patches/fix-missing-docs-error.patch 1970-01-01 00:00:00.000000000 +0000 +++ thunderbird-60.8.0+build1/debian/patches/fix-missing-docs-error.patch 2019-07-05 21:10:43.000000000 +0000 @@ -0,0 +1,47 @@ +Description: Fix some "error: missing documentation for macro" errors. +Author: Olivier Tilloy + +--- a/servo/components/style_traits/values.rs ++++ b/servo/components/style_traits/values.rs +@@ -135,6 +135,7 @@ where + } + } + ++/// A macro. + #[macro_export] + macro_rules! serialize_function { + ($dest: expr, $name: ident($( $arg: expr, )+)) => { +@@ -404,6 +405,7 @@ impl_to_css_for_predefined_type!(::csspa + impl_to_css_for_predefined_type!(::cssparser::Color); + impl_to_css_for_predefined_type!(::cssparser::UnicodeRange); + ++/// A macro. + #[macro_export] + macro_rules! define_css_keyword_enum { + (pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => { +--- a/servo/components/style/properties/properties.mako.rs ++++ b/servo/components/style/properties/properties.mako.rs +@@ -55,6 +55,7 @@ use style_adjuster::StyleAdjuster; + + pub use self::declaration_block::*; + ++/// A macro. + #[cfg(feature = "gecko")] + #[macro_export] + macro_rules! property_name { +@@ -3853,6 +3854,7 @@ impl fmt::Debug for AliasId { + } + + // NOTE(emilio): Callers are responsible to deal with prefs. ++/// A macro. + #[macro_export] + macro_rules! css_properties_accessors { + ($macro_name: ident) => { +@@ -3875,6 +3877,7 @@ macro_rules! css_properties_accessors { + } + } + ++/// A macro. + #[macro_export] + macro_rules! longhand_properties_idents { + ($macro_name: ident) => { diff -Nru thunderbird-60.7.2+build2/debian/patches/series thunderbird-60.8.0+build1/debian/patches/series --- thunderbird-60.7.2+build2/debian/patches/series 2019-03-25 13:50:02.000000000 +0000 +++ thunderbird-60.8.0+build1/debian/patches/series 2019-07-05 21:10:53.000000000 +0000 @@ -9,3 +9,4 @@ rust-drop-dll-checksums.patch dont-treat-tilde-as-special.patch reduce-rust-debuginfo-on-32bit-architectures.patch +fix-missing-docs-error.patch diff -Nru thunderbird-60.7.2+build2/dom/base/nsGlobalWindowOuter.cpp thunderbird-60.8.0+build1/dom/base/nsGlobalWindowOuter.cpp --- thunderbird-60.7.2+build2/dom/base/nsGlobalWindowOuter.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/base/nsGlobalWindowOuter.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -1216,10 +1216,8 @@ return true; } - bool equal; - if (NS_SUCCEEDED(mDoc->NodePrincipal()->Equals(aNewDocument->NodePrincipal(), - &equal)) && - equal) { + if (BasePrincipal::Cast(mDoc->NodePrincipal()) + ->FastEqualsConsideringDomain(aNewDocument->NodePrincipal())) { // The origin is the same. return true; } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLBuffer.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLBuffer.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLBuffer.cpp 2019-06-25 10:31:33.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLBuffer.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -131,6 +131,11 @@ MOZ_ASSERT(error == LOCAL_GL_OUT_OF_MEMORY); mContext->ErrorOutOfMemory("%s: Error from driver: 0x%04x", funcName, error); + + // Truncate + mByteLength = 0; + mFetchInvalidator.InvalidateCaches(); + mIndexCache = nullptr; return; } } else { diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLContext.h thunderbird-60.8.0+build1/dom/canvas/WebGLContext.h --- thunderbird-60.7.2+build2/dom/canvas/WebGLContext.h 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLContext.h 2019-07-05 08:03:12.000000000 +0000 @@ -20,6 +20,7 @@ #include "mozilla/gfx/2D.h" #include "mozilla/LinkedList.h" #include "mozilla/UniquePtr.h" +#include "mozilla/WeakPtr.h" #include "nsCycleCollectionNoteChild.h" #include "nsICanvasRenderingContextInternal.h" #include "nsLayoutUtils.h" @@ -278,7 +279,8 @@ class WebGLContext : public nsICanvasRenderingContextInternal, public nsSupportsWeakReference, public WebGLContextUnchecked, - public nsWrapperCache { + public nsWrapperCache, + public SupportsWeakPtr { friend class ScopedDrawCallWrapper; friend class ScopedDrawHelper; friend class ScopedDrawWithTransformFeedback; @@ -330,9 +332,9 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS( WebGLContext, nsICanvasRenderingContextInternal) + MOZ_DECLARE_WEAKREFERENCE_TYPENAME(WebGLContext) virtual JSObject* WrapObject(JSContext* cx, JS::Handle givenProto) override = 0; diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionCompressedTextureASTC.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionCompressedTextureASTC.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionCompressedTextureASTC.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionCompressedTextureASTC.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -68,8 +68,10 @@ dom::Nullable >& retval) const { retval.SetNull(); if (mIsLost) { - mContext->ErrorInvalidOperation("%s: Extension is lost.", - "drawElementsInstancedANGLE"); + if (mContext) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "drawElementsInstancedANGLE"); + } return; } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionDebugShaders.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionDebugShaders.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionDebugShaders.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionDebugShaders.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -22,15 +22,7 @@ void WebGLExtensionDebugShaders::GetTranslatedShaderSource( const WebGLShader& shader, nsAString& retval) const { retval.SetIsVoid(true); - - if (mIsLost) { - mContext->ErrorInvalidOperation("%s: Extension is lost.", - "getTranslatedShaderSource"); - return; - } - - if (mContext->IsContextLost()) return; - + if (mIsLost || !mContext) return; if (!mContext->ValidateObject("getShaderTranslatedSource: shader", shader)) return; diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -34,7 +34,7 @@ void WebGLExtensionDisjointTimerQuery::DeleteQueryEXT(WebGLQuery* query) const { const char funcName[] = "deleteQueryEXT"; - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->DeleteQuery(query, funcName); } @@ -42,7 +42,7 @@ bool WebGLExtensionDisjointTimerQuery::IsQueryEXT( const WebGLQuery* query) const { const char funcName[] = "isQueryEXT"; - if (mIsLost) return false; + if (mIsLost || !mContext) return false; return mContext->IsQuery(query, funcName); } @@ -50,14 +50,14 @@ void WebGLExtensionDisjointTimerQuery::BeginQueryEXT(GLenum target, WebGLQuery& query) const { const char funcName[] = "beginQueryEXT"; - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->BeginQuery(target, query, funcName); } void WebGLExtensionDisjointTimerQuery::EndQueryEXT(GLenum target) const { const char funcName[] = "endQueryEXT"; - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->EndQuery(target, funcName); } @@ -65,7 +65,7 @@ void WebGLExtensionDisjointTimerQuery::QueryCounterEXT(WebGLQuery& query, GLenum target) const { const char funcName[] = "queryCounterEXT"; - if (mIsLost) return; + if (mIsLost || !mContext) return; if (!mContext->ValidateObject(funcName, query)) return; @@ -77,7 +77,7 @@ JS::MutableHandleValue retval) const { const char funcName[] = "getQueryEXT"; retval.setNull(); - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->GetQuery(cx, target, pname, retval, funcName); } @@ -87,7 +87,7 @@ JS::MutableHandleValue retval) const { const char funcName[] = "getQueryObjectEXT"; retval.setNull(); - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->GetQueryParameter(cx, query, pname, retval, funcName); } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionDrawBuffers.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionDrawBuffers.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionDrawBuffers.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionDrawBuffers.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -27,7 +27,9 @@ void WebGLExtensionDrawBuffers::DrawBuffersWEBGL( const dom::Sequence& buffers) { if (mIsLost) { - mContext->ErrorInvalidOperation("drawBuffersWEBGL: Extension is lost."); + if (mContext) { + mContext->ErrorInvalidOperation("drawBuffersWEBGL: Extension is lost."); + } return; } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionInstancedArrays.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionInstancedArrays.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionInstancedArrays.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionInstancedArrays.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -22,8 +22,10 @@ void WebGLExtensionInstancedArrays::DrawArraysInstancedANGLE( GLenum mode, GLint first, GLsizei count, GLsizei primcount) { if (mIsLost) { - mContext->ErrorInvalidOperation("%s: Extension is lost.", - "drawArraysInstancedANGLE"); + if (mContext) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "drawArraysInstancedANGLE"); + } return; } @@ -34,8 +36,10 @@ GLenum mode, GLsizei count, GLenum type, WebGLintptr offset, GLsizei primcount) { if (mIsLost) { - mContext->ErrorInvalidOperation("%s: Extension is lost.", - "drawElementsInstancedANGLE"); + if (mContext) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "drawElementsInstancedANGLE"); + } return; } @@ -45,8 +49,10 @@ void WebGLExtensionInstancedArrays::VertexAttribDivisorANGLE(GLuint index, GLuint divisor) { if (mIsLost) { - mContext->ErrorInvalidOperation("%s: Extension is lost.", - "vertexAttribDivisorANGLE"); + if (mContext) { + mContext->ErrorInvalidOperation("%s: Extension is lost.", + "vertexAttribDivisorANGLE"); + } return; } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionLoseContext.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionLoseContext.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionLoseContext.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionLoseContext.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -15,9 +15,15 @@ WebGLExtensionLoseContext::~WebGLExtensionLoseContext() {} -void WebGLExtensionLoseContext::LoseContext() { mContext->LoseContext(); } +void WebGLExtensionLoseContext::LoseContext() { + if (!mContext) return; + mContext->LoseContext(); +} -void WebGLExtensionLoseContext::RestoreContext() { mContext->RestoreContext(); } +void WebGLExtensionLoseContext::RestoreContext() { + if (!mContext) return; + mContext->RestoreContext(); +} IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionLoseContext, WEBGL_lose_context) diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionMOZDebug.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionMOZDebug.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionMOZDebug.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionMOZDebug.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -20,6 +20,8 @@ void WebGLExtensionMOZDebug::GetParameter(JSContext* cx, GLenum pname, JS::MutableHandle retval, ErrorResult& er) const { + if (mIsLost || !mContext) return; + const auto& gl = mContext->gl; switch (pname) { diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionVertexArray.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionVertexArray.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLExtensionVertexArray.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLExtensionVertexArray.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -20,26 +20,26 @@ already_AddRefed WebGLExtensionVertexArray::CreateVertexArrayOES() { - if (mIsLost) return nullptr; + if (mIsLost || !mContext) return nullptr; return mContext->CreateVertexArray(); } void WebGLExtensionVertexArray::DeleteVertexArrayOES(WebGLVertexArray* array) { - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->DeleteVertexArray(array); } bool WebGLExtensionVertexArray::IsVertexArrayOES( const WebGLVertexArray* array) { - if (mIsLost) return false; + if (mIsLost || !mContext) return false; return mContext->IsVertexArray(array); } void WebGLExtensionVertexArray::BindVertexArrayOES(WebGLVertexArray* array) { - if (mIsLost) return; + if (mIsLost || !mContext) return; mContext->BindVertexArray(array); } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLObjectModel.h thunderbird-60.8.0+build1/dom/canvas/WebGLObjectModel.h --- thunderbird-60.7.2+build2/dom/canvas/WebGLObjectModel.h 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLObjectModel.h 2019-07-05 08:03:12.000000000 +0000 @@ -6,8 +6,8 @@ #ifndef WEBGLOBJECTMODEL_H_ #define WEBGLOBJECTMODEL_H_ +#include "mozilla/WeakPtr.h" #include "nsCycleCollectionNoteChild.h" - #include "WebGLTypes.h" namespace mozilla { @@ -23,7 +23,7 @@ // as well as comparison with the current context. class WebGLContextBoundObject { public: - WebGLContext* const mContext; + const WeakPtr mContext; private: const uint32_t mContextGeneration; diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLRenderbuffer.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLRenderbuffer.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLRenderbuffer.cpp 2019-06-25 10:31:33.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLRenderbuffer.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -194,6 +194,16 @@ if (error) { const char* errorName = mContext->ErrorName(error); mContext->GenerateWarning("%s generated error %s", funcName, errorName); + if (error != LOCAL_GL_OUT_OF_MEMORY) { + // Truncate. + mSamples = 0; + mFormat = nullptr; + mWidth = 0; + mHeight = 0; + mImageDataStatus = WebGLImageDataStatus::NoImageData; + + InvalidateStatusOfAttachedFBs(funcName); + } return; } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLTexture.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLTexture.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLTexture.cpp 2019-06-25 10:31:33.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLTexture.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -44,8 +44,6 @@ } void WebGLTexture::ImageInfo::Set(const char* funcName, const ImageInfo& a) { - MOZ_ASSERT(a.IsDefined()); - Mutable(mFormat) = a.mFormat; Mutable(mWidth) = a.mWidth; Mutable(mHeight) = a.mHeight; @@ -1167,6 +1165,12 @@ mContext->gl->fTexParameterf(texTarget.get(), pname, clamped.f); } +void WebGLTexture::Truncate() { + for (auto& cur : mImageInfoArr) { + SetImageInfo("OUT_OF_MEMORY", &cur, ImageInfo()); + } +} + //////////////////////////////////////////////////////////////////////////////// NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLTexture) diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLTexture.h thunderbird-60.8.0+build1/dom/canvas/WebGLTexture.h --- thunderbird-60.7.2+build2/dom/canvas/WebGLTexture.h 2019-06-25 10:31:33.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLTexture.h 2019-07-05 08:03:12.000000000 +0000 @@ -117,6 +117,7 @@ uint32_t level, const ImageInfo& newInfo); + public: static const ImageInfo kUndefined; @@ -389,6 +390,7 @@ const char** const out_reason, bool* const out_initFailed); bool IsMipmapCubeComplete() const; + void Truncate(); bool IsCubeMap() const { return (mTarget == LOCAL_GL_TEXTURE_CUBE_MAP); } diff -Nru thunderbird-60.7.2+build2/dom/canvas/WebGLTextureUpload.cpp thunderbird-60.8.0+build1/dom/canvas/WebGLTextureUpload.cpp --- thunderbird-60.7.2+build2/dom/canvas/WebGLTextureUpload.cpp 2019-06-25 10:31:33.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/canvas/WebGLTextureUpload.cpp 2019-07-05 08:03:12.000000000 +0000 @@ -1148,6 +1148,7 @@ if (error == LOCAL_GL_OUT_OF_MEMORY) { mContext->ErrorOutOfMemory( "%s: Ran out of memory during texture allocation.", funcName); + Truncate(); return; } if (error) { @@ -1277,6 +1278,7 @@ if (glError == LOCAL_GL_OUT_OF_MEMORY) { mContext->ErrorOutOfMemory("%s: Driver ran out of memory during upload.", funcName); + Truncate(); return; } @@ -1364,6 +1366,7 @@ if (glError == LOCAL_GL_OUT_OF_MEMORY) { mContext->ErrorOutOfMemory("%s: Driver ran out of memory during upload.", funcName); + Truncate(); return; } @@ -1478,6 +1481,7 @@ if (error == LOCAL_GL_OUT_OF_MEMORY) { mContext->ErrorOutOfMemory("%s: Ran out of memory during upload.", funcName); + Truncate(); return; } if (error) { @@ -1632,6 +1636,7 @@ if (error == LOCAL_GL_OUT_OF_MEMORY) { mContext->ErrorOutOfMemory("%s: Ran out of memory during upload.", funcName); + Truncate(); return; } if (error) { @@ -1996,7 +2001,7 @@ } static bool DoCopyTexOrSubImage(WebGLContext* webgl, const char* funcName, - bool isSubImage, const WebGLTexture* tex, + bool isSubImage, WebGLTexture* tex, TexImageTarget target, GLint level, GLint xWithinSrc, GLint yWithinSrc, uint32_t srcTotalWidth, uint32_t srcTotalHeight, @@ -2073,6 +2078,7 @@ if (error == LOCAL_GL_OUT_OF_MEMORY) { webgl->ErrorOutOfMemory("%s: Ran out of memory during texture copy.", funcName); + tex->Truncate(); return false; } diff -Nru thunderbird-60.7.2+build2/dom/indexedDB/ActorsChild.cpp thunderbird-60.8.0+build1/dom/indexedDB/ActorsChild.cpp --- thunderbird-60.7.2+build2/dom/indexedDB/ActorsChild.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/indexedDB/ActorsChild.cpp 2019-07-05 08:03:14.000000000 +0000 @@ -2458,9 +2458,14 @@ database->Close(); } + RefPtr request = mOpenDBRequest; + MOZ_ASSERT(request); + mTransaction->FireCompleteOrAbortEvents(aResult); - mOpenDBRequest->SetTransaction(nullptr); + request->SetTransaction(nullptr); + request = nullptr; + mOpenDBRequest = nullptr; NoteComplete(); diff -Nru thunderbird-60.7.2+build2/dom/media/BaseMediaResource.cpp thunderbird-60.8.0+build1/dom/media/BaseMediaResource.cpp --- thunderbird-60.7.2+build2/dom/media/BaseMediaResource.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/media/BaseMediaResource.cpp 2019-07-05 08:03:14.000000000 +0000 @@ -107,7 +107,7 @@ NS_WARNING("Null owner in MediaResource::SetLoadInBackground()"); return; } - dom::HTMLMediaElement* element = owner->GetMediaElement(); + RefPtr element = owner->GetMediaElement(); if (!element) { NS_WARNING("Null element in MediaResource::SetLoadInBackground()"); return; diff -Nru thunderbird-60.7.2+build2/dom/plugins/base/nsPluginStreamListenerPeer.cpp thunderbird-60.8.0+build1/dom/plugins/base/nsPluginStreamListenerPeer.cpp --- thunderbird-60.7.2+build2/dom/plugins/base/nsPluginStreamListenerPeer.cpp 2019-06-25 10:32:43.000000000 +0000 +++ thunderbird-60.8.0+build1/dom/plugins/base/nsPluginStreamListenerPeer.cpp 2019-07-05 08:03:15.000000000 +0000 @@ -628,7 +628,7 @@ return NS_ERROR_FAILURE; } - // Don't allow cross-origin 307 POST redirects. + // Don't allow cross-origin 307/308 POST redirects. nsCOMPtr oldHttpChannel(do_QueryInterface(oldChannel)); if (oldHttpChannel) { uint32_t responseStatus; @@ -636,7 +636,7 @@ if (NS_FAILED(rv)) { return rv; } - if (responseStatus == 307) { + if (responseStatus == 307 || responseStatus == 308) { nsAutoCString method; rv = oldHttpChannel->GetRequestMethod(method); if (NS_FAILED(rv)) { diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/out/gen/angle/id/commit.h thunderbird-60.8.0+build1/gfx/angle/checkout/out/gen/angle/id/commit.h --- thunderbird-60.7.2+build2/gfx/angle/checkout/out/gen/angle/id/commit.h 2019-06-25 10:31:39.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/out/gen/angle/id/commit.h 2019-07-05 08:03:16.000000000 +0000 @@ -1,3 +1,3 @@ -#define ANGLE_COMMIT_HASH "f474fbb607e0" +#define ANGLE_COMMIT_HASH "ed76a1a5ec3e" #define ANGLE_COMMIT_HASH_SIZE 12 -#define ANGLE_COMMIT_DATE "2018-10-30 14:29:30 -0700" +#define ANGLE_COMMIT_DATE "2019-06-24 20:02:02 -0700" diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/common/angleutils.h thunderbird-60.8.0+build1/gfx/angle/checkout/src/common/angleutils.h --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/common/angleutils.h 2019-06-25 10:31:39.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/common/angleutils.h 2019-07-05 08:03:16.000000000 +0000 @@ -19,6 +19,10 @@ #include #include +#ifndef constexpr14 +#define constexpr14 +#endif + // A helper class to disallow copy and assignment operators namespace angle { diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp 2019-06-25 10:31:40.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp 2019-07-05 08:03:17.000000000 +0000 @@ -23,6 +23,11 @@ constexpr FLOAT kDebugDepthInitValue = 0.2f; constexpr UINT8 kDebugStencilInitValue = 3; +// A hard limit on buffer size. This works around a problem in the NVIDIA drivers where buffer sizes +// close to MAX_UINT would give undefined results. The limit of MAX_UINT/2 should be generous enough +// for almost any demanding application. +constexpr UINT kMaximumBufferSizeHardLimit = std::numeric_limits::max() >> 1; + uint64_t ComputeMippedMemoryUsage(unsigned int width, unsigned int height, unsigned int depth, @@ -109,6 +114,12 @@ const D3D11_SUBRESOURCE_DATA *initData, ID3D11Buffer **buffer) { + // Force buffers to be limited to a fixed max size. + if (desc->ByteWidth > kMaximumBufferSizeHardLimit) + { + return E_OUTOFMEMORY; + } + return device->CreateBuffer(desc, initData, buffer); } diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp 2019-06-25 10:31:40.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp 2019-07-05 08:03:17.000000000 +0000 @@ -77,6 +77,11 @@ MAX_TEXTURE_IMAGE_UNITS_VTF_SM3 = 4 }; +// A hard limit on buffer size. This works around a problem in the NVIDIA drivers where buffer sizes +// close to MAX_UINT would give undefined results. The limit of MAX_UINT/2 should be generous enough +// for almost any demanding application. +constexpr UINT kMaximumBufferSizeHardLimit = std::numeric_limits::max() >> 1; + Renderer9::Renderer9(egl::Display *display) : RendererD3D(display), mStateManager(this) { mD3d9Module = nullptr; @@ -880,6 +885,12 @@ DWORD Usage, IDirect3DVertexBuffer9 **ppVertexBuffer) { + // Force buffers to be limited to a fixed max size. + if (Length > kMaximumBufferSizeHardLimit) + { + return E_OUTOFMEMORY; + } + D3DPOOL Pool = getBufferPool(Usage); return mDevice->CreateVertexBuffer(Length, Usage, 0, Pool, ppVertexBuffer, nullptr); } @@ -894,6 +905,12 @@ D3DFORMAT Format, IDirect3DIndexBuffer9 **ppIndexBuffer) { + // Force buffers to be limited to a fixed max size. + if (Length > kMaximumBufferSizeHardLimit) + { + return E_OUTOFMEMORY; + } + D3DPOOL Pool = getBufferPool(Usage); return mDevice->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, nullptr); } diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexDataManager.cpp thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexDataManager.cpp --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexDataManager.cpp 2019-06-25 10:31:39.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexDataManager.cpp 2019-07-05 08:03:16.000000000 +0000 @@ -37,7 +37,23 @@ CONSTANT_VERTEX_BUFFER_SIZE = 4096 }; -// Warning: you should ensure binding really matches attrib.bindingIndex before using this function. +// Warning: ensure the binding matches attrib.bindingIndex before using these functions. +int64_t GetMaxAttributeByteOffsetForDraw(const gl::VertexAttribute &attrib, + const gl::VertexBinding &binding, + int64_t elementCount) +{ + CheckedNumeric stride = ComputeVertexAttributeStride(attrib, binding); + CheckedNumeric offset = ComputeVertexAttributeOffset(attrib, binding); + CheckedNumeric size = ComputeVertexAttributeTypeSize(attrib); + + ASSERT(elementCount > 0); + + CheckedNumeric result = + stride * (CheckedNumeric(elementCount) - 1) + size + offset; + return result.ValueOrDefault(std::numeric_limits::max()); +} + +// Warning: ensure the binding matches attrib.bindingIndex before using these functions. int ElementsInBuffer(const gl::VertexAttribute &attrib, const gl::VertexBinding &binding, unsigned int size) @@ -478,10 +494,11 @@ GLint firstVertexIndex = binding.getDivisor() > 0 ? 0 : start; int64_t maxVertexCount = static_cast(firstVertexIndex) + static_cast(totalCount); - int elementsInBuffer = - ElementsInBuffer(attrib, binding, static_cast(bufferD3D->getSize())); - if (maxVertexCount > elementsInBuffer) + int64_t maxByte = GetMaxAttributeByteOffsetForDraw(attrib, binding, maxVertexCount); + + ASSERT(bufferD3D->getSize() <= static_cast(std::numeric_limits::max())); + if (maxByte > static_cast(bufferD3D->getSize())) { return gl::InvalidOperation() << "Vertex buffer is not big enough for the draw call."; } diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/State.cpp thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/State.cpp --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/State.cpp 2019-06-25 10:31:39.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/State.cpp 2019-07-05 08:03:16.000000000 +0000 @@ -1362,7 +1362,10 @@ curTransformFeedback->detachBuffer(context, bufferName); } - getVertexArray()->detachBuffer(context, bufferName); + if (getVertexArray()->detachBuffer(context, bufferName)) + { + mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY); + } } void State::setEnableVertexAttribArray(unsigned int attribNum, bool enabled) diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/VertexArray.cpp thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/VertexArray.cpp --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/VertexArray.cpp 2019-06-25 10:31:39.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/VertexArray.cpp 2019-07-05 08:03:16.000000000 +0000 @@ -72,20 +72,28 @@ return mState.mLabel; } -void VertexArray::detachBuffer(const Context *context, GLuint bufferName) +bool VertexArray::detachBuffer(const Context *context, GLuint bufferName) { - for (auto &binding : mState.mVertexBindings) + bool anyBufferDetached = false; + for (size_t bindingIndex = 0; bindingIndex < gl::MAX_VERTEX_ATTRIB_BINDINGS; ++bindingIndex) { + VertexBinding &binding = mState.mVertexBindings[bindingIndex]; if (binding.getBuffer().id() == bufferName) { binding.setBuffer(context, nullptr); + + anyBufferDetached = true; } } if (mState.mElementArrayBuffer.id() == bufferName) { mState.mElementArrayBuffer.set(context, nullptr); + mDirtyBits.set(DIRTY_BIT_ELEMENT_ARRAY_BUFFER); + anyBufferDetached = true; } + + return anyBufferDetached; } const VertexAttribute &VertexArray::getVertexAttribute(size_t attribIndex) const diff -Nru thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/VertexArray.h thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/VertexArray.h --- thunderbird-60.7.2+build2/gfx/angle/checkout/src/libANGLE/VertexArray.h 2019-06-25 10:31:40.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/checkout/src/libANGLE/VertexArray.h 2019-07-05 08:03:17.000000000 +0000 @@ -91,7 +91,9 @@ return mState.getBindingFromAttribIndex(attribIndex); } - void detachBuffer(const Context *context, GLuint bufferName); + // Returns true if the function finds and detaches a bound buffer. + bool detachBuffer(const Context *context, GLuint bufferName); + void setVertexAttribDivisor(const Context *context, size_t index, GLuint divisor); void enableAttribute(size_t attribIndex, bool enabledState); void setVertexAttribPointer(const Context *context, diff -Nru thunderbird-60.7.2+build2/gfx/angle/cherries.log thunderbird-60.8.0+build1/gfx/angle/cherries.log --- thunderbird-60.7.2+build2/gfx/angle/cherries.log 2019-06-25 10:31:39.000000000 +0000 +++ thunderbird-60.8.0+build1/gfx/angle/cherries.log 2019-07-05 08:03:16.000000000 +0000 @@ -1,3 +1,63 @@ +commit ed76a1a5ec3ec8ba97e200a115e2c0346e1719d3 +Author: Jamie Madill +Date: Wed Mar 27 12:56:51 2019 -0400 + + Fix deleting a buffer not updating VAO validation. + + Deleting a buffer that is bound to a VAO should act as if + the application unbound the buffer. Unbinding the buffer + should update relevant validation caches. But we were + missing the logic that updates the validation caches. + + This CL adds the necessary cache updates. It does not include a + regression test. The test was causing an unrelated regression that is + going to be a bit longer. It should not block this fix. + + Bug: chromium:943538 + Change-Id: Ib073cd07a230ca073a5b14bc054e961158a0097d + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1536491 + Commit-Queue: Jamie Madill + Reviewed-by: Geoff Lang + +commit 987fa5718280368f78b1051283f6a44b06a5f749 +Author: Jamie Madill +Date: Wed Apr 3 13:15:17 2019 -0400 + + Fix OOB access for dynamic attribs with offsets. + + We were not properly adding the offset to compute the right bounds. + + Bug: chromium:943709 + Change-Id: I93e714b46dd366d5833fffa858ea3ab0322ffa92 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1548441 + Commit-Queue: Jamie Madill + Reviewed-by: Jonah Ryan-Davis + +commit 0986b93fb1ac07a282d5dbb07e0f86b4b83a5564 +Author: Jamie Madill +Date: Wed Mar 20 10:35:11 2019 -0400 + + Work around line loop streaming bug. + + This forces a hard limit on the buffer size we allocate from D3D11. It + can work around a D3D11 driver bug on NVIDIA where we would get an + invalid map pointer. This seemed to happen when the buffer sizes were + close to MAX_UINT. + + Bug: chromium:943087 + Change-Id: I64aa9c55cbb82015101262c19c72741c140964a5 + Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531374 + Commit-Queue: Jamie Madill + Reviewed-by: Shahbaz Youssefi + +commit 7678bc88c73f47d2abd177e0eb4bf72598de1c35 +Author: Jeff Gilbert +Date: Mon Jun 24 19:26:07 2019 -0700 + + Default to `#define constexpr=`. + + Change-Id: I681f71b6dd4c8cb1430a92cc15e73f70c7abe0ca + commit f474fbb607e046d66d56b497b93151de61cbefab Author: Jeff Gilbert Date: Thu Oct 25 14:00:07 2018 -0700 diff -Nru thunderbird-60.7.2+build2/image/decoders/icon/mac/nsIconChannelCocoa.mm thunderbird-60.8.0+build1/image/decoders/icon/mac/nsIconChannelCocoa.mm --- thunderbird-60.7.2+build2/image/decoders/icon/mac/nsIconChannelCocoa.mm 2019-06-25 10:31:42.000000000 +0000 +++ thunderbird-60.8.0+build1/image/decoders/icon/mac/nsIconChannelCocoa.mm 2019-07-05 08:03:18.000000000 +0000 @@ -28,9 +28,12 @@ #include "nsProxyRelease.h" #include "nsContentSecurityManager.h" #include "nsNetUtil.h" +#include "mozilla/RefPtr.h" #include +using namespace mozilla; + // nsIconChannel methods nsIconChannel::nsIconChannel() { @@ -326,78 +329,51 @@ return NS_ERROR_FAILURE; } - // we have an icon now, size it - NSRect desiredSizeRect = NSMakeRect(0, 0, desiredImageSize, desiredImageSize); - [iconImage setSize:desiredSizeRect.size]; - - [iconImage lockFocus]; - NSBitmapImageRep* bitmapRep = [[[NSBitmapImageRep alloc] - initWithFocusedViewRect:desiredSizeRect] - autorelease]; - [iconImage unlockFocus]; - - // we expect the following things to be true about our bitmapRep - NS_ENSURE_TRUE(![bitmapRep isPlanar] && - // Not necessarily: on a HiDPI-capable system, we'll get - // a 2x bitmap - // (unsigned int)[bitmapRep bytesPerPlane] == - // desiredImageSize * desiredImageSize * 4 && - [bitmapRep bitsPerPixel] == 32 && - [bitmapRep samplesPerPixel] == 4 && - [bitmapRep hasAlpha] == YES, - NS_ERROR_UNEXPECTED); - - // check what size we actually got, and ensure it isn't too big to return - uint32_t actualImageSize = [bitmapRep bytesPerRow] / 4; - NS_ENSURE_TRUE(actualImageSize < 256, NS_ERROR_UNEXPECTED); - - // now we can validate the amount of data - NS_ENSURE_TRUE((unsigned int)[bitmapRep bytesPerPlane] == - actualImageSize * actualImageSize * 4, - NS_ERROR_UNEXPECTED); - - // rgba, pre-multiplied data - uint8_t* bitmapRepData = (uint8_t*)[bitmapRep bitmapData]; - - // create our buffer - int32_t bufferCapacity = 2 + [bitmapRep bytesPerPlane]; - AutoTArray iconBuffer; // initial size is for - // 16x16 - iconBuffer.SetLength(bufferCapacity); - - uint8_t* iconBufferPtr = iconBuffer.Elements(); - - // write header data into buffer - *iconBufferPtr++ = actualImageSize; - *iconBufferPtr++ = actualImageSize; - - uint32_t dataCount = [bitmapRep bytesPerPlane]; - uint32_t index = 0; - while (index < dataCount) { - // get data from the bitmap - uint8_t r = bitmapRepData[index++]; - uint8_t g = bitmapRepData[index++]; - uint8_t b = bitmapRepData[index++]; - uint8_t a = bitmapRepData[index++]; - - // write data out to our buffer - // non-cairo uses native image format, but the A channel is ignored. - // cairo uses ARGB (highest to lowest bits) -#if MOZ_LITTLE_ENDIAN - *iconBufferPtr++ = b; - *iconBufferPtr++ = g; - *iconBufferPtr++ = r; - *iconBufferPtr++ = a; -#else - *iconBufferPtr++ = a; - *iconBufferPtr++ = r; - *iconBufferPtr++ = g; - *iconBufferPtr++ = b; -#endif + if (desiredImageSize > 255) { + // The Icon image format represents width and height as u8, so it does not + // allow for images sized 256 or more. + return NS_ERROR_FAILURE; } - NS_ASSERTION(iconBufferPtr == iconBuffer.Elements() + bufferCapacity, - "buffer size miscalculation"); + // Set the actual size to *twice* the requested size. + // We do this because our UI doesn't take the window's device pixel ratio into + // account when it requests these icons; e.g. it will request an icon with + // size 16, place it in a 16x16 CSS pixel sized image, and then display it in + // a window on a HiDPI screen where the icon now covers 32x32 physical screen + // pixels. So we just always double the size here in order to prevent blurriness. + uint32_t size = (desiredImageSize < 128) ? desiredImageSize * 2 : desiredImageSize; + uint32_t width = size; + uint32_t height = size; + + // The "image format" we're outputting here (and which gets decoded by + // nsIconDecoder) has the following format: + // - 1 byte for the image width, as u8 + // - 1 byte for the image height, as u8 + // - the raw image data as BGRA, width * height * 4 bytes. + size_t bufferCapacity = 2 + width * height * 4; + UniquePtr fileBuf = MakeUnique(bufferCapacity); + fileBuf[0] = uint8_t(width); + fileBuf[1] = uint8_t(height); + uint8_t* imageBuf = &fileBuf[2]; + + // Create a CGBitmapContext around imageBuf and draw iconImage to it. + // This gives us the image data in the format we want: BGRA, four bytes per + // pixel, in host endianness, with premultiplied alpha. + CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); + CGContextRef ctx = + CGBitmapContextCreate(imageBuf, width, height, 8 /* bitsPerComponent */, width * 4, cs, + kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst); + CGColorSpaceRelease(cs); + + NSGraphicsContext* oldContext = [NSGraphicsContext currentContext]; + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:ctx + flipped:NO]]; + + [iconImage drawInRect:NSMakeRect(0, 0, width, height)]; + + [NSGraphicsContext setCurrentContext:oldContext]; + + CGContextRelease(ctx); // Now, create a pipe and stuff our data into it nsCOMPtr inStream; @@ -407,8 +383,7 @@ if (NS_SUCCEEDED(rv)) { uint32_t written; - rv = outStream->Write((char*)iconBuffer.Elements(), bufferCapacity, - &written); + rv = outStream->Write((char*)fileBuf.get(), bufferCapacity, &written); if (NS_SUCCEEDED(rv)) { NS_IF_ADDREF(*_retval = inStream); } diff -Nru thunderbird-60.7.2+build2/image/test/reftest/downscaling/downscale-moz-icon-1-ref.html thunderbird-60.8.0+build1/image/test/reftest/downscaling/downscale-moz-icon-1-ref.html --- thunderbird-60.7.2+build2/image/test/reftest/downscaling/downscale-moz-icon-1-ref.html 2019-06-25 10:31:42.000000000 +0000 +++ thunderbird-60.8.0+build1/image/test/reftest/downscaling/downscale-moz-icon-1-ref.html 2019-07-05 08:03:18.000000000 +0000 @@ -8,12 +8,16 @@