Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-12-18 15:25:47 +01:00
commit ebff7b3066
60 changed files with 1381 additions and 984 deletions

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -1,9 +1,9 @@
{ {
"git": { "git": {
"git_revision": "2f093462969d2c5f65dced3908a7abff6b1913e8", "git_revision": "d069027f9af6f835ef869f1f01b52339e5a3f423",
"remote": "https://git.mozilla.org/releases/gaia.git", "remote": "https://git.mozilla.org/releases/gaia.git",
"branch": "" "branch": ""
}, },
"revision": "f0575fd3300ea98629d27aaa4ea0a11139867033", "revision": "87642662c7721f18575be17ae42c81782e5f040a",
"repo_path": "integration/gaia-central" "repo_path": "integration/gaia-central"
} }

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -21,7 +21,7 @@
<!-- <!--
B2G repositories for all targets B2G repositories for all targets
--> -->
<project name="gaia" path="gaia" remote="mozillaorg" revision="2f093462969d2c5f65dced3908a7abff6b1913e8"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="d069027f9af6f835ef869f1f01b52339e5a3f423"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4a962bdab532e18f53e9d2d114c349983262c6b7"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/> <project name="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/> <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

View File

@ -5197,8 +5197,10 @@ var TabletModeUpdater = {
}; };
var gTabletModePageCounter = { var gTabletModePageCounter = {
enabled: false,
inc() { inc() {
if (!AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) { this.enabled = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
if (!this.enabled) {
this.inc = () => {}; this.inc = () => {};
return; return;
} }
@ -5214,8 +5216,11 @@ var gTabletModePageCounter = {
}, },
finish() { finish() {
Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD").add("tablet", this._tabletCount); if (this.enabled) {
Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD").add("desktop", this._desktopCount); let histogram = Services.telemetry.getKeyedHistogramById("FX_TABLETMODE_PAGE_LOAD");
histogram.add("tablet", this._tabletCount);
histogram.add("desktop", this._desktopCount);
}
}, },
}; };

View File

@ -4691,6 +4691,9 @@
let hoveredTab = this._hoveredTab; let hoveredTab = this._hoveredTab;
if (hoveredTab) { if (hoveredTab) {
hoveredTab._mouseleave(); hoveredTab._mouseleave();
}
hoveredTab = this.querySelector("tab:hover");
if (hoveredTab) {
hoveredTab._mouseenter(); hoveredTab._mouseenter();
} }
]]></body> ]]></body>

View File

@ -30,6 +30,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
"resource://gre/modules/TelemetryEnvironment.jsm"); "resource://gre/modules/TelemetryEnvironment.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryLog", XPCOMUtils.defineLazyModuleGetter(this, "TelemetryLog",
"resource://gre/modules/TelemetryLog.jsm"); "resource://gre/modules/TelemetryLog.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryUtils",
"resource://gre/modules/TelemetryUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils", XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
"resource://services-common/utils.js"); "resource://services-common/utils.js");
XPCOMUtils.defineLazyModuleGetter(this, "Metrics", XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
@ -160,10 +162,6 @@ function loadJSONAsync(file, options) {
}); });
} }
function telemetryEnabled() {
return gPrefsTelemetry.get(PREF_TELEMETRY_ENABLED, false);
}
// Returns a promise that is resolved with the AddonInstall for that URL. // Returns a promise that is resolved with the AddonInstall for that URL.
function addonInstallForURL(url, hash) { function addonInstallForURL(url, hash) {
let deferred = Promise.defer(); let deferred = Promise.defer();
@ -389,7 +387,7 @@ Experiments.Experiments.prototype = {
this._shutdown = false; this._shutdown = false;
configureLogging(); configureLogging();
gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false); gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false) && TelemetryUtils.isTelemetryEnabled;
this._log.trace("enabled=" + gExperimentsEnabled + ", " + this.enabled); this._log.trace("enabled=" + gExperimentsEnabled + ", " + this.enabled);
gPrefs.observe(PREF_LOGGING, configureLogging); gPrefs.observe(PREF_LOGGING, configureLogging);
@ -580,7 +578,7 @@ Experiments.Experiments.prototype = {
_toggleExperimentsEnabled: Task.async(function* (enabled) { _toggleExperimentsEnabled: Task.async(function* (enabled) {
this._log.trace("_toggleExperimentsEnabled(" + enabled + ")"); this._log.trace("_toggleExperimentsEnabled(" + enabled + ")");
let wasEnabled = gExperimentsEnabled; let wasEnabled = gExperimentsEnabled;
gExperimentsEnabled = enabled && telemetryEnabled(); gExperimentsEnabled = enabled && TelemetryUtils.isTelemetryEnabled;
if (wasEnabled == gExperimentsEnabled) { if (wasEnabled == gExperimentsEnabled) {
return; return;

View File

@ -233,3 +233,7 @@ function replaceExperiments(experiment, list) {
}, },
}); });
} }
// Experiments require Telemetry to be enabled, and that's not true for debug
// builds. Let's just enable it here instead of going through each test.
Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);

View File

@ -0,0 +1,21 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
Cu.import("resource:///modules/experiments/Experiments.jsm");
add_test(function test_experiments_activation() {
do_get_profile();
loadAddonManager();
Services.prefs.setBoolPref(PREF_EXPERIMENTS_ENABLED, true);
Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, false);
let experiments = Experiments.instance();
Assert.ok(!experiments.enabled, "Experiments must be disabled if Telemetry is disabled.");
// TODO: Test that Experiments are turned back on when bug 1232648 lands.
run_next_test();
});

View File

@ -24,6 +24,7 @@ generated-files =
[test_disableExperiments.js] [test_disableExperiments.js]
[test_fetch.js] [test_fetch.js]
[test_telemetry.js] [test_telemetry.js]
[test_telemetry_disabled.js]
[test_healthreport.js] [test_healthreport.js]
[test_previous_provider.js] [test_previous_provider.js]
[test_upgrade.js] [test_upgrade.js]

View File

@ -123,7 +123,7 @@ groupbox.collapsable caption .caption-icon {
background-position: center; background-position: center;
-moz-margin-start: 2px; -moz-margin-start: 2px;
-moz-margin-end: 2px; -moz-margin-end: 2px;
background-image: url("chrome://global/skin/tree/twisty-open.png"); background-image: url("chrome://global/skin/tree/twisty.svg#open");
} }
groupbox.collapsable[closed="true"] { groupbox.collapsable[closed="true"] {
@ -133,7 +133,7 @@ groupbox.collapsable[closed="true"] {
} }
groupbox.collapsable[closed="true"] caption .caption-icon { groupbox.collapsable[closed="true"] caption .caption-icon {
background-image: url("chrome://global/skin/tree/twisty-clsd.png"); background-image: url("chrome://global/skin/tree/twisty.svg#clsd");
} }
groupbox tree { groupbox tree {

View File

@ -2,27 +2,20 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */ http://creativecommons.org/publicdomain/zero/1.0/ */
// Test for dynamically registering and unregistering themes
const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/framework/test/"; const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/framework/test/";
var toolbox; var toolbox;
function test() add_task(function* themeRegistration() {
{ let tab = yield addTab("data:text/html,test");
gBrowser.selectedTab = gBrowser.addTab(); let target = TargetFactory.forTab(tab);
let target = TargetFactory.forTab(gBrowser.selectedTab); toolbox = yield gDevTools.showToolbox(target);
gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) { let themeId = yield new Promise(resolve => {
gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true); gDevTools.once("theme-registered", (e, themeId) => {
gDevTools.showToolbox(target).then(testRegister); resolve(themeId);
}, true); });
content.location = "data:text/html,test for dynamically registering and unregistering themes";
}
function testRegister(aToolbox)
{
toolbox = aToolbox
gDevTools.once("theme-registered", themeRegistered);
gDevTools.registerTheme({ gDevTools.registerTheme({
id: "test-theme", id: "test-theme",
@ -30,32 +23,24 @@ function testRegister(aToolbox)
stylesheets: [CHROME_URL + "doc_theme.css"], stylesheets: [CHROME_URL + "doc_theme.css"],
classList: ["theme-test"], classList: ["theme-test"],
}); });
} });
function themeRegistered(event, themeId)
{
is(themeId, "test-theme", "theme-registered event handler sent theme id"); is(themeId, "test-theme", "theme-registered event handler sent theme id");
ok(gDevTools.getThemeDefinitionMap().has(themeId), "theme added to map"); ok(gDevTools.getThemeDefinitionMap().has(themeId), "theme added to map");
});
add_task(function* themeInOptionsPanel() {
yield toolbox.selectTool("options");
// Test that new theme appears in the Options panel
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, "options").then(() => {
let panel = toolbox.getCurrentPanel(); let panel = toolbox.getCurrentPanel();
let doc = panel.panelWin.frameElement.contentDocument; let panelWin = toolbox.getCurrentPanel().panelWin;
let doc = panelWin.frameElement.contentDocument;
let themeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]"); let themeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]");
ok(themeOption, "new theme exists in the Options panel"); ok(themeOption, "new theme exists in the Options panel");
// Apply the new theme.
applyTheme();
});
}
function applyTheme()
{
let panelWin = toolbox.getCurrentPanel().panelWin;
let doc = panelWin.frameElement.contentDocument;
let testThemeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]"); let testThemeOption = doc.querySelector("#devtools-theme-box > radio[value=test-theme]");
let lightThemeOption = doc.querySelector("#devtools-theme-box > radio[value=light]"); let lightThemeOption = doc.querySelector("#devtools-theme-box > radio[value=light]");
@ -65,24 +50,26 @@ function applyTheme()
// Select test theme. // Select test theme.
testThemeOption.click(); testThemeOption.click();
info("Waiting for theme to finish loading");
yield once(panelWin, "theme-switch-complete");
color = panelWin.getComputedStyle(testThemeOption).color; color = panelWin.getComputedStyle(testThemeOption).color;
is(color, "rgb(255, 0, 0)", "style applied"); is(color, "rgb(255, 0, 0)", "style applied");
// Select light theme // Select light theme
lightThemeOption.click(); lightThemeOption.click();
info("Waiting for theme to finish loading");
yield once(panelWin, "theme-switch-complete");
color = panelWin.getComputedStyle(testThemeOption).color; color = panelWin.getComputedStyle(testThemeOption).color;
isnot(color, "rgb(255, 0, 0)", "style unapplied"); isnot(color, "rgb(255, 0, 0)", "style unapplied");
// Select test theme again. // Select test theme again.
testThemeOption.click(); testThemeOption.click();
});
// Then unregister the test theme. add_task(function* themeUnregistration() {
testUnregister();
}
function testUnregister()
{
gDevTools.unregisterTheme("test-theme"); gDevTools.unregisterTheme("test-theme");
ok(!gDevTools.getThemeDefinitionMap().has("test-theme"), "theme removed from map"); ok(!gDevTools.getThemeDefinitionMap().has("test-theme"), "theme removed from map");
@ -94,20 +81,9 @@ function testUnregister()
// The default light theme must be selected now. // The default light theme must be selected now.
is(themeBox.selectedItem, themeBox.querySelector("[value=light]"), is(themeBox.selectedItem, themeBox.querySelector("[value=light]"),
"theme light must be selected"); "theme light must be selected");
// Make sure the tab-attaching process is done before we destroy the toolbox.
let target = TargetFactory.forTab(gBrowser.selectedTab);
let actor = target.activeTab.actor;
target.client.attachTab(actor, (response) => {
cleanup();
}); });
}
function cleanup() add_task(function* cleanup() {
{ yield toolbox.destroy();
toolbox.destroy().then(function() {
toolbox = null; toolbox = null;
gBrowser.removeCurrentTab();
finish();
}); });
}

View File

@ -39,24 +39,24 @@ devtools.jar:
content/animationinspector/animation-controller.js (animationinspector/animation-controller.js) content/animationinspector/animation-controller.js (animationinspector/animation-controller.js)
content/animationinspector/animation-panel.js (animationinspector/animation-panel.js) content/animationinspector/animation-panel.js (animationinspector/animation-panel.js)
content/animationinspector/animation-inspector.xhtml (animationinspector/animation-inspector.xhtml) content/animationinspector/animation-inspector.xhtml (animationinspector/animation-inspector.xhtml)
content/sourceeditor/codemirror/comment/comment.js (sourceeditor/codemirror/addon/comment/comment.js) content/sourceeditor/codemirror/addon/comment/comment.js (sourceeditor/codemirror/addon/comment/comment.js)
content/sourceeditor/codemirror/edit/trailingspace.js (sourceeditor/codemirror/addon/edit/trailingspace.js) content/sourceeditor/codemirror/addon/edit/trailingspace.js (sourceeditor/codemirror/addon/edit/trailingspace.js)
content/sourceeditor/codemirror/edit/matchbrackets.js (sourceeditor/codemirror/addon/edit/matchbrackets.js) content/sourceeditor/codemirror/addon/edit/matchbrackets.js (sourceeditor/codemirror/addon/edit/matchbrackets.js)
content/sourceeditor/codemirror/edit/closebrackets.js (sourceeditor/codemirror/addon/edit/closebrackets.js) content/sourceeditor/codemirror/addon/edit/closebrackets.js (sourceeditor/codemirror/addon/edit/closebrackets.js)
content/sourceeditor/codemirror/dialog/dialog.js (sourceeditor/codemirror/addon/dialog/dialog.js) content/sourceeditor/codemirror/addon/dialog/dialog.js (sourceeditor/codemirror/addon/dialog/dialog.js)
content/sourceeditor/codemirror/dialog/dialog.css (sourceeditor/codemirror/addon/dialog/dialog.css) content/sourceeditor/codemirror/addon/dialog/dialog.css (sourceeditor/codemirror/addon/dialog/dialog.css)
content/sourceeditor/codemirror/fold/foldcode.js (sourceeditor/codemirror/addon/fold/foldcode.js) content/sourceeditor/codemirror/addon/fold/foldcode.js (sourceeditor/codemirror/addon/fold/foldcode.js)
content/sourceeditor/codemirror/fold/brace-fold.js (sourceeditor/codemirror/addon/fold/brace-fold.js) content/sourceeditor/codemirror/addon/fold/brace-fold.js (sourceeditor/codemirror/addon/fold/brace-fold.js)
content/sourceeditor/codemirror/fold/comment-fold.js (sourceeditor/codemirror/addon/fold/comment-fold.js) content/sourceeditor/codemirror/addon/fold/comment-fold.js (sourceeditor/codemirror/addon/fold/comment-fold.js)
content/sourceeditor/codemirror/fold/xml-fold.js (sourceeditor/codemirror/addon/fold/xml-fold.js) content/sourceeditor/codemirror/addon/fold/xml-fold.js (sourceeditor/codemirror/addon/fold/xml-fold.js)
content/sourceeditor/codemirror/fold/foldgutter.js (sourceeditor/codemirror/addon/fold/foldgutter.js) content/sourceeditor/codemirror/addon/fold/foldgutter.js (sourceeditor/codemirror/addon/fold/foldgutter.js)
content/sourceeditor/codemirror/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js) content/sourceeditor/codemirror/addon/hint/show-hint.js (sourceeditor/codemirror/addon/hint/show-hint.js)
content/sourceeditor/codemirror/search/search.js (sourceeditor/codemirror/addon/search/search.js) content/sourceeditor/codemirror/addon/search/search.js (sourceeditor/codemirror/addon/search/search.js)
content/sourceeditor/codemirror/search/searchcursor.js (sourceeditor/codemirror/addon/search/searchcursor.js) content/sourceeditor/codemirror/addon/search/searchcursor.js (sourceeditor/codemirror/addon/search/searchcursor.js)
content/sourceeditor/codemirror/selection/active-line.js (sourceeditor/codemirror/addon/selection/active-line.js) content/sourceeditor/codemirror/addon/selection/active-line.js (sourceeditor/codemirror/addon/selection/active-line.js)
content/sourceeditor/codemirror/tern/tern.js (sourceeditor/codemirror/addon/tern/tern.js) content/sourceeditor/codemirror/addon/tern/tern.js (sourceeditor/codemirror/addon/tern/tern.js)
content/sourceeditor/codemirror/codemirror.js (sourceeditor/codemirror/lib/codemirror.js) content/sourceeditor/codemirror/lib/codemirror.js (sourceeditor/codemirror/lib/codemirror.js)
content/sourceeditor/codemirror/codemirror.css (sourceeditor/codemirror/lib/codemirror.css) content/sourceeditor/codemirror/lib/codemirror.css (sourceeditor/codemirror/lib/codemirror.css)
content/sourceeditor/codemirror/mode/javascript.js (sourceeditor/codemirror/mode/javascript.js) content/sourceeditor/codemirror/mode/javascript.js (sourceeditor/codemirror/mode/javascript.js)
content/sourceeditor/codemirror/mode/xml.js (sourceeditor/codemirror/mode/xml.js) content/sourceeditor/codemirror/mode/xml.js (sourceeditor/codemirror/mode/xml.js)
content/sourceeditor/codemirror/mode/css.js (sourceeditor/codemirror/mode/css.js) content/sourceeditor/codemirror/mode/css.js (sourceeditor/codemirror/mode/css.js)

View File

@ -7,7 +7,8 @@ var toolbox;
add_task(function*() { add_task(function*() {
let target = TargetFactory.forTab(gBrowser.selectedTab); let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = yield gDevTools.showToolbox(target); let toolbox = yield gDevTools.showToolbox(target);
let root = toolbox.frame.contentDocument.documentElement; let doc = toolbox.frame.contentDocument;
let root = doc.documentElement;
let platform = root.getAttribute("platform"); let platform = root.getAttribute("platform");
let expectedPlatform = getPlatform(); let expectedPlatform = getPlatform();
@ -15,7 +16,24 @@ add_task(function*() {
let theme = Services.prefs.getCharPref("devtools.theme"); let theme = Services.prefs.getCharPref("devtools.theme");
let className = "theme-" + theme; let className = "theme-" + theme;
ok(root.classList.contains(className), ":root has " + className + " class (current theme)"); ok(root.classList.contains(className),
":root has " + className + " class (current theme)");
// Convert the xpath result into an array of strings
// like `href="{URL}" type="text/css"`
let sheetsIterator = doc.evaluate("processing-instruction('xml-stylesheet')",
doc, null, XPathResult.ANY_TYPE, null);
let sheetsInDOM = [];
let sheet;
while (sheet = sheetsIterator.iterateNext()) {
sheetsInDOM.push(sheet.data);
}
let sheetsFromTheme = gDevTools.getThemeDefinition(theme).stylesheets;
info ("Checking for existence of " + sheetsInDOM.length + " sheets");
for (let sheet of sheetsFromTheme) {
ok(sheetsInDOM.some(s=>s.includes(sheet)), "There is a stylesheet for " + sheet);
}
yield toolbox.destroy(); yield toolbox.destroy();
}); });

View File

@ -3,8 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
(function() { (function() {
const DEVTOOLS_SKIN_URL = "chrome://devtools/skin/"; const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-light.css";
let documentElement = document.documentElement; let documentElement = document.documentElement;
let devtoolsStyleSheets = new WeakMap();
function forceStyle() { function forceStyle() {
let computedStyle = window.getComputedStyle(documentElement); let computedStyle = window.getComputedStyle(documentElement);
@ -19,6 +20,45 @@
documentElement.style.display = display; // Restore documentElement.style.display = display; // Restore
} }
/*
* Append a new processing instruction and return an object with
* - styleSheet: DOMNode
* - loadPromise: Promise that resolves once the sheets loads or errors
*/
function appendStyleSheet(url) {
let styleSheetAttr = `href="${url}" type="text/css"`;
let styleSheet = document.createProcessingInstruction(
"xml-stylesheet", styleSheetAttr);
let loadPromise = new Promise((resolve, reject) => {
function onload() {
styleSheet.removeEventListener("load", onload);
styleSheet.removeEventListener("error", onerror);
resolve();
}
function onerror() {
styleSheet.removeEventListener("load", onload);
styleSheet.removeEventListener("error", onerror);
reject("Failed to load theme file " + url);
}
styleSheet.addEventListener("load", onload);
styleSheet.addEventListener("error", onerror);
});
document.insertBefore(styleSheet, documentElement);
return {styleSheet, loadPromise};
}
/*
* Notify the window that a theme switch finished so tests can check the DOM
*/
function notifyWindow() {
window.dispatchEvent(new CustomEvent("theme-switch-complete", {}));
}
/*
* Apply all the sheets from `newTheme` and remove all of the sheets
* from `oldTheme`
*/
function switchTheme(newTheme, oldTheme) { function switchTheme(newTheme, oldTheme) {
if (newTheme === oldTheme) { if (newTheme === oldTheme) {
return; return;
@ -28,8 +68,8 @@
// Unload all theme stylesheets related to the old theme. // Unload all theme stylesheets related to the old theme.
if (oldThemeDef) { if (oldThemeDef) {
for (let url of oldThemeDef.stylesheets) { for (let sheet of devtoolsStyleSheets.get(oldThemeDef) || []) {
StylesheetUtils.removeSheet(window, url, "author"); sheet.remove();
} }
} }
@ -42,8 +82,17 @@
newThemeDef = gDevTools.getThemeDefinition("light"); newThemeDef = gDevTools.getThemeDefinition("light");
} }
// Store the sheets in a WeakMap for access later when the theme gets
// unapplied. It's hard to query for processing instructions so this
// is an easy way to access them later without storing a property on
// the window
devtoolsStyleSheets.set(newThemeDef, []);
let loadEvents = [];
for (let url of newThemeDef.stylesheets) { for (let url of newThemeDef.stylesheets) {
StylesheetUtils.loadSheet(window, url, "author"); let {styleSheet,loadPromise} = appendStyleSheet(url);
devtoolsStyleSheets.get(newThemeDef).push(styleSheet);
loadEvents.push(loadPromise);
} }
// Floating scroll-bars like in OSX // Floating scroll-bars like in OSX
@ -53,21 +102,10 @@
// TODO: extensions might want to customize scrollbar styles too. // TODO: extensions might want to customize scrollbar styles too.
if (!hiddenDOMWindow.matchMedia("(-moz-overlay-scrollbars)").matches) { if (!hiddenDOMWindow.matchMedia("(-moz-overlay-scrollbars)").matches) {
let scrollbarsUrl = Services.io.newURI(
DEVTOOLS_SKIN_URL + "floating-scrollbars-light.css", null, null);
if (newTheme == "dark") { if (newTheme == "dark") {
StylesheetUtils.loadSheet( StylesheetUtils.loadSheet(window, SCROLLBARS_URL, "agent");
window,
scrollbarsUrl,
"agent"
);
} else if (oldTheme == "dark") { } else if (oldTheme == "dark") {
StylesheetUtils.removeSheet( StylesheetUtils.removeSheet(window, SCROLLBARS_URL, "agent");
window,
scrollbarsUrl,
"agent"
);
} }
forceStyle(); forceStyle();
} }
@ -92,6 +130,8 @@
// Final notification for further theme-switching related logic. // Final notification for further theme-switching related logic.
gDevTools.emit("theme-switched", window, newTheme, oldTheme); gDevTools.emit("theme-switched", window, newTheme, oldTheme);
Promise.all(loadEvents).then(notifyWindow, console.error.bind(console));
} }
function handlePrefChange(event, data) { function handlePrefChange(event, data) {
@ -101,7 +141,6 @@
} }
const { classes: Cc, interfaces: Ci, utils: Cu } = Components; const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://devtools/client/framework/gDevTools.jsm"); Cu.import("resource://devtools/client/framework/gDevTools.jsm");
const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {}); const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});

View File

@ -8,8 +8,8 @@ const cssAutoCompleter = require("devtools/client/sourceeditor/css-autocompleter
const { AutocompletePopup } = require("devtools/client/shared/autocomplete-popup"); const { AutocompletePopup } = require("devtools/client/shared/autocomplete-popup");
const CM_TERN_SCRIPTS = [ const CM_TERN_SCRIPTS = [
"chrome://devtools/content/sourceeditor/codemirror/tern/tern.js", "chrome://devtools/content/sourceeditor/codemirror/addon/tern/tern.js",
"chrome://devtools/content/sourceeditor/codemirror/hint/show-hint.js" "chrome://devtools/content/sourceeditor/codemirror/addon/hint/show-hint.js"
]; ];
const autocompleteMap = new WeakMap(); const autocompleteMap = new WeakMap();

View File

@ -47,35 +47,35 @@ const { OS } = Services.appinfo;
const CM_STYLES = [ const CM_STYLES = [
"chrome://devtools/skin/common.css", "chrome://devtools/skin/common.css",
"chrome://devtools/content/sourceeditor/codemirror/codemirror.css", "chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css",
"chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.css", "chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.css",
"chrome://devtools/content/sourceeditor/codemirror/mozilla.css" "chrome://devtools/content/sourceeditor/codemirror/mozilla.css"
]; ];
const CM_SCRIPTS = [ const CM_SCRIPTS = [
"chrome://devtools/content/shared/theme-switching.js", "chrome://devtools/content/shared/theme-switching.js",
"chrome://devtools/content/sourceeditor/codemirror/codemirror.js", "chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js",
"chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js", "chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js",
"chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js", "chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js",
"chrome://devtools/content/sourceeditor/codemirror/search/search.js", "chrome://devtools/content/sourceeditor/codemirror/addon/search/search.js",
"chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js", "chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.js",
"chrome://devtools/content/sourceeditor/codemirror/edit/closebrackets.js", "chrome://devtools/content/sourceeditor/codemirror/addon/edit/closebrackets.js",
"chrome://devtools/content/sourceeditor/codemirror/comment/comment.js", "chrome://devtools/content/sourceeditor/codemirror/addon/comment/comment.js",
"chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js", "chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js",
"chrome://devtools/content/sourceeditor/codemirror/mode/xml.js", "chrome://devtools/content/sourceeditor/codemirror/mode/xml.js",
"chrome://devtools/content/sourceeditor/codemirror/mode/css.js", "chrome://devtools/content/sourceeditor/codemirror/mode/css.js",
"chrome://devtools/content/sourceeditor/codemirror/mode/htmlmixed.js", "chrome://devtools/content/sourceeditor/codemirror/mode/htmlmixed.js",
"chrome://devtools/content/sourceeditor/codemirror/mode/clike.js", "chrome://devtools/content/sourceeditor/codemirror/mode/clike.js",
"chrome://devtools/content/sourceeditor/codemirror/selection/active-line.js", "chrome://devtools/content/sourceeditor/codemirror/addon/selection/active-line.js",
"chrome://devtools/content/sourceeditor/codemirror/edit/trailingspace.js", "chrome://devtools/content/sourceeditor/codemirror/addon/edit/trailingspace.js",
"chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js", "chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js",
"chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js", "chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js",
"chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js", "chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js",
"chrome://devtools/content/sourceeditor/codemirror/fold/foldcode.js", "chrome://devtools/content/sourceeditor/codemirror/addon/fold/foldcode.js",
"chrome://devtools/content/sourceeditor/codemirror/fold/brace-fold.js", "chrome://devtools/content/sourceeditor/codemirror/addon/fold/brace-fold.js",
"chrome://devtools/content/sourceeditor/codemirror/fold/comment-fold.js", "chrome://devtools/content/sourceeditor/codemirror/addon/fold/comment-fold.js",
"chrome://devtools/content/sourceeditor/codemirror/fold/xml-fold.js", "chrome://devtools/content/sourceeditor/codemirror/addon/fold/xml-fold.js",
"chrome://devtools/content/sourceeditor/codemirror/fold/foldgutter.js" "chrome://devtools/content/sourceeditor/codemirror/addon/fold/foldgutter.js"
]; ];
const CM_IFRAME = const CM_IFRAME =

View File

@ -3,15 +3,15 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>CodeMirror: Basic Tests</title> <title>CodeMirror: Basic Tests</title>
<link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/codemirror.css"> <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="cm_mode_test.css"> <link rel="stylesheet" href="cm_mode_test.css">
<!--<link rel="stylesheet" href="../doc/docs.css">--> <!--<link rel="stylesheet" href="../doc/docs.css">-->
<script src="chrome://devtools/content/sourceeditor/codemirror/codemirror.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/comment/comment.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/comment/comment.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js"></script>

View File

@ -3,15 +3,15 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>CodeMirror: VIM/Emacs tests</title> <title>CodeMirror: VIM/Emacs tests</title>
<link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/codemirror.css"> <link rel="stylesheet" href="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="cm_mode_test.css"> <link rel="stylesheet" href="cm_mode_test.css">
<!--<link rel="stylesheet" href="../doc/docs.css">--> <!--<link rel="stylesheet" href="../doc/docs.css">-->
<script src="chrome://devtools/content/sourceeditor/codemirror/codemirror.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/comment/comment.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/addon/comment/comment.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/mode/javascript.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/vim.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js"></script> <script src="chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js"></script>

View File

@ -290,7 +290,7 @@ body {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
--timelime-border-color: var(--theme-body-color); --timeline-border-color: var(--theme-body-color);
--timeline-background-color: var(--theme-splitter-color); --timeline-background-color: var(--theme-splitter-color);
/* Iterations of the animation are displayed with a repeating linear-gradient /* Iterations of the animation are displayed with a repeating linear-gradient
@ -299,25 +299,25 @@ body {
the border of this element */ the border of this element */
background-image: background-image:
linear-gradient(to right, linear-gradient(to right,
var(--timelime-border-color) 0, var(--timeline-border-color) 0,
var(--timelime-border-color) 1px, var(--timeline-border-color) 1px,
transparent 1px, transparent 1px,
transparent 2px); transparent 2px);
background-repeat: repeat-x; background-repeat: repeat-x;
background-position: -1px 0; background-position: -1px 0;
border: 1px solid var(--timelime-border-color); border: 1px solid var(--timeline-border-color);
/* The background color is set independently */ /* The background color is set independently */
background-color: var(--timeline-background-color); background-color: var(--timeline-background-color);
} }
.animation-timeline .animation .cssanimation { .animation-timeline .animation .cssanimation {
--timelime-border-color: var(--theme-highlight-lightorange); --timeline-border-color: var(--theme-highlight-lightorange);
--timeline-background-color: var(--theme-contrast-background); --timeline-background-color: var(--theme-contrast-background);
} }
.animation-timeline .animation .csstransition { .animation-timeline .animation .csstransition {
--timelime-border-color: var(--theme-highlight-bluegrey); --timeline-border-color: var(--theme-highlight-bluegrey);
--timeline-background-color: var(--theme-highlight-blue); --timeline-background-color: var(--theme-highlight-blue);
} }
@ -369,14 +369,14 @@ body {
box-sizing: border-box; box-sizing: border-box;
height: calc(100% + 2px); height: calc(100% + 2px);
border: 1px solid var(--timelime-border-color); border: 1px solid var(--timeline-border-color);
border-width: 1px 0 1px 1px; border-width: 1px 0 1px 1px;
background-image: repeating-linear-gradient(45deg, background-image: repeating-linear-gradient(45deg,
transparent, transparent,
transparent 1px, transparent 1px,
var(--theme-selection-color) 1px, var(--theme-selection-color) 1px,
var(--theme-selection-color) 4px); var(--theme-selection-color) 4px);
background-color: var(--timelime-border-color); background-color: var(--timeline-border-color);
} }
.animation-timeline .animation .delay.negative { .animation-timeline .animation .delay.negative {

View File

@ -6,7 +6,7 @@
box-sizing: border-box; box-sizing: border-box;
} }
.theme-sidebar body { body.theme-sidebar {
/* The view will grow bigger as the window gets resized, until 400px */ /* The view will grow bigger as the window gets resized, until 400px */
max-width: 400px; max-width: 400px;
margin: 0px auto; margin: 0px auto;

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,8 @@ qemu = true
[test_cellbroadcast_etws.js] [test_cellbroadcast_etws.js]
[test_cellbroadcast_gsm.js] [test_cellbroadcast_gsm.js]
[test_cellbroadcast_gsm_language_and_body.js] [test_cellbroadcast_gsm_language_and_body.js]
disabled = Bug 1231462
[test_cellbroadcast_multi_sim.js] [test_cellbroadcast_multi_sim.js]
[test_cellbroadcast_umts.js] [test_cellbroadcast_umts.js]
[test_cellbroadcast_umts_language_and_body.js] [test_cellbroadcast_umts_language_and_body.js]
disabled = Bug 1224992

View File

@ -1302,21 +1302,18 @@ struct StorageDirectoryHelper::OriginProps
nsCOMPtr<nsIFile> mDirectory; nsCOMPtr<nsIFile> mDirectory;
nsCString mSpec; nsCString mSpec;
uint32_t mAppId; PrincipalOriginAttributes mAttrs;
int64_t mTimestamp; int64_t mTimestamp;
nsCString mGroup; nsCString mGroup;
nsCString mOrigin; nsCString mOrigin;
Type mType; Type mType;
bool mInMozBrowser;
bool mIsApp; bool mIsApp;
public: public:
explicit OriginProps() explicit OriginProps()
: mAppId(kNoAppId) : mTimestamp(0)
, mTimestamp(0)
, mType(eContent) , mType(eContent)
, mInMozBrowser(false)
, mIsApp(false) , mIsApp(false)
{ } { }
}; };
@ -1383,14 +1380,11 @@ public:
static bool static bool
ParseOrigin(const nsACString& aOrigin, ParseOrigin(const nsACString& aOrigin,
uint32_t* aAppId, nsCString& aSpec,
bool* aInMozBrowser, PrincipalOriginAttributes* aAttrs);
nsCString& aSpec);
bool bool
Parse(uint32_t* aAppId, Parse(nsACString& aSpec, PrincipalOriginAttributes* aAttrs);
bool* aInMozBrowser,
nsACString& aSpec);
private: private:
void void
@ -5992,19 +5986,18 @@ StorageDirectoryHelper::AddOriginDirectory(nsIFile* aDirectory)
originProps->mType = OriginProps::eChrome; originProps->mType = OriginProps::eChrome;
} else { } else {
nsCString spec; nsCString spec;
uint32_t appId; PrincipalOriginAttributes attrs;
bool inMozBrowser; bool result = OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName),
if (NS_WARN_IF(!OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName), spec, &attrs);
&appId, &inMozBrowser, spec))) { if (NS_WARN_IF(!result)) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
OriginProps* originProps = mOriginProps.AppendElement(); OriginProps* originProps = mOriginProps.AppendElement();
originProps->mDirectory = aDirectory; originProps->mDirectory = aDirectory;
originProps->mSpec = spec; originProps->mSpec = spec;
originProps->mAppId = appId; originProps->mAttrs = attrs;
originProps->mType = OriginProps::eContent; originProps->mType = OriginProps::eContent;
originProps->mInMozBrowser = inMozBrowser;
if (mCreate) { if (mCreate) {
int64_t timestamp = INT64_MIN; int64_t timestamp = INT64_MIN;
@ -6178,17 +6171,10 @@ StorageDirectoryHelper::RunOnMainThread()
return rv; return rv;
} }
nsCOMPtr<nsIPrincipal> principal; nsCOMPtr<nsIPrincipal> principal =
if (originProps.mAppId == kUnknownAppId) { BasePrincipal::CreateCodebasePrincipal(uri, originProps.mAttrs);
rv = secMan->GetSimpleCodebasePrincipal(uri, if (NS_WARN_IF(!principal)) {
getter_AddRefs(principal)); return NS_ERROR_FAILURE;
} else {
PrincipalOriginAttributes attrs(originProps.mAppId, originProps.mInMozBrowser);
principal = BasePrincipal::CreateCodebasePrincipal(uri, attrs);
rv = principal ? NS_OK : NS_ERROR_FAILURE;
}
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
} }
if (mCreate) { if (mCreate) {
@ -6239,30 +6225,20 @@ StorageDirectoryHelper::Run()
// static // static
bool bool
OriginParser::ParseOrigin(const nsACString& aOrigin, OriginParser::ParseOrigin(const nsACString& aOrigin,
uint32_t* aAppId, nsCString& aSpec,
bool* aInMozBrowser, PrincipalOriginAttributes* aAttrs)
nsCString& aSpec)
{ {
MOZ_ASSERT(!aOrigin.IsEmpty()); MOZ_ASSERT(!aOrigin.IsEmpty());
MOZ_ASSERT(aAppId); MOZ_ASSERT(aAttrs);
MOZ_ASSERT(aInMozBrowser);
OriginParser parser(aOrigin); OriginParser parser(aOrigin);
return parser.Parse(aSpec, aAttrs);
if (!parser.Parse(aAppId, aInMozBrowser, aSpec)) {
return false;
}
return true;
} }
bool bool
OriginParser::Parse(uint32_t* aAppId, OriginParser::Parse(nsACString& aSpec, PrincipalOriginAttributes* aAttrs)
bool* aInMozBrowser,
nsACString& aSpec)
{ {
MOZ_ASSERT(aAppId); MOZ_ASSERT(aAttrs);
MOZ_ASSERT(aInMozBrowser);
while (mTokenizer.hasMoreTokens()) { while (mTokenizer.hasMoreTokens()) {
const nsDependentCSubstring& token = mTokenizer.nextToken(); const nsDependentCSubstring& token = mTokenizer.nextToken();
@ -6294,8 +6270,7 @@ OriginParser::Parse(uint32_t* aAppId,
MOZ_ASSERT(mState == eComplete || mState == eHandledTrailingSeparator); MOZ_ASSERT(mState == eComplete || mState == eHandledTrailingSeparator);
*aAppId = mAppId; *aAttrs = PrincipalOriginAttributes(mAppId, mInMozBrowser);
*aInMozBrowser = mInMozBrowser;
nsAutoCString spec(mSchema); nsAutoCString spec(mSchema);

View File

@ -75,6 +75,7 @@ import org.mozilla.gecko.util.MenuUtils;
import org.mozilla.gecko.util.NativeEventListener; import org.mozilla.gecko.util.NativeEventListener;
import org.mozilla.gecko.util.NativeJSObject; import org.mozilla.gecko.util.NativeJSObject;
import org.mozilla.gecko.util.PrefUtils; import org.mozilla.gecko.util.PrefUtils;
import org.mozilla.gecko.util.ScreenshotObserver;
import org.mozilla.gecko.util.StringUtils; import org.mozilla.gecko.util.StringUtils;
import org.mozilla.gecko.util.ThreadUtils; import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.gecko.util.UIAsyncTask; import org.mozilla.gecko.util.UIAsyncTask;
@ -88,6 +89,7 @@ import android.app.Notification;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
@ -107,6 +109,7 @@ import android.nfc.NfcEvent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.StrictMode; import android.os.StrictMode;
import android.provider.MediaStore;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
@ -268,6 +271,7 @@ public class BrowserApp extends GeckoApp
private boolean mHideWebContentOnAnimationEnd; private boolean mHideWebContentOnAnimationEnd;
private final DynamicToolbar mDynamicToolbar = new DynamicToolbar(); private final DynamicToolbar mDynamicToolbar = new DynamicToolbar();
private final ScreenshotObserver mScreenshotObserver = new ScreenshotObserver();
@Override @Override
public View onCreateView(final String name, final Context context, final AttributeSet attrs) { public View onCreateView(final String name, final Context context, final AttributeSet attrs) {
@ -726,6 +730,15 @@ public class BrowserApp extends GeckoApp
} }
}); });
// Watch for screenshots while browser is in foreground.
mScreenshotObserver.setListener(getContext(), new ScreenshotObserver.OnScreenshotListener() {
@Override
public void onScreenshotTaken(String data, String title) {
// Treat screenshots as a sharing method.
Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.BUTTON, "screenshot");
}
});
// Set the maximum bits-per-pixel the favicon system cares about. // Set the maximum bits-per-pixel the favicon system cares about.
IconDirectoryEntry.setMaxBPP(GeckoAppShell.getScreenDepth()); IconDirectoryEntry.setMaxBPP(GeckoAppShell.getScreenDepth());
} }
@ -905,6 +918,8 @@ public class BrowserApp extends GeckoApp
"Prompt:ShowTop"); "Prompt:ShowTop");
processTabQueue(); processTabQueue();
mScreenshotObserver.start();
} }
@Override @Override
@ -917,6 +932,8 @@ public class BrowserApp extends GeckoApp
// Register for Prompt:ShowTop so we can foreground this activity even if it's hidden. // Register for Prompt:ShowTop so we can foreground this activity even if it's hidden.
EventDispatcher.getInstance().registerGeckoThreadListener((GeckoEventListener) this, EventDispatcher.getInstance().registerGeckoThreadListener((GeckoEventListener) this,
"Prompt:ShowTop"); "Prompt:ShowTop");
mScreenshotObserver.stop();
} }
@Override @Override

View File

@ -0,0 +1,129 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* 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/. */
package org.mozilla.gecko.util;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.util.ThreadUtils;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.util.Log;
public class ScreenshotObserver {
private static final String LOGTAG = "GeckoScreenshotObserver";
public Context context;
/**
* Listener for screenshot changes.
*/
public interface OnScreenshotListener {
/**
* This callback is executed on the UI thread.
*/
public void onScreenshotTaken(String data, String title);
}
private OnScreenshotListener listener;
public ScreenshotObserver() {
}
public void setListener(Context context, OnScreenshotListener listener) {
this.context = context;
this.listener = listener;
}
private MediaObserver mediaObserver;
private String[] mediaProjections = new String[] {
MediaStore.Images.ImageColumns.DATA,
MediaStore.Images.ImageColumns.DISPLAY_NAME,
MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
MediaStore.Images.ImageColumns.DATE_TAKEN,
MediaStore.Images.ImageColumns.TITLE
};
public void start() {
if (!Versions.feature14Plus) {
return;
}
try {
if (mediaObserver == null) {
mediaObserver = new MediaObserver();
context.getContentResolver().registerContentObserver(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, false, mediaObserver);
}
} catch (Exception e) {
Log.e(LOGTAG, "Failure to start watching media: ", e);
}
}
public void stop() {
if (!Versions.feature14Plus) {
return;
}
try {
context.getContentResolver().unregisterContentObserver(mediaObserver);
mediaObserver = null;
} catch (Exception e) {
Log.e(LOGTAG, "Failure to stop watching media: ", e);
}
}
public void onMediaChange(final Uri uri) {
// Make sure we are on not on the main thread.
final ContentResolver cr = context.getContentResolver();
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
public void run() {
// Find the most recent image added to the MediaStore and see if it's a screenshot.
try {
Cursor cursor = cr.query(uri, mediaProjections, null, null, MediaStore.Images.ImageColumns.DATE_ADDED + " DESC LIMIT 1");
if (cursor == null) {
return;
}
while (cursor.moveToNext()) {
String data = cursor.getString(0);
Log.i(LOGTAG, "data: " + data);
String display = cursor.getString(1);
Log.i(LOGTAG, "display: " + display);
String album = cursor.getString(2);
Log.i(LOGTAG, "album: " + album);
long date = cursor.getLong(3);
String title = cursor.getString(4);
Log.i(LOGTAG, "title: " + title);
if (album != null && album.toLowerCase().contains("screenshot")) {
if (listener != null) {
listener.onScreenshotTaken(data, title);
break;
}
}
}
cursor.close();
} catch (Exception e) {
Log.e(LOGTAG, "Failure to process media change: ", e);
}
}
});
}
private class MediaObserver extends ContentObserver {
public MediaObserver() {
super(null);
}
@Override
public void onChange(boolean selfChange) {
super.onChange(selfChange);
onMediaChange(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
}
}
}

View File

@ -118,6 +118,7 @@ gujar.sources += ['java/org/mozilla/gecko/' + x for x in [
'util/PrefUtils.java', 'util/PrefUtils.java',
'util/ProxySelector.java', 'util/ProxySelector.java',
'util/RawResource.java', 'util/RawResource.java',
'util/ScreenshotObserver.java',
'util/StringUtils.java', 'util/StringUtils.java',
'util/ThreadUtils.java', 'util/ThreadUtils.java',
'util/UIAsyncTask.java', 'util/UIAsyncTask.java',

View File

@ -8,6 +8,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
const APK_MIME_TYPE = "application/vnd.android.package-archive"; const APK_MIME_TYPE = "application/vnd.android.package-archive";
const OMA_DOWNLOAD_DESCRIPTOR_MIME_TYPE = "application/vnd.oma.dd+xml";
const PREF_BD_USEDOWNLOADDIR = "browser.download.useDownloadDir"; const PREF_BD_USEDOWNLOADDIR = "browser.download.useDownloadDir";
const URI_GENERIC_ICON_DOWNLOAD = "drawable://alert_download"; const URI_GENERIC_ICON_DOWNLOAD = "drawable://alert_download";
@ -94,25 +95,23 @@ HelperAppLauncherDialog.prototype = {
let mimeType = this._getMimeTypeFromLauncher(launcher); let mimeType = this._getMimeTypeFromLauncher(launcher);
// Straight equality: nsIMIMEInfo normalizes. // Straight equality: nsIMIMEInfo normalizes.
return APK_MIME_TYPE == mimeType; return APK_MIME_TYPE == mimeType || OMA_DOWNLOAD_DESCRIPTOR_MIME_TYPE == mimeType;
},
/**
* Returns true if `launcher` represents a download for which we wish to
* offer a "Save to disk" option.
*/
_shouldAddSaveToDiskIntent: function(launcher) {
let mimeType = this._getMimeTypeFromLauncher(launcher);
// We can't handle OMA downloads. So don't even try. (Bug 1219078)
return mimeType != OMA_DOWNLOAD_DESCRIPTOR_MIME_TYPE;
}, },
show: function hald_show(aLauncher, aContext, aReason) { show: function hald_show(aLauncher, aContext, aReason) {
if (!this._canDownload(aLauncher.source)) { if (!this._canDownload(aLauncher.source)) {
aLauncher.cancel(Cr.NS_BINDING_ABORTED); this._refuseDownload(aLauncher);
let win = this.getNativeWindow();
if (!win) {
// Oops.
Services.console.logStringMessage("Refusing download, but can't show a toast.");
return;
}
Services.console.logStringMessage("Refusing download of non-downloadable file.");
let bundle = Services.strings.createBundle("chrome://browser/locale/handling.properties");
let failedText = bundle.GetStringFromName("download.blocked");
win.toast.show(failedText, "long");
return; return;
} }
@ -123,6 +122,7 @@ HelperAppLauncherDialog.prototype = {
mimeType: aLauncher.MIMEInfo.MIMEType, mimeType: aLauncher.MIMEInfo.MIMEType,
}); });
if (this._shouldAddSaveToDiskIntent(aLauncher)) {
// Add a fake intent for save to disk at the top of the list. // Add a fake intent for save to disk at the top of the list.
apps.unshift({ apps.unshift({
name: bundle.GetStringFromName("helperapps.saveToDisk"), name: bundle.GetStringFromName("helperapps.saveToDisk"),
@ -136,6 +136,13 @@ HelperAppLauncherDialog.prototype = {
return true; return true;
} }
}); });
}
// We do not handle this download and there are no apps that want to do it
if (apps.length === 0) {
this._refuseDownload(aLauncher);
return;
}
let callback = function(app) { let callback = function(app) {
aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp; aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
@ -187,6 +194,22 @@ HelperAppLauncherDialog.prototype = {
}); });
}, },
_refuseDownload: function(aLauncher) {
aLauncher.cancel(Cr.NS_BINDING_ABORTED);
let win = this.getNativeWindow();
if (!win) {
// Oops.
Services.console.logStringMessage("Refusing download, but can't show a toast.");
return;
}
Services.console.logStringMessage("Refusing download of non-downloadable file.");
let bundle = Services.strings.createBundle("chrome://browser/locale/handling.properties");
let failedText = bundle.GetStringFromName("download.blocked");
win.toast.show(failedText, "long");
},
_getPrefName: function getPrefName(mimetype) { _getPrefName: function getPrefName(mimetype) {
return "browser.download.preferred." + mimetype.replace("\\", "."); return "browser.download.preferred." + mimetype.replace("\\", ".");
}, },

View File

@ -228,7 +228,18 @@ this.ReaderMode = {
} }
} }
} }
if (xhr.responseURL != url) { let responseURL = xhr.responseURL;
let givenURL = url;
// Convert these to real URIs to make sure the escaping (or lack
// thereof) is identical:
try {
responseURL = Services.io.newURI(responseURL, null, null).spec;
} catch (ex) { /* Ignore errors - we'll use what we had before */ }
try {
givenURL = Services.io.newURI(givenURL, null, null).spec;
} catch (ex) { /* Ignore errors - we'll use what we had before */ }
if (responseURL != givenURL) {
// We were redirected without a meta refresh tag. // We were redirected without a meta refresh tag.
// Force redirect to the correct place: // Force redirect to the correct place:
reject({newURL: xhr.responseURL}); reject({newURL: xhr.responseURL});

View File

@ -98,6 +98,7 @@ add_task(function* initializeState() {
registerCleanupFunction(() => { registerCleanupFunction(() => {
Services.prefs.clearUserPref("experiments.enabled"); Services.prefs.clearUserPref("experiments.enabled");
Services.prefs.clearUserPref("toolkit.telemetry.enabled");
if (gHttpServer) { if (gHttpServer) {
gHttpServer.stop(() => {}); gHttpServer.stop(() => {});
if (gSavedManifestURI !== undefined) { if (gSavedManifestURI !== undefined) {
@ -294,6 +295,7 @@ add_task(function* testActivateExperiment() {
// We need to remove the cache file to help ensure consistent state. // We need to remove the cache file to help ensure consistent state.
yield OS.File.remove(gExperiments._cacheFilePath); yield OS.File.remove(gExperiments._cacheFilePath);
Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
Services.prefs.setBoolPref("experiments.enabled", true); Services.prefs.setBoolPref("experiments.enabled", true);
info("Initializing experiments service."); info("Initializing experiments service.");
@ -635,6 +637,8 @@ add_task(function* testCleanup() {
yield OS.File.remove(gExperiments._cacheFilePath); yield OS.File.remove(gExperiments._cacheFilePath);
yield gExperiments.uninit(); yield gExperiments.uninit();
yield gExperiments.init(); yield gExperiments.init();
Services.prefs.clearUserPref("toolkit.telemetry.enabled");
} }
// Check post-conditions. // Check post-conditions.

View File

@ -57,3 +57,5 @@ toolkit.jar:
* skin/classic/global/in-content/common.css (in-content/common.css) * skin/classic/global/in-content/common.css (in-content/common.css)
* skin/classic/global/in-content/info-pages.css (in-content/info-pages.css) * skin/classic/global/in-content/info-pages.css (in-content/info-pages.css)
skin/classic/global/toolbar/spring.png (toolbar/spring.png) skin/classic/global/toolbar/spring.png (toolbar/spring.png)
skin/classic/global/tree/twisty-clsd.png (tree/twisty-clsd.png)
skin/classic/global/tree/twisty-open.png (tree/twisty-open.png)

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 192 B

View File

@ -10,11 +10,6 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#alertBox[hasBodyText] > #alertTextBox,
#alertBox[hasOrigin] > #alertTitleBox {
border-bottom: 1px solid ThreeDShadow;
}
#alertBox[animate] { #alertBox[animate] {
animation-timing-function: cubic-bezier(.12,1.23,.48,1.09); animation-timing-function: cubic-bezier(.12,1.23,.48,1.09);
} }
@ -59,22 +54,30 @@
} }
#alertImage { #alertImage {
width: 64px; width: 80px;
height: 80px;
max-width: 80px;
max-height: 80px;
object-fit: scale-down;
margin: 0 7px 7px;
} }
.alertTextBox { .alertTextBox {
padding-top: 8px; padding-top: 4px;
padding-inline-start: 8px;
/* The text box width is increased to make up for the lack of image when one /* The text box width is increased to make up for the lack of image when one
is not provided. 319px is the text box width when a picture is present, is not provided. 349px is the text box width when a picture is present,
255px, plus the width of the image, 64px. */ 255px, plus the width of the image, 80px, and the margins, 7px each. */
width: 319px; width: 349px;
} }
#alertBox[hasImage] > box > #alertTextBox { #alertBox[hasImage] > box > #alertTextBox {
width: 255px; width: 255px;
} }
#alertBox:not([hasImage]) > box > #alertTextBox {
padding-inline-start: 8px;
}
#alertTextLabel { #alertTextLabel {
padding-inline-end: 8px; padding-inline-end: 8px;
} }
@ -82,13 +85,17 @@
.alertTitle { .alertTitle {
-moz-box-flex: 1; -moz-box-flex: 1;
font-weight: bold; font-weight: bold;
padding: 6px 8px; padding: 6px 8px 0;
width: 255px; width: 255px;
} }
#alertFooter { #alertFooter {
-moz-box-align: end; -moz-box-align: start;
padding-bottom: 2px; }
#alertBox:not([hasOrigin]) > box > #alertTextBox,
#alertFooter {
padding-bottom: 5px;
} }
#alertSourceLabel { #alertSourceLabel {
@ -103,7 +110,7 @@
border-width: 0; border-width: 0;
border-radius: 20px; border-radius: 20px;
min-width: 0; min-width: 0;
list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities"); list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities-grayscale");
margin-inline-end: 0; margin-inline-end: 0;
margin-bottom: 0; margin-bottom: 0;
} }

View File

@ -13,6 +13,9 @@
use[id$="-native"] { use[id$="-native"] {
fill: GrayText; fill: GrayText;
} }
use[id$="-grayscale"] {
fill: #4d4d4d;
}
use[id$="-inverted"] { use[id$="-inverted"] {
fill: #ddd; fill: #ddd;
} }
@ -22,5 +25,6 @@
</defs> </defs>
<use id="utilities" xlink:href="#utilities-shape"/> <use id="utilities" xlink:href="#utilities-shape"/>
<use id="utilities-native" xlink:href="#utilities-shape"/> <use id="utilities-native" xlink:href="#utilities-shape"/>
<use id="utilities-grayscale" xlink:href="#utilities-shape"/>
<use id="utilities-inverted" xlink:href="#utilities-shape"/> <use id="utilities-inverted" xlink:href="#utilities-shape"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -131,14 +131,6 @@
skin/classic/global/tree/sort-dsc.png (../../windows/global/tree/sort-dsc.png) skin/classic/global/tree/sort-dsc.png (../../windows/global/tree/sort-dsc.png)
skin/classic/global/tree/sort-asc-classic.png (../../windows/global/tree/sort-asc-classic.png) skin/classic/global/tree/sort-asc-classic.png (../../windows/global/tree/sort-asc-classic.png)
skin/classic/global/tree/sort-dsc-classic.png (../../windows/global/tree/sort-dsc-classic.png) skin/classic/global/tree/sort-dsc-classic.png (../../windows/global/tree/sort-dsc-classic.png)
skin/classic/global/tree/twisty-clsd.png (../../windows/global/tree/twisty-clsd.png)
skin/classic/global/tree/twisty-clsd-rtl.png (../../windows/global/tree/twisty-clsd-rtl.png)
skin/classic/global/tree/twisty-clsd-hover.png (../../windows/global/tree/twisty-clsd-hover.png)
skin/classic/global/tree/twisty-clsd-hover-rtl.png (../../windows/global/tree/twisty-clsd-hover-rtl.png)
skin/classic/global/tree/twisty-open.png (../../windows/global/tree/twisty-open.png)
skin/classic/global/tree/twisty-open-rtl.png (../../windows/global/tree/twisty-open-rtl.png)
skin/classic/global/tree/twisty-open-hover.png (../../windows/global/tree/twisty-open-hover.png)
skin/classic/global/tree/twisty-open-hover-rtl.png (../../windows/global/tree/twisty-open-hover-rtl.png)
skin/classic/help/Toolbar.png (../../windows/help/Toolbar.png) skin/classic/help/Toolbar.png (../../windows/help/Toolbar.png)
skin/classic/help/Toolbar-rtl.png (../../windows/help/Toolbar-rtl.png) skin/classic/help/Toolbar-rtl.png (../../windows/help/Toolbar-rtl.png)

View File

@ -30,21 +30,23 @@
border: none !important; border: none !important;
} }
.alertCloseBox {
/* The close button is larger on Windows and has a large
circle around it, so we add more space between the close
button and the edge of the window. */
margin-inline-end: 2px;
}
#alertSettings { #alertSettings {
/* The close button is larger on Windows, so the /* The close button is larger on Windows, so the
gear button is moved over to accomodate it and gear button is moved over to accomodate it and
keep the two buttons horizontally aligned together. */ keep the two buttons horizontally aligned together. */
margin-inline-end: 3px; margin-inline-end: 5px;
} }
@media (-moz-windows-default-theme) { @media (-moz-windows-default-theme) {
#alertBox[hasBodyText] > #alertTextBox,
#alertBox[hasOrigin] > #alertTitleBox {
border-bottom-color: rgba(107,107,107,.4);
}
#alertBox { #alertBox {
border-color: rgba(107,107,107,.4); border-color: rgba(107,107,107,.3);
background-color: rgba(255,255,255,.9); background-color: rgba(255,255,255,.9);
color: rgba(0,0,0,.9); color: rgba(0,0,0,.9);
} }

View File

@ -138,11 +138,11 @@ button[type="disclosure"] {
margin: 0px !important; margin: 0px !important;
padding: 0px !important; padding: 0px !important;
-moz-appearance: none; -moz-appearance: none;
list-style-image: url("chrome://global/skin/tree/twisty-clsd.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd");
min-width: 0px !important; min-width: 0px !important;
background-color: transparent; background-color: transparent;
} }
button[type="disclosure"][open="true"] { button[type="disclosure"][open="true"] {
list-style-image: url("chrome://global/skin/tree/twisty-open.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#open");
} }

View File

@ -93,8 +93,9 @@ toolkit.jar:
skin/classic/global/toolbar/spring-XP.png (toolbar/spring-XP.png) skin/classic/global/toolbar/spring-XP.png (toolbar/spring-XP.png)
skin/classic/global/tree/sort-asc-XP.png (tree/sort-asc-XP.png) skin/classic/global/tree/sort-asc-XP.png (tree/sort-asc-XP.png)
skin/classic/global/tree/sort-dsc-XP.png (tree/sort-dsc-XP.png) skin/classic/global/tree/sort-dsc-XP.png (tree/sort-dsc-XP.png)
skin/classic/global/tree/twisty-clsd-XP.png (tree/twisty-clsd-XP.png) skin/classic/global/tree/twisty.svg (tree/twisty.svg)
skin/classic/global/tree/twisty-open-XP.png (tree/twisty-open-XP.png) skin/classic/global/tree/twisty-XP.svg (tree/twisty-XP.svg)
skin/classic/global/tree/twisty-Vista78.svg (tree/twisty-Vista78.svg)
#if MOZ_BUILD_APP == browser #if MOZ_BUILD_APP == browser
[browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: [browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
@ -137,10 +138,20 @@ toolkit.jar:
% override chrome://global/skin/toolbar/spring.png chrome://global/skin/toolbar/spring-XP.png osversion<6 % override chrome://global/skin/toolbar/spring.png chrome://global/skin/toolbar/spring-XP.png osversion<6
% override chrome://global/skin/tree/sort-asc.png chrome://global/skin/tree/sort-asc-XP.png osversion<6 % override chrome://global/skin/tree/sort-asc.png chrome://global/skin/tree/sort-asc-XP.png osversion<6
% override chrome://global/skin/tree/sort-dsc.png chrome://global/skin/tree/sort-dsc-XP.png osversion<6 % override chrome://global/skin/tree/sort-dsc.png chrome://global/skin/tree/sort-dsc-XP.png osversion<6
% override chrome://global/skin/tree/twisty-clsd.png chrome://global/skin/tree/twisty-clsd-XP.png osversion<6
% override chrome://global/skin/tree/twisty-open.png chrome://global/skin/tree/twisty-open-XP.png osversion<6
% override chrome://global/skin/icons/close.png chrome://global/skin/icons/close-XPVista7.png osversion<=6.1 % override chrome://global/skin/icons/close.png chrome://global/skin/icons/close-XPVista7.png osversion<=6.1
% override chrome://global/skin/icons/close@2x.png chrome://global/skin/icons/close-XPVista7@2x.png osversion<=6.1 % override chrome://global/skin/icons/close@2x.png chrome://global/skin/icons/close-XPVista7@2x.png osversion<=6.1
% override chrome://global/skin/icons/close-inverted.png chrome://global/skin/icons/close-inverted-XPVista7.png osversion<=6.1 % override chrome://global/skin/icons/close-inverted.png chrome://global/skin/icons/close-inverted-XPVista7.png osversion<=6.1
% override chrome://global/skin/icons/close-inverted@2x.png chrome://global/skin/icons/close-inverted-XPVista7@2x.png osversion<=6.1 % override chrome://global/skin/icons/close-inverted@2x.png chrome://global/skin/icons/close-inverted-XPVista7@2x.png osversion<=6.1
% override chrome://global/skin/tree/twisty.svg#clsd chrome://global/skin/tree/twisty-Vista78.svg#clsd osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#clsd-rtl chrome://global/skin/tree/twisty-Vista78.svg#clsd-rtl osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#clsd-hover chrome://global/skin/tree/twisty-Vista78.svg#clsd-hover osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#clsd-hover-rtl chrome://global/skin/tree/twisty-Vista78.svg#clsd-hover-rtl osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#open chrome://global/skin/tree/twisty-Vista78.svg#open osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#open-rtl chrome://global/skin/tree/twisty-Vista78.svg#open-rtl osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#open-hover chrome://global/skin/tree/twisty-Vista78.svg#open-hover osversion<=6.3
% override chrome://global/skin/tree/twisty.svg#open-hover-rtl chrome://global/skin/tree/twisty-Vista78.svg#open-hover-rtl osversion<=6.3
# to be sure osversion<6 has always higher precedence than osversion<=6.3 we override twisty-Vista78.svg instead of twisty.svg
% override chrome://global/skin/tree/twisty-Vista78.svg#clsd chrome://global/skin/tree/twisty-XP.svg#clsd osversion<6
% override chrome://global/skin/tree/twisty-Vista78.svg#open chrome://global/skin/tree/twisty-XP.svg#open osversion<6

View File

@ -317,12 +317,11 @@ treechildren::-moz-tree-twisty {
-moz-padding-end: 4px; -moz-padding-end: 4px;
padding-top: 1px; padding-top: 1px;
width: 9px; /* The image's width is 9 pixels */ width: 9px; /* The image's width is 9 pixels */
list-style-image: url("chrome://global/skin/tree/twisty-clsd.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd");
} }
treechildren::-moz-tree-twisty(open) { treechildren::-moz-tree-twisty(open) {
width: 9px; /* The image's width is 9 pixels */ list-style-image: url("chrome://global/skin/tree/twisty.svg#open");
list-style-image: url("chrome://global/skin/tree/twisty-open.png");
} }
treechildren::-moz-tree-indentation { treechildren::-moz-tree-indentation {
@ -373,31 +372,30 @@ treechildren::-moz-tree-cell-text(selected, editing) {
treechildren::-moz-tree-twisty { treechildren::-moz-tree-twisty {
-moz-padding-end: 1px; -moz-padding-end: 1px;
width: 9px;
} }
treechildren::-moz-tree-twisty(hover) { treechildren::-moz-tree-twisty(hover) {
list-style-image: url("chrome://global/skin/tree/twisty-clsd-hover.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd-hover");
} }
treechildren::-moz-tree-twisty(hover, open) { treechildren::-moz-tree-twisty(hover, open) {
list-style-image: url("chrome://global/skin/tree/twisty-open-hover.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#open-hover");
} }
treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty { treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty {
list-style-image: url("chrome://global/skin/tree/twisty-clsd-rtl.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd-rtl");
} }
treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(open) { treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(open) {
list-style-image: url("chrome://global/skin/tree/twisty-open-rtl.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#open-rtl");
} }
treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover) { treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover) {
list-style-image: url("chrome://global/skin/tree/twisty-clsd-hover-rtl.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#clsd-hover-rtl");
} }
treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover, open) { treechildren:-moz-locale-dir(rtl)::-moz-tree-twisty(hover, open) {
list-style-image: url("chrome://global/skin/tree/twisty-open-hover-rtl.png"); list-style-image: url("chrome://global/skin/tree/twisty.svg#open-hover-rtl");
} }
@media (-moz-windows-default-theme) { @media (-moz-windows-default-theme) {

View File

@ -0,0 +1,39 @@
<?xml version="1.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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9" height="9">
<style>
use:not(:target) {
display: none;
}
use {
stroke: #74747b;
stroke-opacity: 0.85;
fill: none;
}
use[id^="open"] {
stroke: #636363;
stroke-opacity: 1;
}
use[id*="-hover"] {
stroke: #1cc4f7;
stroke-opacity: 1;
fill: #c0e8f9;
}
</style>
<defs>
<path id="clsd-shape" d="m 2.5,0.5 4,4 -4,4 z"/>
<path id="open-shape" d="M 7.5,3 7.5,7.5 3,7.5 3,6.5 6.5,3 Z"/>
<path id="clsd-rtl-shape" d="m 6.5,0.5 -4,4 4,4 z"/>
<path id="open-rtl-shape" d="m 1.5,3 0,4.5 4.5,0 0,-1 L 2.5,3 Z"/>
</defs>
<use id="clsd" xlink:href="#clsd-shape"/>
<use id="clsd-hover" xlink:href="#clsd-shape"/>
<use id="open" xlink:href="#open-shape"/>
<use id="open-hover" xlink:href="#open-shape"/>
<use id="clsd-rtl" xlink:href="#clsd-rtl-shape"/>
<use id="clsd-hover-rtl" xlink:href="#clsd-rtl-shape"/>
<use id="open-rtl" xlink:href="#open-rtl-shape"/>
<use id="open-hover-rtl" xlink:href="#open-rtl-shape"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,33 @@
<?xml version="1.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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9" height="9">
<style>
use:not(:target) {
display: none;
}
use {
stroke: #000000;
stroke-width: 1;
}
</style>
<defs>
<linearGradient id="linearGradient1">
<stop style="stop-color: #ffffff;" offset="0"/>
<stop style="stop-color: #e0e0e0;" offset="1"/>
</linearGradient>
<linearGradient id="linearGradient2">
<stop style="stop-color: #c9c9c9;" offset="0"/>
<stop style="stop-color: #f8f8f8;" offset="1"/>
</linearGradient>
<linearGradient id="gradient1" xlink:href="#linearGradient1" gradientUnits="userSpaceOnUse" x1="4.5" y1="2" x2="4.5" y2="7"/>
<linearGradient id="gradient2" xlink:href="#linearGradient2" gradientUnits="userSpaceOnUse" x1="4.5" y1="6" x2="4.5" y2="3"/>
<path id="clsd-shape" d="m 2,4.5 5,0 M 4.5,2 l 0,5"/>
<path id="open-shape" d="m 2,4.5 5,0"/>
</defs>
<rect style="fill: url(#gradient1); stroke: #5d5cc2; stroke-linejoin: round; stroke-opacity: 0.8" width="8" height="8" x="0.5" y="0.5"/>
<rect style="fill: url(#gradient2);" width="5" height="5" x="2" y="2"/>
<use id="clsd" xlink:href="#clsd-shape"/>
<use id="open" xlink:href="#open-shape"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

View File

@ -0,0 +1,35 @@
<?xml version="1.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/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="9" height="9">
<style>
use:not(:target) {
display: none;
}
use {
stroke: #b6b6b6;
stroke-width: 1.6;
fill: none;
}
use[id^="open"] {
stroke: #636363;
}
use[id*="-hover"] {
stroke: #4ed0f9;
}
</style>
<defs>
<path id="clsd-shape" d="m 2.5,0.5 4,4 -4,4"/>
<path id="open-shape" d="m 8.5,2.5 -4,4 -4,-4"/>
<path id="clsd-rtl-shape" d="m 6.5,0.5 -4,4 4,4"/>
</defs>
<use id="clsd" xlink:href="#clsd-shape"/>
<use id="clsd-hover" xlink:href="#clsd-shape"/>
<use id="open" xlink:href="#open-shape"/>
<use id="open-hover" xlink:href="#open-shape"/>
<use id="clsd-rtl" xlink:href="#clsd-rtl-shape"/>
<use id="clsd-hover-rtl" xlink:href="#clsd-rtl-shape"/>
<use id="open-rtl" xlink:href="#open-shape"/>
<use id="open-hover-rtl" xlink:href="#open-shape"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,45 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import sys
import re
import json
from subprocess import check_output, CalledProcessError
lintable = re.compile(r'.+\.(?:js|jsm|jsx|xml)$')
ignored = "File ignored because of your .eslintignore file. Use --no-ignore to override."
def is_lintable(filename):
return lintable.match(filename)
def display(ui, output):
results = json.loads(output)
for file in results:
path = os.path.relpath(file["filePath"])
for message in file["messages"]:
if message["message"] == ignored:
continue
ui.warn("%s:%d:%d %s\n" % (path, message["line"], message["column"], message["message"]))
def eslinthook(ui, repo, node=None, **opts):
ctx = repo[node]
if len(ctx.parents()) > 1:
return 0
deleted = repo.status(ctx.p1().node(), ctx.node()).deleted
files = [f for f in ctx.files() if f not in deleted and is_lintable(f)]
if len(files) == 0:
return
try:
output = check_output(["eslint", "--format", "json"] + files)
display(ui, output)
except CalledProcessError as ex:
display(ui, ex.output)
ui.warn("ESLint found problems in your changes, please correct them.\n")
def reposetup(ui, repo):
ui.setconfig('hooks', 'commit.eslint', eslinthook)