Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2015-12-18 15:25:47 +01:00
Родитель 7e9f2cf66c 71603d10db
Коммит ebff7b3066
60 изменённых файлов: 1381 добавлений и 984 удалений

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

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

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

@ -21,7 +21,7 @@
<!--
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="moztt" path="external/moztt" remote="b2g" revision="ac7e9ae8a24ab4a3f3da801ca53f95f39a32b89f"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -30,6 +30,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "TelemetryEnvironment",
"resource://gre/modules/TelemetryEnvironment.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryLog",
"resource://gre/modules/TelemetryLog.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryUtils",
"resource://gre/modules/TelemetryUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
"resource://services-common/utils.js");
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.
function addonInstallForURL(url, hash) {
let deferred = Promise.defer();
@ -389,7 +387,7 @@ Experiments.Experiments.prototype = {
this._shutdown = false;
configureLogging();
gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false);
gExperimentsEnabled = gPrefs.get(PREF_ENABLED, false) && TelemetryUtils.isTelemetryEnabled;
this._log.trace("enabled=" + gExperimentsEnabled + ", " + this.enabled);
gPrefs.observe(PREF_LOGGING, configureLogging);
@ -580,7 +578,7 @@ Experiments.Experiments.prototype = {
_toggleExperimentsEnabled: Task.async(function* (enabled) {
this._log.trace("_toggleExperimentsEnabled(" + enabled + ")");
let wasEnabled = gExperimentsEnabled;
gExperimentsEnabled = enabled && telemetryEnabled();
gExperimentsEnabled = enabled && TelemetryUtils.isTelemetryEnabled;
if (wasEnabled == gExperimentsEnabled) {
return;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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();
});

Просмотреть файл

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

Просмотреть файл

@ -123,7 +123,7 @@ groupbox.collapsable caption .caption-icon {
background-position: center;
-moz-margin-start: 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"] {
@ -133,7 +133,7 @@ groupbox.collapsable[closed="true"] {
}
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 {

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -7,7 +7,8 @@ var toolbox;
add_task(function*() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
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 expectedPlatform = getPlatform();
@ -15,7 +16,24 @@ add_task(function*() {
let theme = Services.prefs.getCharPref("devtools.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();
});

Просмотреть файл

@ -3,8 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
(function() {
const DEVTOOLS_SKIN_URL = "chrome://devtools/skin/";
const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-light.css";
let documentElement = document.documentElement;
let devtoolsStyleSheets = new WeakMap();
function forceStyle() {
let computedStyle = window.getComputedStyle(documentElement);
@ -19,6 +20,45 @@
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) {
if (newTheme === oldTheme) {
return;
@ -28,8 +68,8 @@
// Unload all theme stylesheets related to the old theme.
if (oldThemeDef) {
for (let url of oldThemeDef.stylesheets) {
StylesheetUtils.removeSheet(window, url, "author");
for (let sheet of devtoolsStyleSheets.get(oldThemeDef) || []) {
sheet.remove();
}
}
@ -42,8 +82,17 @@
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) {
StylesheetUtils.loadSheet(window, url, "author");
let {styleSheet,loadPromise} = appendStyleSheet(url);
devtoolsStyleSheets.get(newThemeDef).push(styleSheet);
loadEvents.push(loadPromise);
}
// Floating scroll-bars like in OSX
@ -53,21 +102,10 @@
// TODO: extensions might want to customize scrollbar styles too.
if (!hiddenDOMWindow.matchMedia("(-moz-overlay-scrollbars)").matches) {
let scrollbarsUrl = Services.io.newURI(
DEVTOOLS_SKIN_URL + "floating-scrollbars-light.css", null, null);
if (newTheme == "dark") {
StylesheetUtils.loadSheet(
window,
scrollbarsUrl,
"agent"
);
StylesheetUtils.loadSheet(window, SCROLLBARS_URL, "agent");
} else if (oldTheme == "dark") {
StylesheetUtils.removeSheet(
window,
scrollbarsUrl,
"agent"
);
StylesheetUtils.removeSheet(window, SCROLLBARS_URL, "agent");
}
forceStyle();
}
@ -92,6 +130,8 @@
// Final notification for further theme-switching related logic.
gDevTools.emit("theme-switched", window, newTheme, oldTheme);
Promise.all(loadEvents).then(notifyWindow, console.error.bind(console));
}
function handlePrefChange(event, data) {
@ -101,7 +141,6 @@
}
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://devtools/client/framework/gDevTools.jsm");
const {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {});

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -3,15 +3,15 @@
<head>
<meta charset="utf-8">
<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="../doc/docs.css">-->
<script src="chrome://devtools/content/sourceeditor/codemirror/codemirror.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/comment/comment.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.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/keymap/vim.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/keymap/emacs.js"></script>

Просмотреть файл

@ -3,15 +3,15 @@
<head>
<meta charset="utf-8">
<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="../doc/docs.css">-->
<script src="chrome://devtools/content/sourceeditor/codemirror/codemirror.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/search/searchcursor.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/dialog/dialog.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/edit/matchbrackets.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/comment/comment.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/addon/search/searchcursor.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/addon/edit/matchbrackets.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/keymap/vim.js"></script>
<script src="chrome://devtools/content/sourceeditor/codemirror/keymap/sublime.js"></script>

Просмотреть файл

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

Просмотреть файл

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

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -75,6 +75,7 @@ import org.mozilla.gecko.util.MenuUtils;
import org.mozilla.gecko.util.NativeEventListener;
import org.mozilla.gecko.util.NativeJSObject;
import org.mozilla.gecko.util.PrefUtils;
import org.mozilla.gecko.util.ScreenshotObserver;
import org.mozilla.gecko.util.StringUtils;
import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.gecko.util.UIAsyncTask;
@ -88,6 +89,7 @@ import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@ -107,6 +109,7 @@ import android.nfc.NfcEvent;
import android.os.Build;
import android.os.Bundle;
import android.os.StrictMode;
import android.provider.MediaStore;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
@ -268,6 +271,7 @@ public class BrowserApp extends GeckoApp
private boolean mHideWebContentOnAnimationEnd;
private final DynamicToolbar mDynamicToolbar = new DynamicToolbar();
private final ScreenshotObserver mScreenshotObserver = new ScreenshotObserver();
@Override
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.
IconDirectoryEntry.setMaxBPP(GeckoAppShell.getScreenDepth());
}
@ -905,6 +918,8 @@ public class BrowserApp extends GeckoApp
"Prompt:ShowTop");
processTabQueue();
mScreenshotObserver.start();
}
@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.
EventDispatcher.getInstance().registerGeckoThreadListener((GeckoEventListener) this,
"Prompt:ShowTop");
mScreenshotObserver.stop();
}
@Override

Просмотреть файл

@ -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);
}
}
}

Просмотреть файл

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

Просмотреть файл

@ -8,6 +8,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
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 URI_GENERIC_ICON_DOWNLOAD = "drawable://alert_download";
@ -94,25 +95,23 @@ HelperAppLauncherDialog.prototype = {
let mimeType = this._getMimeTypeFromLauncher(launcher);
// 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) {
if (!this._canDownload(aLauncher.source)) {
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");
this._refuseDownload(aLauncher);
return;
}
@ -123,19 +122,27 @@ HelperAppLauncherDialog.prototype = {
mimeType: aLauncher.MIMEInfo.MIMEType,
});
// Add a fake intent for save to disk at the top of the list.
apps.unshift({
name: bundle.GetStringFromName("helperapps.saveToDisk"),
packageName: "org.mozilla.gecko.Download",
iconUri: "drawable://icon",
selected: true, // Default to download for files
launch: function() {
// Reset the preferredAction here.
aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.saveToDisk;
aLauncher.saveToDisk(null, false);
return true;
}
});
if (this._shouldAddSaveToDiskIntent(aLauncher)) {
// Add a fake intent for save to disk at the top of the list.
apps.unshift({
name: bundle.GetStringFromName("helperapps.saveToDisk"),
packageName: "org.mozilla.gecko.Download",
iconUri: "drawable://icon",
selected: true, // Default to download for files
launch: function() {
// Reset the preferredAction here.
aLauncher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.saveToDisk;
aLauncher.saveToDisk(null, false);
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) {
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) {
return "browser.download.preferred." + mimetype.replace("\\", ".");
},

Просмотреть файл

@ -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.
// Force redirect to the correct place:
reject({newURL: xhr.responseURL});

Просмотреть файл

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

Просмотреть файл

@ -57,3 +57,5 @@ toolkit.jar:
* 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/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)

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 221 B

После

Ширина:  |  Высота:  |  Размер: 221 B

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 192 B

После

Ширина:  |  Высота:  |  Размер: 192 B

Просмотреть файл

@ -10,11 +10,6 @@
@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] {
animation-timing-function: cubic-bezier(.12,1.23,.48,1.09);
}
@ -59,22 +54,30 @@
}
#alertImage {
width: 64px;
width: 80px;
height: 80px;
max-width: 80px;
max-height: 80px;
object-fit: scale-down;
margin: 0 7px 7px;
}
.alertTextBox {
padding-top: 8px;
padding-inline-start: 8px;
padding-top: 4px;
/* 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,
255px, plus the width of the image, 64px. */
width: 319px;
is not provided. 349px is the text box width when a picture is present,
255px, plus the width of the image, 80px, and the margins, 7px each. */
width: 349px;
}
#alertBox[hasImage] > box > #alertTextBox {
width: 255px;
}
#alertBox:not([hasImage]) > box > #alertTextBox {
padding-inline-start: 8px;
}
#alertTextLabel {
padding-inline-end: 8px;
}
@ -82,13 +85,17 @@
.alertTitle {
-moz-box-flex: 1;
font-weight: bold;
padding: 6px 8px;
padding: 6px 8px 0;
width: 255px;
}
#alertFooter {
-moz-box-align: end;
padding-bottom: 2px;
-moz-box-align: start;
}
#alertBox:not([hasOrigin]) > box > #alertTextBox,
#alertFooter {
padding-bottom: 5px;
}
#alertSourceLabel {
@ -103,7 +110,7 @@
border-width: 0;
border-radius: 20px;
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-bottom: 0;
}

Просмотреть файл

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

До

Ширина:  |  Высота:  |  Размер: 1.6 KiB

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Просмотреть файл

@ -131,14 +131,6 @@
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-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-rtl.png (../../windows/help/Toolbar-rtl.png)

Просмотреть файл

@ -30,21 +30,23 @@
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 {
/* The close button is larger on Windows, so the
gear button is moved over to accomodate it and
keep the two buttons horizontally aligned together. */
margin-inline-end: 3px;
margin-inline-end: 5px;
}
@media (-moz-windows-default-theme) {
#alertBox[hasBodyText] > #alertTextBox,
#alertBox[hasOrigin] > #alertTitleBox {
border-bottom-color: rgba(107,107,107,.4);
}
#alertBox {
border-color: rgba(107,107,107,.4);
border-color: rgba(107,107,107,.3);
background-color: rgba(255,255,255,.9);
color: rgba(0,0,0,.9);
}

Просмотреть файл

@ -138,11 +138,11 @@ button[type="disclosure"] {
margin: 0px !important;
padding: 0px !important;
-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;
background-color: transparent;
}
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");
}

Просмотреть файл

@ -93,8 +93,9 @@ toolkit.jar:
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-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-open-XP.png (tree/twisty-open-XP.png)
skin/classic/global/tree/twisty.svg (tree/twisty.svg)
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
[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/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/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@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@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

Просмотреть файл

@ -317,12 +317,11 @@ treechildren::-moz-tree-twisty {
-moz-padding-end: 4px;
padding-top: 1px;
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) {
width: 9px; /* The image's width is 9 pixels */
list-style-image: url("chrome://global/skin/tree/twisty-open.png");
list-style-image: url("chrome://global/skin/tree/twisty.svg#open");
}
treechildren::-moz-tree-indentation {
@ -373,31 +372,30 @@ treechildren::-moz-tree-cell-text(selected, editing) {
treechildren::-moz-tree-twisty {
-moz-padding-end: 1px;
width: 9px;
}
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) {
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 {
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) {
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) {
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) {
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) {

Просмотреть файл

@ -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>

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Просмотреть файл

@ -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>

После

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 235 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 181 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 179 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 227 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 232 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 180 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 179 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 189 B

Просмотреть файл

@ -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>

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Просмотреть файл

@ -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)