From 1595ee7da4559e4619127e2893cce04aad976ac8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 14 May 2019 12:16:07 +0200 Subject: Rip broken telemetry out of the app AUS. Tag #21 --- toolkit/mozapps/update/UpdateTelemetry.jsm | 488 ----------------------------- toolkit/mozapps/update/content/updates.js | 14 +- toolkit/mozapps/update/moz.build | 4 - toolkit/mozapps/update/nsUpdateService.js | 230 -------------- tools/lint/eslint/modules.json | 1 - 5 files changed, 1 insertion(+), 736 deletions(-) delete mode 100644 toolkit/mozapps/update/UpdateTelemetry.jsm diff --git a/toolkit/mozapps/update/UpdateTelemetry.jsm b/toolkit/mozapps/update/UpdateTelemetry.jsm deleted file mode 100644 index d64085143..000000000 --- a/toolkit/mozapps/update/UpdateTelemetry.jsm +++ /dev/null @@ -1,488 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -"use strict"; - -this.EXPORTED_SYMBOLS = [ - "AUSTLMY" -]; - -const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; - -Cu.import("resource://gre/modules/Services.jsm", this); - -this.AUSTLMY = { - // Telemetry for the application update background update check occurs when - // the background update timer fires after the update interval which is - // determined by the app.update.interval preference and its telemetry - // histogram IDs have the suffix '_NOTIFY'. - // Telemetry for the externally initiated background update check occurs when - // a call is made to |checkForBackgroundUpdates| which is typically initiated - // by an application when it has determined that the application should have - // received an update. This has separate telemetry so it is possible to - // analyze using the telemetry data systems that have not been updating when - // they should have. - - // The update check was performed by the call to checkForBackgroundUpdates in - // nsUpdateService.js. - EXTERNAL: "EXTERNAL", - // The update check was performed by the call to notify in nsUpdateService.js. - NOTIFY: "NOTIFY", - - /** - * Values for the UPDATE_CHECK_CODE_NOTIFY and UPDATE_CHECK_CODE_EXTERNAL - * Telemetry histograms. - */ - // No update found (no notification) - CHK_NO_UPDATE_FOUND: 0, - // Update will be downloaded in the background (background download) - CHK_DOWNLOAD_UPDATE: 1, - // Showing prompt due to the update.xml specifying showPrompt - // (update notification) - CHK_SHOWPROMPT_SNIPPET: 2, - // Showing prompt due to preference (update notification) - CHK_SHOWPROMPT_PREF: 3, - // Already has an active update in progress (no notification) - CHK_HAS_ACTIVEUPDATE: 8, - // A background download is already in progress (no notification) - CHK_IS_DOWNLOADING: 9, - // An update is already staged (no notification) - CHK_IS_STAGED: 10, - // An update is already downloaded (no notification) - CHK_IS_DOWNLOADED: 11, - // Background checks disabled by preference (no notification) - CHK_PREF_DISABLED: 12, - // Update checks disabled by admin locked preference (no notification) - CHK_ADMIN_DISABLED: 13, - // Unable to check for updates per hasUpdateMutex() (no notification) - CHK_NO_MUTEX: 14, - // Unable to check for updates per gCanCheckForUpdates (no notification). This - // should be covered by other codes and is recorded just in case. - CHK_UNABLE_TO_CHECK: 15, - // Background checks disabled for the current session (no notification) - CHK_DISABLED_FOR_SESSION: 16, - // Unable to perform a background check while offline (no notification) - CHK_OFFLINE: 17, - // Note: codes 18 - 21 were removed along with the certificate checking code. - // General update check failure and threshold reached - // (check failure notification) - CHK_GENERAL_ERROR_PROMPT: 22, - // General update check failure and threshold not reached (no notification) - CHK_GENERAL_ERROR_SILENT: 23, - // No compatible update found though there were updates (no notification) - CHK_NO_COMPAT_UPDATE_FOUND: 24, - // Update found for a previous version (no notification) - CHK_UPDATE_PREVIOUS_VERSION: 25, - // Update found for a version with the never preference set (no notification) - CHK_UPDATE_NEVER_PREF: 26, - // Update found without a type attribute (no notification) - CHK_UPDATE_INVALID_TYPE: 27, - // The system is no longer supported (system unsupported notification) - CHK_UNSUPPORTED: 28, - // Unable to apply updates (manual install to update notification) - CHK_UNABLE_TO_APPLY: 29, - // Unable to check for updates due to no OS version (no notification) - CHK_NO_OS_VERSION: 30, - // Unable to check for updates due to no OS ABI (no notification) - CHK_NO_OS_ABI: 31, - // Invalid url for app.update.url default preference (no notification) - CHK_INVALID_DEFAULT_URL: 32, - // Update elevation failures or cancelations threshold reached for this - // version, OSX only (no notification) - CHK_ELEVATION_DISABLED_FOR_VERSION: 35, - // User opted out of elevated updates for the available update version, OSX - // only (no notification) - CHK_ELEVATION_OPTOUT_FOR_VERSION: 36, - - /** - * Submit a telemetry ping for the update check result code or a telemetry - * ping for a count type histogram count when no update was found. The no - * update found ping is separate since it is the typical result, is less - * interesting than the other result codes, and it is easier to analyze the - * other codes without including it. - * - * @param aSuffix - * The histogram id suffix for histogram IDs: - * UPDATE_CHECK_CODE_EXTERNAL - * UPDATE_CHECK_CODE_NOTIFY - * UPDATE_CHECK_NO_UPDATE_EXTERNAL - * UPDATE_CHECK_NO_UPDATE_NOTIFY - * @param aCode - * An integer value as defined by the values that start with CHK_ in - * the above section. - */ - pingCheckCode: function UT_pingCheckCode(aSuffix, aCode) { - try { - if (aCode == this.CHK_NO_UPDATE_FOUND) { - let id = "UPDATE_CHECK_NO_UPDATE_" + aSuffix; - // count type histogram - Services.telemetry.getHistogramById(id).add(); - } else { - let id = "UPDATE_CHECK_CODE_" + aSuffix; - // enumerated type histogram - Services.telemetry.getHistogramById(id).add(aCode); - } - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for a failed update check's unhandled error code - * when the pingCheckCode is CHK_GENERAL_ERROR_SILENT. The histogram is a - * keyed count type with key names that are prefixed with 'AUS_CHECK_EX_ERR_'. - * - * @param aSuffix - * The histogram id suffix for histogram IDs: - * UPDATE_CHK_EXTENDED_ERROR_EXTERNAL - * UPDATE_CHK_EXTENDED_ERROR_NOTIFY - * @param aCode - * The extended error value return by a failed update check. - */ - pingCheckExError: function UT_pingCheckExError(aSuffix, aCode) { - try { - let id = "UPDATE_CHECK_EXTENDED_ERROR_" + aSuffix; - let val = "AUS_CHECK_EX_ERR_" + aCode; - // keyed count type histogram - Services.telemetry.getKeyedHistogramById(id).add(val); - } catch (e) { - Cu.reportError(e); - } - }, - - // The state code and if present the status error code were read on startup. - STARTUP: "STARTUP", - // The state code and status error code if present were read after staging. - STAGE: "STAGE", - - // Patch type Complete - PATCH_COMPLETE: "COMPLETE", - // Patch type partial - PATCH_PARTIAL: "PARTIAL", - // Patch type unknown - PATCH_UNKNOWN: "UNKNOWN", - - /** - * Values for the UPDATE_DOWNLOAD_CODE_COMPLETE and - * UPDATE_DOWNLOAD_CODE_PARTIAL Telemetry histograms. - */ - DWNLD_SUCCESS: 0, - DWNLD_RETRY_OFFLINE: 1, - DWNLD_RETRY_NET_TIMEOUT: 2, - DWNLD_RETRY_CONNECTION_REFUSED: 3, - DWNLD_RETRY_NET_RESET: 4, - DWNLD_ERR_NO_UPDATE: 5, - DWNLD_ERR_NO_UPDATE_PATCH: 6, - DWNLD_ERR_NO_PATCH_FILE: 7, - DWNLD_ERR_PATCH_SIZE_LARGER: 8, - DWNLD_ERR_PATCH_SIZE_NOT_EQUAL: 9, - DWNLD_ERR_BINDING_ABORTED: 10, - DWNLD_ERR_ABORT: 11, - DWNLD_ERR_DOCUMENT_NOT_CACHED: 12, - DWNLD_ERR_VERIFY_NO_REQUEST: 13, - DWNLD_ERR_VERIFY_PATCH_SIZE_NOT_EQUAL: 14, - DWNLD_ERR_VERIFY_NO_HASH_MATCH: 15, - - /** - * Submit a telemetry ping for the update download result code. - * - * @param aIsComplete - * If true the histogram is for a patch type complete, if false the - * histogram is for a patch type partial, and when undefined the - * histogram is for an unknown patch type. This is used to determine - * the histogram ID out of the following histogram IDs: - * UPDATE_DOWNLOAD_CODE_COMPLETE - * UPDATE_DOWNLOAD_CODE_PARTIAL - * @param aCode - * An integer value as defined by the values that start with DWNLD_ in - * the above section. - */ - pingDownloadCode: function UT_pingDownloadCode(aIsComplete, aCode) { - let patchType = this.PATCH_UNKNOWN; - if (aIsComplete === true) { - patchType = this.PATCH_COMPLETE; - } else if (aIsComplete === false) { - patchType = this.PATCH_PARTIAL; - } - try { - let id = "UPDATE_DOWNLOAD_CODE_" + patchType; - // enumerated type histogram - Services.telemetry.getHistogramById(id).add(aCode); - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for the update status state code. - * - * @param aSuffix - * The histogram id suffix for histogram IDs: - * UPDATE_STATE_CODE_COMPLETE_STARTUP - * UPDATE_STATE_CODE_PARTIAL_STARTUP - * UPDATE_STATE_CODE_UNKNOWN_STARTUP - * UPDATE_STATE_CODE_COMPLETE_STAGE - * UPDATE_STATE_CODE_PARTIAL_STAGE - * UPDATE_STATE_CODE_UNKNOWN_STAGE - * @param aCode - * An integer value as defined by the values that start with STATE_ in - * the above section for the update state from the update.status file. - */ - pingStateCode: function UT_pingStateCode(aSuffix, aCode) { - try { - let id = "UPDATE_STATE_CODE_" + aSuffix; - // enumerated type histogram - Services.telemetry.getHistogramById(id).add(aCode); - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for the update status error code. This does not - * submit a success value which can be determined from the state code. - * - * @param aSuffix - * The histogram id suffix for histogram IDs: - * UPDATE_STATUS_ERROR_CODE_COMPLETE_STARTUP - * UPDATE_STATUS_ERROR_CODE_PARTIAL_STARTUP - * UPDATE_STATUS_ERROR_CODE_UNKNOWN_STARTUP - * UPDATE_STATUS_ERROR_CODE_COMPLETE_STAGE - * UPDATE_STATUS_ERROR_CODE_PARTIAL_STAGE - * UPDATE_STATUS_ERROR_CODE_UNKNOWN_STAGE - * @param aCode - * An integer value for the error code from the update.status file. - */ - pingStatusErrorCode: function UT_pingStatusErrorCode(aSuffix, aCode) { - try { - let id = "UPDATE_STATUS_ERROR_CODE_" + aSuffix; - // enumerated type histogram - Services.telemetry.getHistogramById(id).add(aCode); - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit the interval in days since the last notification for this background - * update check or a boolean if the last notification is in the future. - * - * @param aSuffix - * The histogram id suffix for histogram IDs: - * UPDATE_INVALID_LASTUPDATETIME_EXTERNAL - * UPDATE_INVALID_LASTUPDATETIME_NOTIFY - * UPDATE_LAST_NOTIFY_INTERVAL_DAYS_EXTERNAL - * UPDATE_LAST_NOTIFY_INTERVAL_DAYS_NOTIFY - */ - pingLastUpdateTime: function UT_pingLastUpdateTime(aSuffix) { - const PREF_APP_UPDATE_LASTUPDATETIME = "app.update.lastUpdateTime.background-update-timer"; - if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_LASTUPDATETIME)) { - let lastUpdateTimeSeconds = Services.prefs.getIntPref(PREF_APP_UPDATE_LASTUPDATETIME); - if (lastUpdateTimeSeconds) { - let currentTimeSeconds = Math.round(Date.now() / 1000); - if (lastUpdateTimeSeconds > currentTimeSeconds) { - try { - let id = "UPDATE_INVALID_LASTUPDATETIME_" + aSuffix; - // count type histogram - Services.telemetry.getHistogramById(id).add(); - } catch (e) { - Cu.reportError(e); - } - } else { - let intervalDays = (currentTimeSeconds - lastUpdateTimeSeconds) / - (60 * 60 * 24); - try { - let id = "UPDATE_LAST_NOTIFY_INTERVAL_DAYS_" + aSuffix; - // exponential type histogram - Services.telemetry.getHistogramById(id).add(intervalDays); - } catch (e) { - Cu.reportError(e); - } - } - } - } - }, - - /** - * Submit a telemetry ping for the last page displayed by the update wizard. - * - * @param aPageID - * The page id for the last page displayed. - */ - pingWizLastPageCode: function UT_pingWizLastPageCode(aPageID) { - let pageMap = { invalid: 0, - dummy: 1, - checking: 2, - pluginupdatesfound: 3, - noupdatesfound: 4, - manualUpdate: 5, - unsupported: 6, - updatesfoundbasic: 8, - updatesfoundbillboard: 9, - downloading: 12, - errors: 13, - errorextra: 14, - errorpatching: 15, - finished: 16, - finishedBackground: 17, - installed: 18 }; - try { - let id = "UPDATE_WIZ_LAST_PAGE_CODE"; - // enumerated type histogram - Services.telemetry.getHistogramById(id).add(pageMap[aPageID] || - pageMap.invalid); - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for a boolean type histogram that indicates if the - * service is installed and a telemetry ping for a boolean type histogram that - * indicates if the service was at some point installed and is now - * uninstalled. - * - * @param aSuffix - * The histogram id suffix for histogram IDs: - * UPDATE_SERVICE_INSTALLED_EXTERNAL - * UPDATE_SERVICE_INSTALLED_NOTIFY - * UPDATE_SERVICE_MANUALLY_UNINSTALLED_EXTERNAL - * UPDATE_SERVICE_MANUALLY_UNINSTALLED_NOTIFY - * @param aInstalled - * Whether the service is installed. - */ - pingServiceInstallStatus: function UT_PSIS(aSuffix, aInstalled) { - // Report the error but don't throw since it is more important to - // successfully update than to throw. - if (!("@mozilla.org/windows-registry-key;1" in Cc)) { - Cu.reportError(Cr.NS_ERROR_NOT_AVAILABLE); - return; - } - - try { - let id = "UPDATE_SERVICE_INSTALLED_" + aSuffix; - // boolean type histogram - Services.telemetry.getHistogramById(id).add(aInstalled); - } catch (e) { - Cu.reportError(e); - } - - let attempted = 0; - try { - let wrk = Cc["@mozilla.org/windows-registry-key;1"]. - createInstance(Ci.nsIWindowsRegKey); - wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE, - "SOFTWARE\\Mozilla\\MaintenanceService", - wrk.ACCESS_READ | wrk.WOW64_64); - // Was the service at some point installed, but is now uninstalled? - attempted = wrk.readIntValue("Attempted"); - wrk.close(); - } catch (e) { - // Since this will throw if the registry key doesn't exist (e.g. the - // service has never been installed) don't report an error. - } - - try { - let id = "UPDATE_SERVICE_MANUALLY_UNINSTALLED_" + aSuffix; - if (!aInstalled && attempted) { - // count type histogram - Services.telemetry.getHistogramById(id).add(); - } - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for a count type histogram when the expected value - * does not equal the boolean value of a pref or if the pref isn't present - * when the expected value does not equal default value. This lessens the - * amount of data submitted to telemetry. - * - * @param aID - * The histogram ID to report to. - * @param aPref - * The preference to check. - * @param aDefault - * The default value when the preference isn't present. - * @param aExpected (optional) - * If specified and the value is the same as the value that will be - * added the value won't be added to telemetry. - */ - pingBoolPref: function UT_pingBoolPref(aID, aPref, aDefault, aExpected) { - try { - let val = aDefault; - if (Services.prefs.getPrefType(aPref) != Ci.nsIPrefBranch.PREF_INVALID) { - val = Services.prefs.getBoolPref(aPref); - } - if (val != aExpected) { - // count type histogram - Services.telemetry.getHistogramById(aID).add(); - } - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for a histogram with the integer value of a - * preference when it is not the expected value or the default value when it - * is not the expected value. This lessens the amount of data submitted to - * telemetry. - * - * @param aID - * The histogram ID to report to. - * @param aPref - * The preference to check. - * @param aDefault - * The default value when the pref is not set. - * @param aExpected (optional) - * If specified and the value is the same as the value that will be - * added the value won't be added to telemetry. - */ - pingIntPref: function UT_pingIntPref(aID, aPref, aDefault, aExpected) { - try { - let val = aDefault; - if (Services.prefs.getPrefType(aPref) != Ci.nsIPrefBranch.PREF_INVALID) { - val = Services.prefs.getIntPref(aPref); - } - if (aExpected === undefined || val != aExpected) { - // enumerated or exponential type histogram - Services.telemetry.getHistogramById(aID).add(val); - } - } catch (e) { - Cu.reportError(e); - } - }, - - /** - * Submit a telemetry ping for all histogram types that take a single - * parameter to the telemetry add function and the count type histogram when - * the aExpected parameter is specified. If the aExpected parameter is - * specified and it equals the value specified by the aValue - * parameter the telemetry submission will be skipped. - * - * @param aID - * The histogram ID to report to. - * @param aValue - * The value to add when aExpected is not defined or the value to - * check if it is equal to when aExpected is defined. - * @param aExpected (optional) - * If specified and the value is the same as the value specified by - * aValue parameter the submission will be skipped. - */ - pingGeneric: function UT_pingGeneric(aID, aValue, aExpected) { - try { - if (aExpected === undefined) { - Services.telemetry.getHistogramById(aID).add(aValue); - } else if (aValue != aExpected) { - // count type histogram - Services.telemetry.getHistogramById(aID).add(); - } - } catch (e) { - Cu.reportError(e); - } - } -}; -Object.freeze(AUSTLMY); diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js index 9996014b5..3e05566f1 100644 --- a/toolkit/mozapps/update/content/updates.js +++ b/toolkit/mozapps/update/content/updates.js @@ -11,10 +11,9 @@ // so we have to use different names. const {classes: CoC, interfaces: CoI, results: CoR, utils: CoU} = Components; -/* globals DownloadUtils, Services, AUSTLMY */ +/* globals DownloadUtils, Services */ CoU.import("resource://gre/modules/DownloadUtils.jsm", this); CoU.import("resource://gre/modules/Services.jsm", this); -CoU.import("resource://gre/modules/UpdateTelemetry.jsm", this); const XMLNS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; @@ -115,15 +114,6 @@ var gUpdates = { */ _runUnload: true, - /** - * Submit on close telemtry values for the update wizard. - * @param pageID - * The page id for the last page displayed. - */ - _submitTelemetry: function(aPageID) { - AUSTLMY.pingWizLastPageCode(aPageID); - }, - /** * Helper function for setButtons * Resets button to original label & accesskey if string is null. @@ -242,7 +232,6 @@ var gUpdates = { var pageid = document.documentElement.currentPage.pageid; if ("onWizardFinish" in this._pages[pageid]) this._pages[pageid].onWizardFinish(); - this._submitTelemetry(pageid); }, /** @@ -254,7 +243,6 @@ var gUpdates = { var pageid = document.documentElement.currentPage.pageid; if ("onWizardCancel" in this._pages[pageid]) this._pages[pageid].onWizardCancel(); - this._submitTelemetry(pageid); }, /** diff --git a/toolkit/mozapps/update/moz.build b/toolkit/mozapps/update/moz.build index 78a6996b7..5f1d56764 100644 --- a/toolkit/mozapps/update/moz.build +++ b/toolkit/mozapps/update/moz.build @@ -23,10 +23,6 @@ EXTRA_COMPONENTS += [ 'nsUpdateServiceStub.js', ] -EXTRA_JS_MODULES += [ - 'UpdateTelemetry.jsm', -] - JAR_MANIFESTS += ['jar.mn'] with Files('**'): diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index d9d09ba46..a68d815aa 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -12,7 +12,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/FileUtils.jsm", this); Cu.import("resource://gre/modules/Services.jsm", this); Cu.import("resource://gre/modules/ctypes.jsm", this); -Cu.import("resource://gre/modules/UpdateTelemetry.jsm", this); Cu.import("resource://gre/modules/AppConstants.jsm", this); Cu.importGlobalProperties(["XMLHttpRequest"]); @@ -950,63 +949,6 @@ function handleFallbackToCompleteUpdate(update, postStaging) { } function pingStateAndStatusCodes(aUpdate, aStartup, aStatus) { - let patchType = AUSTLMY.PATCH_UNKNOWN; - if (aUpdate && aUpdate.selectedPatch && aUpdate.selectedPatch.type) { - if (aUpdate.selectedPatch.type == "complete") { - patchType = AUSTLMY.PATCH_COMPLETE; - } else if (aUpdate.selectedPatch.type == "partial") { - patchType = AUSTLMY.PATCH_PARTIAL; - } - } - - let suffix = patchType + "_" + (aStartup ? AUSTLMY.STARTUP : AUSTLMY.STAGE); - let stateCode = 0; - let parts = aStatus.split(":"); - if (parts.length > 0) { - switch (parts[0]) { - case STATE_NONE: - stateCode = 2; - break; - case STATE_DOWNLOADING: - stateCode = 3; - break; - case STATE_PENDING: - stateCode = 4; - break; - case STATE_APPLYING: - stateCode = 6; - break; - case STATE_APPLIED: - stateCode = 7; - break; - case STATE_APPLIED_OS: - stateCode = 8; - break; - case STATE_SUCCEEDED: - stateCode = 10; - break; - case STATE_DOWNLOAD_FAILED: - stateCode = 11; - break; - case STATE_FAILED: - stateCode = 12; - break; - case STATE_PENDING_ELEVATE: - stateCode = 13; - break; - default: - stateCode = 1; - } - - if (parts.length > 1) { - let statusErrorCode = INVALID_UPDATER_STATE_CODE; - if (parts[0] == STATE_FAILED) { - statusErrorCode = parseInt(parts[1]) || INVALID_UPDATER_STATUS_CODE; - } - AUSTLMY.pingStatusErrorCode(suffix, statusErrorCode); - } - } - AUSTLMY.pingStateCode(suffix, stateCode); } /** @@ -1764,14 +1706,9 @@ UpdateService.prototype = { if (update.errorCode == NETWORK_ERROR_OFFLINE) { // Register an online observer to try again this._registerOnlineObserver(); - if (this._pingSuffix) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_OFFLINE); - } return; } - // Send the error code to telemetry - AUSTLMY.pingCheckExError(this._pingSuffix, update.errorCode); update.errorCode = BACKGROUNDCHECK_MULTIPLE_FAILURES; let errCount = Services.prefs.getIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, 0); errCount++; @@ -1783,9 +1720,6 @@ UpdateService.prototype = { let prompter = Cc["@mozilla.org/updates/update-prompt;1"]. createInstance(Ci.nsIUpdatePrompt); prompter.showUpdateError(update); - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_GENERAL_ERROR_PROMPT); - } else { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_GENERAL_ERROR_SILENT); } }, @@ -1830,11 +1764,6 @@ UpdateService.prototype = { this._checkForBackgroundUpdates(false); }, - // The suffix used for background update check telemetry histogram ID's. - get _pingSuffix() { - return this._isNotify ? AUSTLMY.NOTIFY : AUSTLMY.EXTERNAL; - }, - /** * Checks for updates in the background. * @param isNotify @@ -1844,119 +1773,10 @@ UpdateService.prototype = { _checkForBackgroundUpdates: function AUS__checkForBackgroundUpdates(isNotify) { this._isNotify = isNotify; - // Histogram IDs: - // UPDATE_PING_COUNT_EXTERNAL - // UPDATE_PING_COUNT_NOTIFY - AUSTLMY.pingGeneric("UPDATE_PING_COUNT_" + this._pingSuffix, - true, false); - - // Histogram IDs: - // UPDATE_UNABLE_TO_APPLY_EXTERNAL - // UPDATE_UNABLE_TO_APPLY_NOTIFY - AUSTLMY.pingGeneric("UPDATE_UNABLE_TO_APPLY_" + this._pingSuffix, - getCanApplyUpdates(), true); - // Histogram IDs: - // UPDATE_CANNOT_STAGE_EXTERNAL - // UPDATE_CANNOT_STAGE_NOTIFY - AUSTLMY.pingGeneric("UPDATE_CANNOT_STAGE_" + this._pingSuffix, - getCanStageUpdates(), true); - // Histogram IDs: - // UPDATE_INVALID_LASTUPDATETIME_EXTERNAL - // UPDATE_INVALID_LASTUPDATETIME_NOTIFY - // UPDATE_LAST_NOTIFY_INTERVAL_DAYS_EXTERNAL - // UPDATE_LAST_NOTIFY_INTERVAL_DAYS_NOTIFY - AUSTLMY.pingLastUpdateTime(this._pingSuffix); - // Histogram IDs: - // UPDATE_NOT_PREF_UPDATE_ENABLED_EXTERNAL - // UPDATE_NOT_PREF_UPDATE_ENABLED_NOTIFY - AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_ENABLED_" + this._pingSuffix, - PREF_APP_UPDATE_ENABLED, true, true); - // Histogram IDs: - // UPDATE_NOT_PREF_UPDATE_AUTO_EXTERNAL - // UPDATE_NOT_PREF_UPDATE_AUTO_NOTIFY - AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_AUTO_" + this._pingSuffix, - PREF_APP_UPDATE_AUTO, true, true); - // Histogram IDs: - // UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_EXTERNAL - // UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_NOTIFY - AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_STAGING_ENABLED_" + - this._pingSuffix, - PREF_APP_UPDATE_STAGING_ENABLED, true, true); - if (AppConstants.platform == "win" || AppConstants.platform == "macosx") { - // Histogram IDs: - // UPDATE_PREF_UPDATE_CANCELATIONS_EXTERNAL - // UPDATE_PREF_UPDATE_CANCELATIONS_NOTIFY - AUSTLMY.pingIntPref("UPDATE_PREF_UPDATE_CANCELATIONS_" + this._pingSuffix, - PREF_APP_UPDATE_CANCELATIONS, 0, 0); - } - if (AppConstants.platform == "macosx") { - // Histogram IDs: - // UPDATE_PREF_UPDATE_CANCELATIONS_OSX_EXTERNAL - // UPDATE_PREF_UPDATE_CANCELATIONS_OSX_NOTIFY - AUSTLMY.pingIntPref("UPDATE_PREF_UPDATE_CANCELATIONS_OSX_" + - this._pingSuffix, - PREF_APP_UPDATE_CANCELATIONS_OSX, 0, 0); - } - let prefType = Services.prefs.getPrefType(PREF_APP_UPDATE_URL_OVERRIDE); - let overridePrefHasValue = prefType != Ci.nsIPrefBranch.PREF_INVALID; - // Histogram IDs: - // UPDATE_HAS_PREF_URL_OVERRIDE_EXTERNAL - // UPDATE_HAS_PREF_URL_OVERRIDE_NOTIFY - AUSTLMY.pingGeneric("UPDATE_HAS_PREF_URL_OVERRIDE_" + this._pingSuffix, - overridePrefHasValue, false); - - // If a download is in progress or the patch has been staged do nothing. - if (this.isDownloading) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_DOWNLOADING); - return; - } - if (this._downloader && this._downloader.patchIsStaged) { - let readState = readStatusFile(getUpdatesDir()); - if (readState == STATE_PENDING || - readState == STATE_PENDING_ELEVATE) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_DOWNLOADED); - } else { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_STAGED); - } return; } - let validUpdateURL = true; - try { - this.backgroundChecker.getUpdateURL(false); - } catch (e) { - validUpdateURL = false; - } - // The following checks are done here so they can be differentiated from - // foreground checks. - if (!UpdateUtils.OSVersion) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_VERSION); - } else if (!UpdateUtils.ABI) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_ABI); - } else if (!validUpdateURL) { - if (overridePrefHasValue) { - if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) { - AUSTLMY.pingCheckCode(this._pingSuffix, - AUSTLMY.CHK_INVALID_USER_OVERRIDE_URL); - } else { - AUSTLMY.pingCheckCode(this._pingSuffix, - AUSTLMY.CHK_INVALID_DEFAULT_OVERRIDE_URL); - } - } else { - AUSTLMY.pingCheckCode(this._pingSuffix, - AUSTLMY.CHK_INVALID_DEFAULT_URL); - } - } else if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true)) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED); - } else if (!hasUpdateMutex()) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_MUTEX); - } else if (!gCanCheckForUpdates) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNABLE_TO_CHECK); - } else if (!this.backgroundChecker._enabled) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_DISABLED_FOR_SESSION); - } - this.backgroundChecker.checkForUpdates(this, false); }, @@ -1970,7 +1790,6 @@ UpdateService.prototype = { */ selectUpdate: function AUS_selectUpdate(updates) { if (updates.length == 0) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_UPDATE_FOUND); return null; } @@ -1983,7 +1802,6 @@ UpdateService.prototype = { var majorUpdate = null; var minorUpdate = null; var vc = Services.vc; - let lastCheckCode = AUSTLMY.CHK_NO_COMPAT_UPDATE_FOUND; updates.forEach(function(aUpdate) { // Ignore updates for older versions of the applications and updates for @@ -1996,7 +1814,6 @@ UpdateService.prototype = { LOG("UpdateService:selectUpdate - skipping update because the " + "update's application version is less than or equal to " + "the current application version."); - lastCheckCode = AUSTLMY.CHK_UPDATE_PREVIOUS_VERSION; return; } @@ -2008,7 +1825,6 @@ UpdateService.prototype = { Services.prefs.getBoolPref(neverPrefName, false)) { LOG("UpdateService:selectUpdate - skipping update because the " + "preference " + neverPrefName + " is true"); - lastCheckCode = AUSTLMY.CHK_UPDATE_NEVER_PREF; return; } @@ -2028,7 +1844,6 @@ UpdateService.prototype = { default: LOG("UpdateService:selectUpdate - skipping unknown update type: " + aUpdate.type); - lastCheckCode = AUSTLMY.CHK_UPDATE_INVALID_TYPE; break; } }); @@ -2059,16 +1874,11 @@ UpdateService.prototype = { "install this update, but the user has exceeded the max " + "number of elevation attempts."); update.elevationFailure = true; - AUSTLMY.pingCheckCode( - this._pingSuffix, - AUSTLMY.CHK_ELEVATION_DISABLED_FOR_VERSION); } else if (vc.compare(rejectedVersion, update.appVersion) == 0) { LOG("UpdateService:selectUpdate - the user requires elevation to " + "install this update, but elevation is disabled for this " + "version."); update.elevationFailure = true; - AUSTLMY.pingCheckCode(this._pingSuffix, - AUSTLMY.CHK_ELEVATION_OPTOUT_FOR_VERSION); } else { LOG("UpdateService:selectUpdate - the user requires elevation to " + "install the update."); @@ -2088,8 +1898,6 @@ UpdateService.prototype = { Services.prefs.clearUserPref(PREF_APP_UPDATE_ELEVATE_NEVER); } } - } else if (!update) { - AUSTLMY.pingCheckCode(this._pingSuffix, lastCheckCode); } return update; @@ -2107,13 +1915,11 @@ UpdateService.prototype = { var um = Cc["@mozilla.org/updates/update-manager;1"]. getService(Ci.nsIUpdateManager); if (um.activeUpdate) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_HAS_ACTIVEUPDATE); return; } var updateEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true); if (!updateEnabled) { - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED); LOG("UpdateService:_selectAndInstallUpdate - not prompting because " + "update is disabled"); return; @@ -2132,7 +1938,6 @@ UpdateService.prototype = { "update is not supported for this system"); this._showPrompt(update); } - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNSUPPORTED); return; } @@ -2140,7 +1945,6 @@ UpdateService.prototype = { LOG("UpdateService:_selectAndInstallUpdate - the user is unable to " + "apply updates... prompting"); this._showPrompt(update); - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_UNABLE_TO_APPLY); return; } @@ -2163,7 +1967,6 @@ UpdateService.prototype = { if (update.showPrompt) { LOG("UpdateService:_selectAndInstallUpdate - prompting because the " + "update snippet specified showPrompt"); - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_SNIPPET); this._showPrompt(update); return; } @@ -2171,7 +1974,6 @@ UpdateService.prototype = { if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO, true)) { LOG("UpdateService:_selectAndInstallUpdate - prompting because silent " + "install is disabled"); - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF); this._showPrompt(update); return; } @@ -2181,7 +1983,6 @@ UpdateService.prototype = { if (status == STATE_NONE) { cleanupActiveUpdate(); } - AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_DOWNLOAD_UPDATE); }, _showPrompt: function AUS__showPrompt(update) { @@ -3087,8 +2888,6 @@ Downloader.prototype = { _verifyDownload: function Downloader__verifyDownload() { LOG("Downloader:_verifyDownload called"); if (!this._request) { - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_ERR_VERIFY_NO_REQUEST); return false; } @@ -3097,8 +2896,6 @@ Downloader.prototype = { // Ensure that the file size matches the expected file size. if (destination.fileSize != this._patch.size) { LOG("Downloader:_verifyDownload downloaded size != expected size."); - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_ERR_VERIFY_PATCH_SIZE_NOT_EQUAL); return false; } @@ -3143,8 +2940,6 @@ Downloader.prototype = { } LOG("Downloader:_verifyDownload hashes do not match. "); - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_ERR_VERIFY_NO_HASH_MATCH); return false; }, @@ -3271,7 +3066,6 @@ Downloader.prototype = { downloadUpdate: function Downloader_downloadUpdate(update) { LOG("UpdateService:_downloadUpdate"); if (!update) { - AUSTLMY.pingDownloadCode(undefined, AUSTLMY.DWNLD_ERR_NO_UPDATE); throw Cr.NS_ERROR_NULL_POINTER; } @@ -3284,7 +3078,6 @@ Downloader.prototype = { this._patch = this._selectPatch(update, updateDir); if (!this._patch) { LOG("Downloader:downloadUpdate - no patch to download"); - AUSTLMY.pingDownloadCode(undefined, AUSTLMY.DWNLD_ERR_NO_UPDATE_PATCH); return readStatusFile(updateDir); } this.isCompleteUpdate = this._patch.type == "complete"; @@ -3296,8 +3089,6 @@ Downloader.prototype = { patchFile = this._getUpdateArchiveFile(); } if (!patchFile) { - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_ERR_NO_PATCH_FILE); return STATE_NONE; } @@ -3401,8 +3192,6 @@ Downloader.prototype = { // It's important that we use a different code than // NS_ERROR_CORRUPTED_CONTENT so that tests can verify the difference // between a hash error and a wrong download error. - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_ERR_PATCH_SIZE_LARGER); this.cancel(Cr.NS_ERROR_UNEXPECTED); return; } @@ -3413,8 +3202,6 @@ Downloader.prototype = { // It's important that we use a different code than // NS_ERROR_CORRUPTED_CONTENT so that tests can verify the difference // between a hash error and a wrong download error. - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_ERR_PATCH_SIZE_NOT_EQUAL); this.cancel(Cr.NS_ERROR_UNEXPECTED); return; } @@ -3495,7 +3282,6 @@ Downloader.prototype = { if (this.background) { shouldShowPrompt = !getCanStageUpdates(); } - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, AUSTLMY.DWNLD_SUCCESS); // Tell the updater.exe we're ready to apply. writeStatusFile(getUpdatesDir(), state); @@ -3525,8 +3311,6 @@ Downloader.prototype = { // calling downloadUpdate on the active update which continues // downloading the file from where it was. LOG("Downloader:onStopRequest - offline, register online observer: true"); - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, - AUSTLMY.DWNLD_RETRY_OFFLINE); shouldRegisterOnlineObserver = true; deleteActiveUpdate = false; // Each of NS_ERROR_NET_TIMEOUT, ERROR_CONNECTION_REFUSED, @@ -3540,25 +3324,11 @@ Downloader.prototype = { status == Cr.NS_ERROR_DOCUMENT_NOT_CACHED) && this.updateService._consecutiveSocketErrors < maxFail) { LOG("Downloader:onStopRequest - socket error, shouldRetrySoon: true"); - let dwnldCode = AUSTLMY.DWNLD_RETRY_CONNECTION_REFUSED; - if (status == Cr.NS_ERROR_NET_TIMEOUT) { - dwnldCode = AUSTLMY.DWNLD_RETRY_NET_TIMEOUT; - } else if (status == Cr.NS_ERROR_NET_RESET) { - dwnldCode = AUSTLMY.DWNLD_RETRY_NET_RESET; - } else if (status == Cr.NS_ERROR_DOCUMENT_NOT_CACHED) { - dwnldCode = AUSTLMY.DWNLD_ERR_DOCUMENT_NOT_CACHED; - } - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, dwnldCode); shouldRetrySoon = true; deleteActiveUpdate = false; } else if (status != Cr.NS_BINDING_ABORTED && status != Cr.NS_ERROR_ABORT) { LOG("Downloader:onStopRequest - non-verification failure"); - let dwnldCode = AUSTLMY.DWNLD_ERR_BINDING_ABORTED; - if (status == Cr.NS_ERROR_ABORT) { - dwnldCode = AUSTLMY.DWNLD_ERR_ABORT; - } - AUSTLMY.pingDownloadCode(this.isCompleteUpdate, dwnldCode); // Some sort of other failure, log this in the |statusText| property state = STATE_DOWNLOAD_FAILED; diff --git a/tools/lint/eslint/modules.json b/tools/lint/eslint/modules.json index 30b5d3968..1ff546978 100644 --- a/tools/lint/eslint/modules.json +++ b/tools/lint/eslint/modules.json @@ -216,7 +216,6 @@ "ToolboxProcess.jsm": ["BrowserToolboxProcess"], "tps.jsm": ["ACTIONS", "TPS"], "Traversal.jsm": ["TraversalRules", "TraversalHelper"], - "UpdateTelemetry.jsm": ["AUSTLMY"], "userapi.js": ["UserAPI10Client"], "util.js": ["getChromeWindow", "XPCOMUtils", "Services", "Utils", "Async", "Svc", "Str"], "utils.js": ["applicationName", "assert", "Copy", "getBrowserObject", "getChromeWindow", "getWindows", "getWindowByTitle", "getWindowByType", "getWindowId", "getMethodInWindows", "getPreference", "saveDataURL", "setPreference", "sleep", "startTimer", "stopTimer", "takeScreenshot", "unwrapNode", "waitFor", "btoa", "encryptPayload", "isConfiguredWithLegacyIdentity", "ensureLegacyIdentityManager", "setBasicCredentials", "makeIdentityConfig", "configureIdentity", "SyncTestingInfrastructure", "waitForZeroTimer", "Promise", "add_identity_test", "MockFxaStorageManager", "AccountState", "sumHistogram", "CommonUtils", "CryptoUtils", "TestingUtils"], -- cgit v1.2.3 From 06f7a03ffdf2fd761e06803da8382d567348c1f2 Mon Sep 17 00:00:00 2001 From: wicknix <39230578+wicknix@users.noreply.github.com> Date: Wed, 15 May 2019 00:37:09 -0500 Subject: Fix scroll bar orientation on MacOS --- widget/cocoa/nsNativeThemeCocoa.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 597c25a48..fc4f7f2e9 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2778,9 +2778,8 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, NSMutableDictionary* options = [NSMutableDictionary dictionaryWithObjectsAndKeys: (isOverlay ? @"kCUIWidgetOverlayScrollBar" : @"scrollbar"), @"widget", (isSmall ? @"small" : @"regular"), @"size", - (isOverlay && isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), - @"kCUIVariantKey", - (isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), @"kCUIVariantKey", + (isHorizontal ? @"kCUIOrientHorizontal" : @"kCUIOrientVertical"), @"kCUIOrientationKey", + (isOverlay && isOnTopOfDarkBackground ? @"kCUIVariantWhite" : @""), @"kCUIVariantKey", [NSNumber numberWithBool:YES], @"indiconly", [NSNumber numberWithBool:YES], @"kCUIThumbProportionKey", [NSNumber numberWithBool:YES], @"is.flipped", -- cgit v1.2.3 From 34d5483ac3959a21c3cae2efa6f5ab1b64915a81 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 15 May 2019 12:45:10 +0200 Subject: Map IntersectionObserver rect to the correct viewport. targetFrame is modified during the intersection computation loop, so it's not the viewport you want if there are scrollframes around. This bug triggers when IntersectionObservers are used on frames that wrap. Follow-up for #249. --- dom/base/DOMIntersectionObserver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/base/DOMIntersectionObserver.cpp b/dom/base/DOMIntersectionObserver.cpp index 389b93071..70b5534ba 100644 --- a/dom/base/DOMIntersectionObserver.cpp +++ b/dom/base/DOMIntersectionObserver.cpp @@ -339,6 +339,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time for (size_t i = 0; i < mObservationTargets.Length(); ++i) { Element* target = mObservationTargets.ElementAt(i); nsIFrame* targetFrame = target->GetPrimaryFrame(); + nsIFrame* originalTargetFrame = targetFrame; nsRect targetRect; Maybe intersectionRect; bool isSameDoc = root && root->GetComposedDoc() == target->GetComposedDoc(); @@ -424,7 +425,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time ); if (intersectionRect.isSome() && !isSameDoc) { nsRect rect = intersectionRect.value(); - nsPresContext* presContext = targetFrame->PresContext(); + nsPresContext* presContext = originalTargetFrame->PresContext(); nsLayoutUtils::TransformRect(rootFrame, presContext->PresShell()->GetRootScrollFrame(), rect); intersectionRect = Some(rect); -- cgit v1.2.3 From 354c6dceecdad5e58e2763e937ad5053e8b7d897 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 17 May 2019 01:04:30 +0000 Subject: Implement String.prototype.trimStart and trimEnd. This renames our internal function names because *Left and *Right might be deprecated and have to be removed later, making that trivial. Resolves #1089 --- js/src/builtin/String.js | 12 ++++++------ js/src/jsstr.cpp | 16 ++++++++++------ js/src/jsstr.h | 4 ++-- js/src/vm/SelfHosting.cpp | 6 ++++-- 4 files changed, 22 insertions(+), 16 deletions(-) diff --git a/js/src/builtin/String.js b/js/src/builtin/String.js index e5b2ad552..f830b1aa2 100644 --- a/js/src/builtin/String.js +++ b/js/src/builtin/String.js @@ -828,16 +828,16 @@ function String_static_trim(string) { return callFunction(std_String_trim, string); } -function String_static_trimLeft(string) { +function String_static_trimStart(string) { if (arguments.length < 1) - ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimLeft'); - return callFunction(std_String_trimLeft, string); + ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimStart'); + return callFunction(std_String_trimStart, string); } -function String_static_trimRight(string) { +function String_static_trimEnd(string) { if (arguments.length < 1) - ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimRight'); - return callFunction(std_String_trimRight, string); + ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'String.trimEnd'); + return callFunction(std_String_trimEnd, string); } function String_static_toLocaleLowerCase(string) { diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index e3b5708ca..7765b1197 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1970,14 +1970,14 @@ js::str_trim(JSContext* cx, unsigned argc, Value* vp) } bool -js::str_trimLeft(JSContext* cx, unsigned argc, Value* vp) +js::str_trimStart(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); return TrimString(cx, args, true, false); } bool -js::str_trimRight(JSContext* cx, unsigned argc, Value* vp) +js::str_trimEnd(JSContext* cx, unsigned argc, Value* vp) { CallArgs args = CallArgsFromVp(argc, vp); return TrimString(cx, args, false, true); @@ -2568,8 +2568,10 @@ static const JSFunctionSpec string_methods[] = { JS_FN("startsWith", str_startsWith, 1,0), JS_FN("endsWith", str_endsWith, 1,0), JS_FN("trim", str_trim, 0,0), - JS_FN("trimLeft", str_trimLeft, 0,0), - JS_FN("trimRight", str_trimRight, 0,0), + JS_FN("trimLeft", str_trimStart, 0,0), + JS_FN("trimStart", str_trimStart, 0,0), + JS_FN("trimRight", str_trimEnd, 0,0), + JS_FN("trimEnd", str_trimEnd, 0,0), JS_FN("toLocaleLowerCase", str_toLocaleLowerCase, 0,0), JS_FN("toLocaleUpperCase", str_toLocaleUpperCase, 0,0), JS_SELF_HOSTED_FN("localeCompare", "String_localeCompare", 1,0), @@ -2881,8 +2883,10 @@ static const JSFunctionSpec string_static_methods[] = { JS_SELF_HOSTED_FN("startsWith", "String_static_startsWith", 2,0), JS_SELF_HOSTED_FN("endsWith", "String_static_endsWith", 2,0), JS_SELF_HOSTED_FN("trim", "String_static_trim", 1,0), - JS_SELF_HOSTED_FN("trimLeft", "String_static_trimLeft", 1,0), - JS_SELF_HOSTED_FN("trimRight", "String_static_trimRight", 1,0), + JS_SELF_HOSTED_FN("trimLeft", "String_static_trimStart", 1,0), + JS_SELF_HOSTED_FN("trimStart", "String_static_trimStart", 1,0), + JS_SELF_HOSTED_FN("trimRight", "String_static_trimEnd", 1,0), + JS_SELF_HOSTED_FN("trimEnd", "String_static_trimEnd", 1,0), JS_SELF_HOSTED_FN("toLocaleLowerCase","String_static_toLocaleLowerCase",1,0), JS_SELF_HOSTED_FN("toLocaleUpperCase","String_static_toLocaleUpperCase",1,0), JS_SELF_HOSTED_FN("normalize", "String_static_normalize", 1,0), diff --git a/js/src/jsstr.h b/js/src/jsstr.h index 118118839..38fbfa85e 100644 --- a/js/src/jsstr.h +++ b/js/src/jsstr.h @@ -367,10 +367,10 @@ extern bool str_trim(JSContext* cx, unsigned argc, Value* vp); extern bool -str_trimLeft(JSContext* cx, unsigned argc, Value* vp); +str_trimStart(JSContext* cx, unsigned argc, Value* vp); extern bool -str_trimRight(JSContext* cx, unsigned argc, Value* vp); +str_trimEnd(JSContext* cx, unsigned argc, Value* vp); extern bool str_toLocaleLowerCase(JSContext* cx, unsigned argc, Value* vp); diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 328a960b6..ccd4cc8d7 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -2200,8 +2200,10 @@ static const JSFunctionSpec intrinsic_functions[] = { JS_INLINABLE_FN("std_String_charAt", str_charAt, 1,0, StringCharAt), JS_FN("std_String_endsWith", str_endsWith, 1,0), JS_FN("std_String_trim", str_trim, 0,0), - JS_FN("std_String_trimLeft", str_trimLeft, 0,0), - JS_FN("std_String_trimRight", str_trimRight, 0,0), + JS_FN("std_String_trimLeft", str_trimStart, 0,0), + JS_FN("std_String_trimStart", str_trimStart, 0,0), + JS_FN("std_String_trimRight", str_trimEnd, 0,0), + JS_FN("std_String_trimEnd", str_trimEnd, 0,0), JS_FN("std_String_toLocaleLowerCase", str_toLocaleLowerCase, 0,0), JS_FN("std_String_toLocaleUpperCase", str_toLocaleUpperCase, 0,0), JS_FN("std_String_normalize", str_normalize, 0,0), -- cgit v1.2.3 From c72afc3c8c3f1df53d241c45dd21aa1b2a6c8e50 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 17 May 2019 01:57:45 +0000 Subject: Add nullcheck. This resolves #1088 --- dom/xslt/base/txURIUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dom/xslt/base/txURIUtils.cpp b/dom/xslt/base/txURIUtils.cpp index 3f3556f80..bce2f8d0f 100644 --- a/dom/xslt/base/txURIUtils.cpp +++ b/dom/xslt/base/txURIUtils.cpp @@ -45,6 +45,10 @@ void URIUtils::resolveHref(const nsAString& href, const nsAString& base, void URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsINode *aSourceNode) { + if (!aSourceNode) { + return; + } + nsCOMPtr sourceDoc = aSourceNode->OwnerDoc(); nsIPrincipal* sourcePrincipal = sourceDoc->NodePrincipal(); -- cgit v1.2.3 From 162e22a7de3026b676156a2aad29909fe3795dba Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 19 May 2019 23:11:17 +0200 Subject: Implement array.flat and array.flatMap Self-hosted implementation that adds both functions and adds them to @@unscopables as specced in ES2019. Resolves #1095 --- js/src/builtin/Array.js | 108 ++++++++++++++++++++++++++++ js/src/jsarray.cpp | 7 ++ js/src/tests/ecma_6/Array/unscopables.js | 2 + js/src/vm/CommonPropertyNames.h | 2 + js/xpconnect/tests/chrome/test_xrayToJS.xul | 2 +- 5 files changed, 120 insertions(+), 1 deletion(-) diff --git a/js/src/builtin/Array.js b/js/src/builtin/Array.js index 30e6fb35f..05fc41bc1 100644 --- a/js/src/builtin/Array.js +++ b/js/src/builtin/Array.js @@ -1073,6 +1073,114 @@ function ArrayConcat(arg1) { return A; } +// https://tc39.github.io/proposal-flatMap/ +// January 4, 2019 +function ArrayFlatMap(mapperFunction/*, thisArg*/) { + // Step 1. + var O = ToObject(this); + + // Step 2. + var sourceLen = ToLength(O.length); + + // Step 3. + if (!IsCallable(mapperFunction)) + ThrowTypeError(JSMSG_NOT_FUNCTION, DecompileArg(0, mapperFunction)); + + // Step 4. + var T = arguments.length > 1 ? arguments[1] : undefined; + + // Step 5. + var A = ArraySpeciesCreate(O, 0); + + // Step 6. + FlattenIntoArray(A, O, sourceLen, 0, 1, mapperFunction, T); + + // Step 7. + return A; +} + +// https://tc39.github.io/proposal-flatMap/ +// January 4, 2019 +function ArrayFlat(/* depth */) { + // Step 1. + var O = ToObject(this); + + // Step 2. + var sourceLen = ToLength(O.length); + + // Step 3. + var depthNum = 1; + + // Step 4. + if (arguments.length > 0 && arguments[0] !== undefined) + depthNum = ToInteger(arguments[0]); + + // Step 5. + var A = ArraySpeciesCreate(O, 0); + + // Step 6. + FlattenIntoArray(A, O, sourceLen, 0, depthNum); + + // Step 7. + return A; +} + +// https://tc39.github.io/proposal-flatMap/ +// January 4, 2019 +function FlattenIntoArray(target, source, sourceLen, start, depth, mapperFunction, thisArg) { + // Step 1. + var targetIndex = start; + + // Steps 2-3. + for (var sourceIndex = 0; sourceIndex < sourceLen; sourceIndex++) { + // Steps 3.a-c. + if (sourceIndex in source) { + // Step 3.c.i. + var element = source[sourceIndex]; + + if (mapperFunction) { + // Step 3.c.ii.1. + assert(arguments.length === 7, "thisArg is present"); + + // Step 3.c.ii.2. + element = callContentFunction(mapperFunction, thisArg, element, sourceIndex, source); + } + + // Step 3.c.iii. + var shouldFlatten = false; + + // Step 3.c.iv. + if (depth > 0) { + // Step 3.c.iv.1. + shouldFlatten = IsArray(element); + } + + // Step 3.c.v. + if (shouldFlatten) { + // Step 3.c.v.1. + var elementLen = ToLength(element.length); + + // Step 3.c.v.2. + // Recursive call to walk the depth. + targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + // Step 3.c.vi.1. + if (targetIndex >= MAX_NUMERIC_INDEX) + ThrowTypeError(JSMSG_TOO_LONG_ARRAY); + + // Step 3.c.vi.2. + _DefineDataProperty(target, targetIndex, element); + + // Step 3.c.vi.3. + targetIndex++; + } + } + } + + // Step 4. + return targetIndex; +} + function ArrayStaticConcat(arr, arg1) { if (arguments.length < 1) ThrowTypeError(JSMSG_MISSING_FUN_ARG, 0, 'Array.concat'); diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 7a67c0095..3b4c957dc 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -3169,6 +3169,11 @@ static const JSFunctionSpec array_methods[] = { /* ES7 additions */ JS_SELF_HOSTED_FN("includes", "ArrayIncludes", 2,0), + + /* ES2019 additions */ + JS_SELF_HOSTED_FN("flat", "ArrayFlat", 0,0), + JS_SELF_HOSTED_FN("flatMap", "ArrayFlatMap", 1,0), + JS_FS_END }; @@ -3333,6 +3338,8 @@ array_proto_finish(JSContext* cx, JS::HandleObject ctor, JS::HandleObject proto) !DefineProperty(cx, unscopables, cx->names().fill, value) || !DefineProperty(cx, unscopables, cx->names().find, value) || !DefineProperty(cx, unscopables, cx->names().findIndex, value) || + !DefineProperty(cx, unscopables, cx->names().flat, value) || + !DefineProperty(cx, unscopables, cx->names().flatMap, value) || !DefineProperty(cx, unscopables, cx->names().includes, value) || !DefineProperty(cx, unscopables, cx->names().keys, value) || !DefineProperty(cx, unscopables, cx->names().values, value)) diff --git a/js/src/tests/ecma_6/Array/unscopables.js b/js/src/tests/ecma_6/Array/unscopables.js index 6685309a0..56b3aa520 100644 --- a/js/src/tests/ecma_6/Array/unscopables.js +++ b/js/src/tests/ecma_6/Array/unscopables.js @@ -26,6 +26,8 @@ assertDeepEq(keys, [ "fill", "find", "findIndex", + "flat", + "flatMap", "includes", "keys", "values" diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h index e971dc844..8a36df083 100644 --- a/js/src/vm/CommonPropertyNames.h +++ b/js/src/vm/CommonPropertyNames.h @@ -115,6 +115,8 @@ macro(firstDayOfWeek, firstDayOfWeek, "firstDayOfWeek") \ macro(fix, fix, "fix") \ macro(flags, flags, "flags") \ + macro(flat, flat, "flat") \ + macro(flatMap, flatMap, "flatMap") \ macro(float32, float32, "float32") \ macro(Float32x4, Float32x4, "Float32x4") \ macro(float64, float64, "float64") \ diff --git a/js/xpconnect/tests/chrome/test_xrayToJS.xul b/js/xpconnect/tests/chrome/test_xrayToJS.xul index ed67a34fe..73de267a1 100644 --- a/js/xpconnect/tests/chrome/test_xrayToJS.xul +++ b/js/xpconnect/tests/chrome/test_xrayToJS.xul @@ -198,7 +198,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=933681 "pop", "shift", "unshift", "splice", "concat", "slice", "lastIndexOf", "indexOf", "includes", "forEach", "map", "reduce", "reduceRight", "filter", "some", "every", "find", "findIndex", "copyWithin", "fill", Symbol.iterator, Symbol.unscopables, "entries", "keys", - "values", "constructor"]; + "values", "constructor", "flat", "flatMap"]; if (isNightlyBuild) { // ...nothing now } -- cgit v1.2.3 From 41731a7f31a1724e74b32eb7be87de2719f977c3 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 20 May 2019 02:50:01 +0200 Subject: =?UTF-8?q?Implement=20Symbol=E2=80=8B.prototype=E2=80=8B.descript?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #1096 --- js/src/builtin/SymbolObject.cpp | 29 +++++++++++++++++++++++++++++ js/src/builtin/SymbolObject.h | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/js/src/builtin/SymbolObject.cpp b/js/src/builtin/SymbolObject.cpp index cf48402d6..ae38d5371 100644 --- a/js/src/builtin/SymbolObject.cpp +++ b/js/src/builtin/SymbolObject.cpp @@ -33,6 +33,7 @@ SymbolObject::create(JSContext* cx, JS::HandleSymbol symbol) } const JSPropertySpec SymbolObject::properties[] = { + JS_PSG("description", descriptionGetter, 0), JS_PS_END }; @@ -227,6 +228,34 @@ SymbolObject::toPrimitive(JSContext* cx, unsigned argc, Value* vp) return CallNonGenericMethod(cx, args); } +// ES2019 Stage 4 Draft / November 28, 2018 +// Symbol description accessor +// See: https://tc39.github.io/proposal-Symbol-description/ +bool +SymbolObject::descriptionGetter_impl(JSContext* cx, const CallArgs& args) +{ + // Get symbol object pointer. + HandleValue thisv = args.thisv(); + MOZ_ASSERT(IsSymbol(thisv)); + Rooted sym(cx, thisv.isSymbol() + ? thisv.toSymbol() + : thisv.toObject().as().unbox()); + + // Return the symbol's description if present, otherwise return undefined. + if (JSString* str = sym->description()) + args.rval().setString(str); + else + args.rval().setUndefined(); + return true; +} + +bool +SymbolObject::descriptionGetter(JSContext* cx, unsigned argc, Value* vp) +{ + CallArgs args = CallArgsFromVp(argc, vp); + return CallNonGenericMethod(cx, args); +} + JSObject* js::InitSymbolClass(JSContext* cx, HandleObject obj) { diff --git a/js/src/builtin/SymbolObject.h b/js/src/builtin/SymbolObject.h index 0f204b494..e10b42d53 100644 --- a/js/src/builtin/SymbolObject.h +++ b/js/src/builtin/SymbolObject.h @@ -52,6 +52,10 @@ class SymbolObject : public NativeObject static MOZ_MUST_USE bool valueOf(JSContext* cx, unsigned argc, Value* vp); static MOZ_MUST_USE bool toPrimitive(JSContext* cx, unsigned argc, Value* vp); + // Properties defined on Symbol.prototype. + static MOZ_MUST_USE bool descriptionGetter_impl(JSContext* cx, const CallArgs& args); + static MOZ_MUST_USE bool descriptionGetter(JSContext* cx, unsigned argc, Value *vp); + static const JSPropertySpec properties[]; static const JSFunctionSpec methods[]; static const JSFunctionSpec staticMethods[]; -- cgit v1.2.3 From f9dc4e8ccdc2a582cefff9e5389995ab73e7a420 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Wed, 22 May 2019 19:24:30 +0800 Subject: Issue #971 - Fix browser.link.open_newwindow functionality in Pale Moon --- application/palemoon/base/content/browser.js | 1 - 1 file changed, 1 deletion(-) diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 3f8a584bf..cc362d23f 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -4481,7 +4481,6 @@ nsBrowserAccess.prototype = { } let loadInBackground = gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground"); - let referrer = aOpener ? makeURI(aOpener.location.href) : null; let tab = win.gBrowser.loadOneTab(aURI ? aURI.spec : "about:blank", { triggeringPrincipal: triggeringPrincipal, -- cgit v1.2.3 From bb5e0a1be4decfc17944f8e7306fc3041e1513ed Mon Sep 17 00:00:00 2001 From: adeshkp Date: Wed, 22 May 2019 13:34:36 -0400 Subject: Remove a stubbed telemetry function from app AUS. --- toolkit/mozapps/update/nsUpdateService.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index a68d815aa..64eb995a2 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -948,9 +948,6 @@ function handleFallbackToCompleteUpdate(update, postStaging) { update.setProperty("patchingFailed", oldType); } -function pingStateAndStatusCodes(aUpdate, aStartup, aStatus) { -} - /** * Update Patch * @param patch @@ -1538,7 +1535,6 @@ UpdateService.prototype = { getService(Ci.nsIUpdateManager); var update = um.activeUpdate; var status = readStatusFile(getUpdatesDir()); - pingStateAndStatusCodes(update, true, status); // STATE_NONE status typically means that the update.status file is present // but a background download error occurred. if (status == STATE_NONE) { @@ -2146,8 +2142,6 @@ UpdateService.prototype = { if (!osApplyToDir) { LOG("UpdateService:applyOsUpdate - Error: osApplyToDir is not defined" + "in the nsIUpdate!"); - pingStateAndStatusCodes(aUpdate, false, - STATE_FAILED + ": " + FOTA_FILE_OPERATION_ERROR); handleUpdateFailure(aUpdate, FOTA_FILE_OPERATION_ERROR); return; } @@ -2157,8 +2151,6 @@ UpdateService.prototype = { if (!updateFile.exists()) { LOG("UpdateService:applyOsUpdate - Error: OS update is not found at " + updateFile.path); - pingStateAndStatusCodes(aUpdate, false, - STATE_FAILED + ": " + FOTA_FILE_OPERATION_ERROR); handleUpdateFailure(aUpdate, FOTA_FILE_OPERATION_ERROR); return; } @@ -2173,8 +2165,6 @@ UpdateService.prototype = { } catch (e) { LOG("UpdateService:applyOsUpdate - Error: Couldn't reboot into recovery" + " to apply FOTA update " + updateFile.path); - pingStateAndStatusCodes(aUpdate, false, - STATE_FAILED + ": " + FOTA_RECOVERY_ERROR); writeStatusFile(getUpdatesDir(), aUpdate.state = STATE_APPLIED); handleUpdateFailure(aUpdate, FOTA_RECOVERY_ERROR); } @@ -2476,7 +2466,6 @@ UpdateManager.prototype = { return; } var status = readStatusFile(getUpdatesDir()); - pingStateAndStatusCodes(update, false, status); var parts = status.split(":"); update.state = parts[0]; if (update.state == STATE_FAILED && parts[1]) { -- cgit v1.2.3 From 2fd3007864d0c37b5bcc5ea9ca85d53d96fd83c5 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 22 May 2019 21:10:26 +0200 Subject: Enable double buffering when using XRENDER. This fixes flickering/bars/stripes showing up during quickly-updating operations on Intel hardware when using XRENDER. For more information, refer to the code comment. See #1061 --- gfx/layers/client/ContentClient.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 3373230a9..50e159a23 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -78,8 +78,21 @@ ContentClient::CreateContentClient(CompositableForwarder* aForwarder) // We can't use double buffering when using image content with // Xrender support on Linux, as ContentHostDoubleBuffered is not // suited for direct uploads to the server. + // FIXME: Even though the comment above suggests that double buffering + // is supposed to be disabled when Xrender support is being enabled + // (and used), it really wasn't. Historically, + // UseImageOffscreenSurfaces() was always false in GTK2 builds, thus + // triggering the check, regardless of UseXRender(). + // Some time later, offscreen surfaces were always enabled, but the + // Xrender functionality broke due to not using Xlib-based surfaces. + // Using Xlib-based surfaces compatible with Xrender operations seems + // to lead to weird graphical artifacts (bars and stripes) on some + // hardware (Intel-based?) when displaying quickly-changing content, + // so contrary to the statement above we'd better enable double + // buffering - which also seems to not have any negative performance + // impact. if (!gfxPlatformGtk::GetPlatform()->UseImageOffscreenSurfaces() || - !gfxVars::UseXRender()) + gfxVars::UseXRender()) #endif { useDoubleBuffering = (LayerManagerComposite::SupportsDirectTexturing() && -- cgit v1.2.3 From 797697e26d43b69342bdffd05575133fe8484d87 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Thu, 23 May 2019 13:29:20 +0800 Subject: Issue #1104 - Set the browser's opener when adding a new tab - This modifies `loadOneTab` and `addTab` to accept an opener - This code was adapted from Basilisk's copy of tabbrowser.xml without the refactored code changes (which is a lot more involved as it divides addTab's functions into multiple functions) --- application/palemoon/base/content/tabbrowser.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index aa1a89200..b5edd54b7 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -1337,6 +1337,7 @@ var aFromExternal; var aRelatedToCurrent; var aOriginPrincipal; + var aOpener; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -1351,6 +1352,7 @@ aFromExternal = params.fromExternal; aRelatedToCurrent = params.relatedToCurrent; aOriginPrincipal = params.originPrincipal; + aOpener = params.opener; } var bgLoad = (aLoadInBackground != null) ? aLoadInBackground : @@ -1366,7 +1368,8 @@ allowThirdPartyFixup: aAllowThirdPartyFixup, fromExternal: aFromExternal, originPrincipal: aOriginPrincipal, - relatedToCurrent: aRelatedToCurrent}); + relatedToCurrent: aRelatedToCurrent, + opener: aOpener }); if (!bgLoad) this.selectedTab = tab; @@ -1489,6 +1492,7 @@ var aSkipAnimation; var aOriginPrincipal; var aSkipBackgroundNotify; + var aOpener; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -1504,6 +1508,7 @@ aRelatedToCurrent = params.relatedToCurrent; aSkipAnimation = params.skipAnimation; aOriginPrincipal = params.originPrincipal; + aOpener = params.opener; aSkipBackgroundNotify = params.skipBackgroundNotify; } @@ -1578,6 +1583,10 @@ b.setAttribute("showresizer", "true"); } + if (aOpener) { + b.QueryInterface(Ci.nsIFrameLoaderOwner).presetOpenerWindow(aOpener); + } + if (this.hasAttribute("autocompletepopup")) b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup")); b.setAttribute("autoscrollpopup", this._autoScrollPopup.id); -- cgit v1.2.3 From 10318170bca9a08b1f3716e245aba5432d60aa2a Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Thu, 23 May 2019 13:39:01 +0800 Subject: Issue #1104 - Pass an opener to loadOneTab in the openURI function --- application/palemoon/base/content/browser.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index cc362d23f..16b7c0019 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -4481,13 +4481,15 @@ nsBrowserAccess.prototype = { } let loadInBackground = gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground"); + let openerWindow = (aContext & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener; let tab = win.gBrowser.loadOneTab(aURI ? aURI.spec : "about:blank", { triggeringPrincipal: triggeringPrincipal, referrerURI: referrer, referrerPolicy: referrerPolicy, fromExternal: isExternal, - inBackground: loadInBackground}); + inBackground: loadInBackground, + opener: openerWindow }); let browser = win.gBrowser.getBrowserForTab(tab); if (gPrefService.getBoolPref("browser.tabs.noWindowActivationOnExternal")) { -- cgit v1.2.3 From 73f9b2c70d4653fb47c7f60d6c11aa26a0c0b850 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Thu, 23 May 2019 19:47:59 -0400 Subject: Issue #1101 - Support gzip-compressed SVGs in OpenType+SVG fonts --- gfx/thebes/gfxSVGGlyphs.cpp | 38 +++++++++++++++++++++ layout/reftests/text-svgglyphs/reftest.list | 1 + .../reftests/text-svgglyphs/resources/svg-gz.ttf | Bin 0 -> 113804 bytes .../text-svgglyphs/svg-glyph-compressed-ref.html | 15 ++++++++ .../text-svgglyphs/svg-glyph-compressed.html | 15 ++++++++ 5 files changed, 69 insertions(+) create mode 100644 layout/reftests/text-svgglyphs/resources/svg-gz.ttf create mode 100644 layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html create mode 100644 layout/reftests/text-svgglyphs/svg-glyph-compressed.html diff --git a/gfx/thebes/gfxSVGGlyphs.cpp b/gfx/thebes/gfxSVGGlyphs.cpp index a7615eca8..23f68f590 100644 --- a/gfx/thebes/gfxSVGGlyphs.cpp +++ b/gfx/thebes/gfxSVGGlyphs.cpp @@ -31,6 +31,7 @@ #include "nsSMILAnimationController.h" #include "gfxContext.h" #include "harfbuzz/hb.h" +#include "zlib.h" #include "mozilla/dom/ImageTracker.h" #define SVG_CONTENT_TYPE NS_LITERAL_CSTRING("image/svg+xml") @@ -285,7 +286,44 @@ gfxSVGGlyphsDocument::gfxSVGGlyphsDocument(const uint8_t *aBuffer, gfxSVGGlyphs *aSVGGlyphs) : mOwner(aSVGGlyphs) { + if (aBufLen >= 14 && aBuffer[0] == 31 && aBuffer[1] == 139) { + // It's a gzip-compressed document; decompress it before parsing. + // The original length (modulo 2^32) is found in the last 4 bytes + // of the data, stored in little-endian format. We read it as + // individual bytes to avoid possible alignment issues. + // (Note that if the original length was >2^32, then origLen here + // will be incorrect; but then the inflate() call will not return + // Z_STREAM_END and we'll bail out safely.) + size_t origLen = (size_t(aBuffer[aBufLen - 1]) << 24) + + (size_t(aBuffer[aBufLen - 2]) << 16) + + (size_t(aBuffer[aBufLen - 3]) << 8) + + size_t(aBuffer[aBufLen - 4]); + AutoTArray outBuf; + if (outBuf.SetLength(origLen, mozilla::fallible)) { + z_stream s = {0}; + s.next_in = const_cast(aBuffer); + s.avail_in = aBufLen; + s.next_out = outBuf.Elements(); + s.avail_out = outBuf.Length(); + // The magic number 16 here is the zlib flag to expect gzip format, + // see http://www.zlib.net/manual.html#Advanced + if (Z_OK == inflateInit2(&s, 16 + MAX_WBITS)) { + int result = inflate(&s, Z_FINISH); + if (Z_STREAM_END == result) { + MOZ_ASSERT(size_t(s.next_out - outBuf.Elements()) == origLen); + ParseDocument(outBuf.Elements(), outBuf.Length()); + } else { + NS_WARNING("Failed to decompress SVG glyphs document"); + } + inflateEnd(&s); + } + } else { + NS_WARNING("Failed to allocate memory for SVG glyphs document"); + } + } else { ParseDocument(aBuffer, aBufLen); + } + if (!mDocument) { NS_WARNING("Could not parse SVG glyphs document"); return; diff --git a/layout/reftests/text-svgglyphs/reftest.list b/layout/reftests/text-svgglyphs/reftest.list index 6f328ab73..7ff341f42 100644 --- a/layout/reftests/text-svgglyphs/reftest.list +++ b/layout/reftests/text-svgglyphs/reftest.list @@ -21,3 +21,4 @@ pref(gfx.font_rendering.opentype_svg.enabled,true) fails == svg-glyph-mask.sv pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-paint-server.svg svg-glyph-paint-server-ref.svg pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-transform.svg svg-glyph-transform-ref.svg pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-extents.html svg-glyph-extents-ref.html +pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-compressed.html svg-glyph-compressed-ref.html diff --git a/layout/reftests/text-svgglyphs/resources/svg-gz.ttf b/layout/reftests/text-svgglyphs/resources/svg-gz.ttf new file mode 100644 index 000000000..3a9660224 Binary files /dev/null and b/layout/reftests/text-svgglyphs/resources/svg-gz.ttf differ diff --git a/layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html b/layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html new file mode 100644 index 000000000..9bbfeb748 --- /dev/null +++ b/layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html @@ -0,0 +1,15 @@ + + +Test for compressed SVG glyphs + +
abcdefg
+
LMNOPQR
+ \ No newline at end of file diff --git a/layout/reftests/text-svgglyphs/svg-glyph-compressed.html b/layout/reftests/text-svgglyphs/svg-glyph-compressed.html new file mode 100644 index 000000000..e8123bba6 --- /dev/null +++ b/layout/reftests/text-svgglyphs/svg-glyph-compressed.html @@ -0,0 +1,15 @@ + + +Test for compressed SVG glyphs + +
abcdefg
+
LMNOPQR
+ \ No newline at end of file -- cgit v1.2.3 From a3434ba005b8eaa52fdcdfc3392b640f25f10410 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 13:56:08 +0300 Subject: add main thread only cache for nsIAtoms to speed up atomization dom/base add main thread only cache for nsIAtoms to speed up atomization --- dom/base/Element.cpp | 8 ++++---- dom/base/nsAttrValue.cpp | 10 +++++----- dom/base/nsContentUtils.cpp | 16 +++++++++------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 5c3277e84..f787e4d21 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1283,7 +1283,7 @@ Element::ToggleAttribute(const nsAString& aName, if (aForce.WasPassed() && !aForce.Value()) { return false; } - nsCOMPtr nameAtom = NS_Atomize(nameToUse); + nsCOMPtr nameAtom = NS_AtomizeMainThread(nameToUse); if (!nameAtom) { aError.Throw(NS_ERROR_OUT_OF_MEMORY); return false; @@ -1398,7 +1398,7 @@ Element::GetAttributeNS(const nsAString& aNamespaceURI, return; } - nsCOMPtr name = NS_Atomize(aLocalName); + nsCOMPtr name = NS_AtomizeMainThread(aLocalName); bool hasAttr = GetAttr(nsid, name, aReturn); if (!hasAttr) { SetDOMStringToNull(aReturn); @@ -1430,7 +1430,7 @@ Element::RemoveAttributeNS(const nsAString& aNamespaceURI, const nsAString& aLocalName, ErrorResult& aError) { - nsCOMPtr name = NS_Atomize(aLocalName); + nsCOMPtr name = NS_AtomizeMainThread(aLocalName); int32_t nsid = nsContentUtils::NameSpaceManager()->GetNameSpaceID(aNamespaceURI, nsContentUtils::IsChromeDoc(OwnerDoc())); @@ -1518,7 +1518,7 @@ Element::HasAttributeNS(const nsAString& aNamespaceURI, return false; } - nsCOMPtr name = NS_Atomize(aLocalName); + nsCOMPtr name = NS_AtomizeMainThread(aLocalName); return HasAttr(nsid, name); } diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp index 8eb1aaf97..ebddcb7ed 100644 --- a/dom/base/nsAttrValue.cpp +++ b/dom/base/nsAttrValue.cpp @@ -742,7 +742,7 @@ nsAttrValue::GetAsAtom() const { switch (Type()) { case eString: - return NS_Atomize(GetStringValue()); + return NS_AtomizeMainThread(GetStringValue()); case eAtom: { @@ -754,7 +754,7 @@ nsAttrValue::GetAsAtom() const { nsAutoString val; ToString(val); - return NS_Atomize(val); + return NS_AtomizeMainThread(val); } } } @@ -1267,7 +1267,7 @@ nsAttrValue::ParseAtomArray(const nsAString& aValue) ++iter; } while (iter != end && !nsContentUtils::IsHTMLWhitespace(*iter)); - nsCOMPtr classAtom = NS_Atomize(Substring(start, iter)); + nsCOMPtr classAtom = NS_AtomizeMainThread(Substring(start, iter)); if (!classAtom) { Reset(); return; @@ -1308,7 +1308,7 @@ nsAttrValue::ParseAtomArray(const nsAString& aValue) ++iter; } while (iter != end && !nsContentUtils::IsHTMLWhitespace(*iter)); - classAtom = NS_Atomize(Substring(start, iter)); + classAtom = NS_AtomizeMainThread(Substring(start, iter)); if (!array->AppendElement(classAtom)) { Reset(); @@ -1757,7 +1757,7 @@ nsAttrValue::SetMiscAtomOrString(const nsAString* aValue) "Empty string?"); MiscContainer* cont = GetMiscContainer(); if (len <= NS_ATTRVALUE_MAX_STRINGLENGTH_ATOM) { - nsCOMPtr atom = NS_Atomize(*aValue); + nsCOMPtr atom = NS_AtomizeMainThread(*aValue); if (atom) { cont->mStringBits = reinterpret_cast(atom.forget().take()) | eAtomBase; diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 3696195dd..1f9c17947 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2947,11 +2947,11 @@ nsContentUtils::SplitQName(const nsIContent* aNamespaceResolver, if (*aNamespace == kNameSpaceID_Unknown) return NS_ERROR_FAILURE; - *aLocalName = NS_Atomize(Substring(colon + 1, end)).take(); + *aLocalName = NS_AtomizeMainThread(Substring(colon + 1, end)).take(); } else { *aNamespace = kNameSpaceID_None; - *aLocalName = NS_Atomize(aQName).take(); + *aLocalName = NS_AtomizeMainThread(aQName).take(); } NS_ENSURE_TRUE(aLocalName, NS_ERROR_OUT_OF_MEMORY); return NS_OK; @@ -2976,7 +2976,8 @@ nsContentUtils::GetNodeInfoFromQName(const nsAString& aNamespaceURI, const char16_t* end; qName.EndReading(end); - nsCOMPtr prefix = NS_Atomize(Substring(qName.get(), colon)); + nsCOMPtr prefix = + NS_AtomizeMainThread(Substring(qName.get(), colon)); rv = aNodeInfoManager->GetNodeInfo(Substring(colon + 1, end), prefix, nsID, aNodeType, aNodeInfo); @@ -3036,7 +3037,7 @@ nsContentUtils::SplitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix, nameStart = (uriEnd + 1); if (nameEnd) { const char16_t *prefixStart = nameEnd + 1; - *aPrefix = NS_Atomize(Substring(prefixStart, pos)).take(); + *aPrefix = NS_AtomizeMainThread(Substring(prefixStart, pos)).take(); } else { nameEnd = pos; @@ -3049,7 +3050,7 @@ nsContentUtils::SplitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix, nameEnd = pos; *aPrefix = nullptr; } - *aLocalName = NS_Atomize(Substring(nameStart, nameEnd)).take(); + *aLocalName = NS_AtomizeMainThread(Substring(nameStart, nameEnd)).take(); } // static @@ -3887,7 +3888,8 @@ nsContentUtils::GetEventMessageAndAtom(const nsAString& aName, } *aEventMessage = eUnidentifiedEvent; - nsCOMPtr atom = NS_Atomize(NS_LITERAL_STRING("on") + aName); + nsCOMPtr atom = + NS_AtomizeMainThread(NS_LITERAL_STRING("on") + aName); sUserDefinedEvents->AppendObject(atom); mapping.mAtom = atom; mapping.mMessage = eUnidentifiedEvent; @@ -3920,7 +3922,7 @@ nsContentUtils::GetEventMessageAndAtomForListener(const nsAString& aName, if (mapping.mMaybeSpecialSVGorSMILEvent) { // Try the atom version so that we should get the right message for // SVG/SMIL. - atom = NS_Atomize(NS_LITERAL_STRING("on") + aName); + atom = NS_AtomizeMainThread(NS_LITERAL_STRING("on") + aName); msg = GetEventMessage(atom); } else { atom = mapping.mAtom; -- cgit v1.2.3 From ddff63b2d6c22468cd413c16968558f77fd00bb3 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 13:58:13 +0300 Subject: add main thread only cache for nsIAtoms to speed up atomization xpcom/ds add main thread only cache for nsIAtoms to speed up atomization --- xpcom/ds/nsAtomTable.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++-- xpcom/ds/nsIAtom.idl | 5 +++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index 3dd3bd36c..c63676455 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -364,17 +364,31 @@ static const PLDHashTableOps AtomTableOps = { //---------------------------------------------------------------------- +#define RECENTLY_USED_MAIN_THREAD_ATOM_CACHE_SIZE 31 +static nsIAtom* + sRecentlyUsedMainThreadAtoms[RECENTLY_USED_MAIN_THREAD_ATOM_CACHE_SIZE] = {}; + + void DynamicAtom::GCAtomTable() { - MutexAutoLock lock(*gAtomTableLock); - GCAtomTableLocked(lock, GCKind::RegularOperation); + if (NS_IsMainThread()) { + MutexAutoLock lock(*gAtomTableLock); + GCAtomTableLocked(lock, GCKind::RegularOperation); + } } void DynamicAtom::GCAtomTableLocked(const MutexAutoLock& aProofOfLock, GCKind aKind) { + + MOZ_ASSERT(NS_IsMainThread()); + for (uint32_t i = 0; i < RECENTLY_USED_MAIN_THREAD_ATOM_CACHE_SIZE; ++i) { + sRecentlyUsedMainThreadAtoms[i] = nullptr; + } + + uint32_t removedCount = 0; // Use a non-atomic temporary for cheaper increments. nsAutoCString nonZeroRefcountAtoms; uint32_t nonZeroRefcountAtomsCount = 0; @@ -673,6 +687,8 @@ NS_Atomize(const nsACString& aUTF8String) return atom.forget(); } + + // This results in an extra addref/release of the nsStringBuffer. // Unfortunately there doesn't seem to be any APIs to avoid that. // Actually, now there is, sort of: ForgetSharedBuffer. @@ -712,6 +728,40 @@ NS_Atomize(const nsAString& aUTF16String) return atom.forget(); } +already_AddRefed +NS_AtomizeMainThread(const nsAString& aUTF16String) +{ + MOZ_ASSERT(NS_IsMainThread()); + nsCOMPtr retVal; + uint32_t hash; + AtomTableKey key(aUTF16String.Data(), aUTF16String.Length(), &hash); + uint32_t index = hash % RECENTLY_USED_MAIN_THREAD_ATOM_CACHE_SIZE; + nsIAtom* atom = + sRecentlyUsedMainThreadAtoms[index]; + if (atom) { + uint32_t length = atom->GetLength(); + if (length == key.mLength && + (memcmp(atom->GetUTF16String(), + key.mUTF16String, length * sizeof(char16_t)) == 0)) { + retVal = atom; + return retVal.forget(); + } + } + + MutexAutoLock lock(*gAtomTableLock); + AtomTableEntry* he = static_cast(gAtomTable->Add(&key)); + + if (he->mAtom) { + retVal = he->mAtom; + } else { + retVal = DynamicAtom::Create(aUTF16String, hash); + he->mAtom = retVal; + } + + sRecentlyUsedMainThreadAtoms[index] = retVal; + return retVal.forget(); +} + nsrefcnt NS_GetNumberOfAtoms(void) { diff --git a/xpcom/ds/nsIAtom.idl b/xpcom/ds/nsIAtom.idl index c02540838..6e8602c42 100644 --- a/xpcom/ds/nsIAtom.idl +++ b/xpcom/ds/nsIAtom.idl @@ -119,6 +119,11 @@ extern already_AddRefed NS_Atomize(const char16_t* aUTF16String); */ extern already_AddRefed NS_Atomize(const nsAString& aUTF16String); +/** + * An optimized version of the method above for the main thread. + */ +extern already_AddRefed NS_AtomizeMainThread(const nsAString& aUTF16String); + /** * Return a count of the total number of atoms currently * alive in the system. -- cgit v1.2.3 From 58ff91d97e90094e18ec335a5e19bbd95fff0bd9 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 14:02:32 +0300 Subject: remove unnecessary spaces --- xpcom/ds/nsAtomTable.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xpcom/ds/nsAtomTable.cpp b/xpcom/ds/nsAtomTable.cpp index c63676455..4c93625ae 100644 --- a/xpcom/ds/nsAtomTable.cpp +++ b/xpcom/ds/nsAtomTable.cpp @@ -368,7 +368,6 @@ static const PLDHashTableOps AtomTableOps = { static nsIAtom* sRecentlyUsedMainThreadAtoms[RECENTLY_USED_MAIN_THREAD_ATOM_CACHE_SIZE] = {}; - void DynamicAtom::GCAtomTable() { @@ -388,7 +387,6 @@ DynamicAtom::GCAtomTableLocked(const MutexAutoLock& aProofOfLock, sRecentlyUsedMainThreadAtoms[i] = nullptr; } - uint32_t removedCount = 0; // Use a non-atomic temporary for cheaper increments. nsAutoCString nonZeroRefcountAtoms; uint32_t nonZeroRefcountAtomsCount = 0; @@ -687,8 +685,6 @@ NS_Atomize(const nsACString& aUTF8String) return atom.forget(); } - - // This results in an extra addref/release of the nsStringBuffer. // Unfortunately there doesn't seem to be any APIs to avoid that. // Actually, now there is, sort of: ForgetSharedBuffer. -- cgit v1.2.3 From a371a69a73ebcd542ceb42927ce2859b0d326c98 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 14:05:09 +0300 Subject: make HTML parser to use faster atomization in main thread --- parser/html/nsHtml5TreeOperation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/html/nsHtml5TreeOperation.h b/parser/html/nsHtml5TreeOperation.h index 0b2970738..a93f44c46 100644 --- a/parser/html/nsHtml5TreeOperation.h +++ b/parser/html/nsHtml5TreeOperation.h @@ -108,7 +108,7 @@ class nsHtml5TreeOperation { } nsAutoString str; aAtom->ToString(str); - return NS_Atomize(str); + return NS_AtomizeMainThread(str); } static nsresult AppendTextToTextNode(const char16_t* aBuffer, -- cgit v1.2.3 From 622ad88c5d0ed8fc301d37b884857123eb17cc56 Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 20:00:07 +0300 Subject: Lots of time spent maintaining nsDisplayLayerEventRegions (#1116) * Simplify the dispatch-to-content region Simplify the dispatch-to-content region in nsDisplayLayerEventRegions::AddFrame() and AddInactiveScrollPort() if it starts to get large. * tabs to spaces --- layout/base/nsDisplayList.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index c830891a5..a55ec1e39 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3808,12 +3808,14 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder, // region on scrollbar frames that won't be placed in their own layer. See // bug 1213324 for details. mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox); + mDispatchToContentHitRegion.SimplifyOutward(8); } else if (aFrame->GetType() == nsGkAtoms::objectFrame) { // If the frame is a plugin frame and wants to handle wheel events as // default action, we should add the frame to dispatch-to-content region. nsPluginFrame* pluginFrame = do_QueryFrame(aFrame); if (pluginFrame && pluginFrame->WantsToHandleWheelEventAsDefaultAction()) { mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, borderBox); + mDispatchToContentHitRegion.SimplifyOutward(8); } } @@ -3850,6 +3852,7 @@ nsDisplayLayerEventRegions::AddFrame(nsDisplayListBuilder* aBuilder, } if (alreadyHadRegions) { mDispatchToContentHitRegion.OrWith(CombinedTouchActionRegion()); + mDispatchToContentHitRegion.SimplifyOutward(8); } } } @@ -3859,6 +3862,7 @@ nsDisplayLayerEventRegions::AddInactiveScrollPort(const nsRect& aRect) { mHitRegion.Or(mHitRegion, aRect); mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, aRect); + mDispatchToContentHitRegion.SimplifyOutward(8); } bool -- cgit v1.2.3 From 7214f08148d3d93a7f89bb50dec0c558f0e444de Mon Sep 17 00:00:00 2001 From: win7-7 Date: Fri, 24 May 2019 22:55:23 +0300 Subject: Add missing NS_AtomizeMainThread(nameToUse); nsCOMPtr nameAtom = NS_AtomizeMainThread(nameToUse); --- dom/base/Element.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index f787e4d21..0054f4800 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1316,7 +1316,7 @@ Element::SetAttribute(const nsAString& aName, nsAutoString nameToUse; const nsAttrName* name = InternalGetAttrNameFromQName(aName, &nameToUse); if (!name) { - nsCOMPtr nameAtom = NS_Atomize(nameToUse); + nsCOMPtr nameAtom = NS_AtomizeMainThread(nameToUse); if (!nameAtom) { aError.Throw(NS_ERROR_OUT_OF_MEMORY); return; -- cgit v1.2.3 From e24e6346b70d3d212e9c9b7aa14f79f1d3ea86e8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 25 May 2019 00:31:24 +0200 Subject: Fix architecture flag for PPC64 Fixes #1092 --- js/src/jstypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/jstypes.h b/js/src/jstypes.h index 6cfb3d4ad..04ffbe00d 100644 --- a/js/src/jstypes.h +++ b/js/src/jstypes.h @@ -147,7 +147,7 @@ # define JS_64BIT # endif #elif defined(__GNUC__) -# if defined(__x86_64__) || defined(__64BIT__) +# if defined(__x86_64__) || defined(__LP64__) # define JS_64BIT # endif #elif defined(__xlc__) || defined(__xlC__) /* IBM XL C/C++ */ -- cgit v1.2.3 From ca9e6a4fa9d075bc9cce68b7fb44a7f1bcf3f8c7 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Fri, 24 May 2019 20:14:44 -0400 Subject: Issue #1102 - Disable Create a new pref 'dom.meta-set-cookie.enabled' which is set to 'false', disabling http-equiv meta cookies. --- dom/base/nsContentSink.cpp | 3 ++- extensions/cookie/test/file_domain_hierarchy_inner.html | 1 - .../cookie/test/file_domain_hierarchy_inner.html^headers^ | 1 + extensions/cookie/test/file_domain_hierarchy_inner_inner.html | 1 - .../test/file_domain_hierarchy_inner_inner.html^headers^ | 1 + .../cookie/test/file_domain_hierarchy_inner_inner_inner.html | 1 - .../file_domain_hierarchy_inner_inner_inner.html^headers^ | 1 + extensions/cookie/test/file_domain_inner.html | 1 - extensions/cookie/test/file_domain_inner.html^headers^ | 1 + extensions/cookie/test/file_domain_inner_inner.html | 1 - extensions/cookie/test/file_domain_inner_inner.html^headers^ | 1 + extensions/cookie/test/file_image_inner.html | 1 - extensions/cookie/test/file_image_inner.html^headers^ | 1 + extensions/cookie/test/file_image_inner_inner.html | 1 - extensions/cookie/test/file_image_inner_inner.html^headers^ | 1 + extensions/cookie/test/file_loadflags_inner.html | 1 - extensions/cookie/test/file_loadflags_inner.html^headers^ | 1 + extensions/cookie/test/file_localhost_inner.html | 1 - extensions/cookie/test/file_localhost_inner.html^headers^ | 1 + extensions/cookie/test/file_loopback_inner.html | 1 - extensions/cookie/test/file_loopback_inner.html^headers^ | 1 + extensions/cookie/test/file_subdomain_inner.html | 1 - extensions/cookie/test/file_subdomain_inner.html^headers^ | 1 + extensions/cookie/test/mochitest.ini | 11 +++++++++++ extensions/cookie/test/test_same_base_domain.html | 2 +- extensions/cookie/test/test_same_base_domain_2.html | 2 +- extensions/cookie/test/test_same_base_domain_3.html | 2 +- extensions/cookie/test/test_same_base_domain_5.html | 2 +- extensions/cookie/test/test_samedomain.html | 2 +- modules/libpref/init/all.js | 3 +++ 30 files changed, 32 insertions(+), 17 deletions(-) create mode 100644 extensions/cookie/test/file_domain_hierarchy_inner.html^headers^ create mode 100644 extensions/cookie/test/file_domain_hierarchy_inner_inner.html^headers^ create mode 100644 extensions/cookie/test/file_domain_hierarchy_inner_inner_inner.html^headers^ create mode 100644 extensions/cookie/test/file_domain_inner.html^headers^ create mode 100644 extensions/cookie/test/file_domain_inner_inner.html^headers^ create mode 100644 extensions/cookie/test/file_image_inner.html^headers^ create mode 100644 extensions/cookie/test/file_image_inner_inner.html^headers^ create mode 100644 extensions/cookie/test/file_loadflags_inner.html^headers^ create mode 100644 extensions/cookie/test/file_localhost_inner.html^headers^ create mode 100644 extensions/cookie/test/file_loopback_inner.html^headers^ create mode 100644 extensions/cookie/test/file_subdomain_inner.html^headers^ diff --git a/dom/base/nsContentSink.cpp b/dom/base/nsContentSink.cpp index 85b3d07bf..490f0ec17 100644 --- a/dom/base/nsContentSink.cpp +++ b/dom/base/nsContentSink.cpp @@ -304,7 +304,8 @@ nsContentSink::ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue, mDocument->SetHeaderData(aHeader, aValue); - if (aHeader == nsGkAtoms::setcookie) { + if (aHeader == nsGkAtoms::setcookie && + Preferences::GetBool("dom.meta-set-cookie.enabled", true)) { // Don't allow setting cookies in cookie-averse documents. if (mDocument->IsCookieAverse()) { return NS_OK; diff --git a/extensions/cookie/test/file_domain_hierarchy_inner.html b/extensions/cookie/test/file_domain_hierarchy_inner.html index 1a3734597..a62e1b9e4 100644 --- a/extensions/cookie/test/file_domain_hierarchy_inner.html +++ b/extensions/cookie/test/file_domain_hierarchy_inner.html @@ -1,7 +1,6 @@ - - +

         
   
 
-
+
 

         
   
 
-
+
 

         
   
 
-
+
 

         
   
 
-
+