merge fx-team to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2015-02-23 13:19:15 +01:00
Родитель 3fa6b195b9 93f29e742c
Коммит 5d8221ec4c
21 изменённых файлов: 358 добавлений и 109 удалений

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

@ -1513,6 +1513,9 @@ pref("devtools.canvasdebugger.enabled", false);
// Enable the Web Audio Editor
pref("devtools.webaudioeditor.enabled", false);
// Web Audio Editor Inspector Width should be a preference
pref("devtools.webaudioeditor.inspectorWidth", 300);
// Default theme ("dark" or "light")
#ifdef MOZ_DEV_EDITION
pref("devtools.theme", "dark");
@ -1870,8 +1873,10 @@ pref("dom.ipc.reportProcessHangs", false);
pref("dom.ipc.reportProcessHangs", true);
#endif
#ifndef NIGHTLY_BUILD
// Disable reader mode by default.
pref("reader.parse-on-load.enabled", false);
#endif
// Disable ReadingList by default.
pref("browser.readinglist.enabled", false);

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

@ -1,6 +1,7 @@
[DEFAULT]
subsuite = devtools
support-files =
doc_raf-begin.html
doc_simple-canvas.html
doc_simple-canvas-bitmasks.html
doc_simple-canvas-deep-stack.html
@ -34,6 +35,7 @@ skip-if = e10s # bug 1102301 - leaks while running as a standalone directory in
[browser_canvas-frontend-record-01.js]
[browser_canvas-frontend-record-02.js]
[browser_canvas-frontend-record-03.js]
[browser_canvas-frontend-record-04.js]
[browser_canvas-frontend-reload-01.js]
[browser_canvas-frontend-reload-02.js]
[browser_canvas-frontend-slider-01.js]

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

@ -22,7 +22,7 @@ function ifTestingSupported() {
"A snapshot actor was sent after recording.");
let animationOverview = yield snapshotActor.getOverview();
ok(snapshotActor,
ok(animationOverview,
"An animation overview could be retrieved after recording.");
let thumbnails = animationOverview.thumbnails;

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

@ -0,0 +1,34 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Bug 1122766
* Tests that the canvas actor correctly returns from recordAnimationFrame
* in the scenario where a loop starts with rAF and has rAF in the beginning
* of its loop, when the recording starts before the rAFs start.
*/
function ifTestingSupported() {
let { target, panel } = yield initCanvasDebuggerFrontend(RAF_BEGIN_URL);
let { window, EVENTS, gFront, SnapshotsListView } = panel.panelWin;
loadFrameScripts();
yield reload(target);
let recordingFinished = once(window, EVENTS.SNAPSHOT_RECORDING_FINISHED);
SnapshotsListView._onRecordButtonClick();
// Wait until after the recording started to trigger the content.
// Use the gFront method rather than the SNAPSHOT_RECORDING_STARTED event
// which triggers before the underlying actor call
yield waitUntil(function*() { return !(yield gFront.isRecording()); });
// Start animation in content
evalInDebuggee("start();");
yield recordingFinished;
ok(true, "Finished recording a snapshot of the animation loop.");
yield removeTab(target.tab);
finish();
}

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

@ -0,0 +1,36 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Canvas inspector test page</title>
</head>
<body>
<canvas width="128" height="128"></canvas>
<script type="text/javascript;version=1.8">
"use strict";
var ctx = document.querySelector("canvas").getContext("2d");
function drawRect(fill, size) {
ctx.fillStyle = fill;
ctx.fillRect(size[0], size[1], size[2], size[3]);
}
function drawScene() {
window.requestAnimationFrame(drawScene);
ctx.clearRect(0, 0, 128, 128);
drawRect("rgb(192, 192, 192)", [0, 0, 128, 128]);
drawRect("rgba(0, 0, 192, 0.5)", [30, 30, 55, 50]);
drawRect("rgba(192, 0, 0, 0.5)", [10, 10, 55, 50]);
}
function start () { window.requestAnimationFrame(drawScene); }
</script>
</body>
</html>

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

@ -20,6 +20,7 @@ let { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.j
let { DebuggerClient } = Cu.import("resource://gre/modules/devtools/dbg-client.jsm", {});
let { CallWatcherFront } = devtools.require("devtools/server/actors/call-watcher");
let { CanvasFront } = devtools.require("devtools/server/actors/canvas");
let { setTimeout } = devtools.require("sdk/timers");
let TiltGL = devtools.require("devtools/tilt/tilt-gl");
let TargetFactory = devtools.TargetFactory;
let Toolbox = devtools.Toolbox;
@ -33,6 +34,7 @@ const SIMPLE_CANVAS_TRANSPARENT_URL = EXAMPLE_URL + "doc_simple-canvas-transpare
const SIMPLE_CANVAS_DEEP_STACK_URL = EXAMPLE_URL + "doc_simple-canvas-deep-stack.html";
const WEBGL_ENUM_URL = EXAMPLE_URL + "doc_webgl-enum.html";
const WEBGL_BINDINGS_URL = EXAMPLE_URL + "doc_webgl-bindings.html";
const RAF_BEGIN_URL = EXAMPLE_URL + "doc_raf-begin.html";
// All tests are asynchronous.
waitForExplicitFinish();
@ -275,3 +277,22 @@ function getSourceActor(aSources, aURL) {
let item = aSources.getItemForAttachment(a => a.source.url === aURL);
return item ? item.value : null;
}
/**
* Waits until a predicate returns true.
*
* @param function predicate
* Invoked once in a while until it returns true.
* @param number interval [optional]
* How often the predicate is invoked, in milliseconds.
*/
function *waitUntil (predicate, interval = 10) {
if (yield predicate()) {
return Promise.resolve(true);
}
let deferred = Promise.defer();
setTimeout(function() {
waitUntil(predicate).then(() => deferred.resolve(true));
}, interval);
return deferred.promise;
}

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

@ -2743,21 +2743,22 @@ NetworkDetailsView.prototype = {
}
/**
* A helper that sets label text to specified value.
* A helper that sets value and tooltiptext attributes of an element to
* specified value.
*
* @param string selector
* A selector for the label.
* A selector for the element.
* @param string value
* The value label should have. If this evaluates to false a
* placeholder string <Not Available> is used instead.
* The value to set. If this evaluates to false a placeholder string
* <Not Available> is used instead.
*/
function setLabel(selector, value) {
function setValue(selector, value) {
let label = $(selector);
if (!value) {
label.value = L10N.getStr("netmonitor.security.notAvailable");
label.setAttribute("tooltiptext", label.value);
label.setAttribute("value", L10N.getStr("netmonitor.security.notAvailable"));
label.setAttribute("tooltiptext", label.getAttribute("value"));
} else {
label.value = value;
label.setAttribute("value", value);
label.setAttribute("tooltiptext", value);
}
}
@ -2785,43 +2786,43 @@ NetworkDetailsView.prototype = {
let disabledLabel = L10N.getStr("netmonitor.security.disabled");
// Connection parameters
setLabel("#security-protocol-version-value", securityInfo.protocolVersion);
setLabel("#security-ciphersuite-value", securityInfo.cipherSuite);
setValue("#security-protocol-version-value", securityInfo.protocolVersion);
setValue("#security-ciphersuite-value", securityInfo.cipherSuite);
// Host header
let domain = NetMonitorView.RequestsMenu._getUriHostPort(url);
let hostHeader = L10N.getFormatStr("netmonitor.security.hostHeader", domain);
setLabel("#security-info-host-header", hostHeader);
setValue("#security-info-host-header", hostHeader);
// Parameters related to the domain
setLabel("#security-http-strict-transport-security-value",
setValue("#security-http-strict-transport-security-value",
securityInfo.hsts ? enabledLabel : disabledLabel);
setLabel("#security-public-key-pinning-value",
setValue("#security-public-key-pinning-value",
securityInfo.hpkp ? enabledLabel : disabledLabel);
// Certificate parameters
let cert = securityInfo.cert;
setLabel("#security-cert-subject-cn", cert.subject.commonName);
setLabel("#security-cert-subject-o", cert.subject.organization);
setLabel("#security-cert-subject-ou", cert.subject.organizationalUnit);
setValue("#security-cert-subject-cn", cert.subject.commonName);
setValue("#security-cert-subject-o", cert.subject.organization);
setValue("#security-cert-subject-ou", cert.subject.organizationalUnit);
setLabel("#security-cert-issuer-cn", cert.issuer.commonName);
setLabel("#security-cert-issuer-o", cert.issuer.organization);
setLabel("#security-cert-issuer-ou", cert.issuer.organizationalUnit);
setValue("#security-cert-issuer-cn", cert.issuer.commonName);
setValue("#security-cert-issuer-o", cert.issuer.organization);
setValue("#security-cert-issuer-ou", cert.issuer.organizationalUnit);
setLabel("#security-cert-validity-begins", cert.validity.start);
setLabel("#security-cert-validity-expires", cert.validity.end);
setValue("#security-cert-validity-begins", cert.validity.start);
setValue("#security-cert-validity-expires", cert.validity.end);
setLabel("#security-cert-sha1-fingerprint", cert.fingerprint.sha1);
setLabel("#security-cert-sha256-fingerprint", cert.fingerprint.sha256);
setValue("#security-cert-sha1-fingerprint", cert.fingerprint.sha1);
setValue("#security-cert-sha256-fingerprint", cert.fingerprint.sha256);
} else {
infobox.hidden = true;
errorbox.hidden = false;
// Strip any HTML from the message.
let plain = DOMParser.parseFromString(securityInfo.errorMessage, "text/html");
$("#security-error-message").textContent = plain.body.textContent;
setValue("#security-error-message", plain.body.textContent);
}
}),

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

@ -28,7 +28,7 @@
overflow: auto;
}
#headers-summary-url-value .textbox-input {
.cropped-textbox .textbox-input {
/* workaround for textbox not supporting the @crop attribute */
text-overflow: ellipsis;
}

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

@ -300,7 +300,7 @@
<label class="plain tabpanel-summary-label"
value="&netmonitorUI.summary.url;"/>
<textbox id="headers-summary-url-value"
class="plain tabpanel-summary-value devtools-monospace"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
@ -488,7 +488,14 @@
flex="1">
<label class="plain tabpanel-summary-label"
value="&netmonitorUI.security.error;"/>
<description id="security-error-message" flex="1"/>
<hbox class="security-info-section"
flex="1">
<textbox id="security-error-message"
class="plain"
flex="1"
multiline="true"
readonly="true"/>
</hbox>
</vbox>
<vbox id="security-information"
flex="1">
@ -502,10 +509,10 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&netmonitorUI.security.protocolVersion;"/>
<label id="security-protocol-version-value"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-protocol-version-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
<image class="security-warning-icon"
id="security-warning-sslv3"
tooltiptext="&netmonitorUI.security.warning.sslv3;" />
@ -515,10 +522,10 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&netmonitorUI.security.cipherSuite;"/>
<label id="security-ciphersuite-value"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-ciphersuite-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
<image class="security-warning-icon"
id="security-warning-cipher"
tooltiptext="&netmonitorUI.security.warning.cipher;" />
@ -535,20 +542,20 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&netmonitorUI.security.hsts;"/>
<label id="security-http-strict-transport-security-value"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-http-strict-transport-security-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox id="security-public-key-pinning"
class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&netmonitorUI.security.hpkp;"/>
<label id="security-public-key-pinning-value"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-public-key-pinning-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
</vbox>
@ -566,28 +573,28 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.cn;:"/>
<label id="security-cert-subject-cn"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-subject-cn"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.o;:"/>
<label id="security-cert-subject-o"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-subject-o"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.ou;:"/>
<label id="security-cert-subject-ou"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-subject-ou"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
<vbox class="tabpanel-summary-container">
@ -599,28 +606,28 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.cn;:"/>
<label id="security-cert-issuer-cn"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-issuer-cn"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.o;:"/>
<label id="security-cert-issuer-o"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-issuer-o"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.ou;:"/>
<label id="security-cert-issuer-ou"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-issuer-ou"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
<vbox class="tabpanel-summary-container">
@ -632,19 +639,19 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.begins;:"/>
<label id="security-cert-validity-begins"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-validity-begins"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.expires;:"/>
<label id="security-cert-validity-expires"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-validity-expires"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
<vbox class="tabpanel-summary-container">
@ -656,19 +663,19 @@
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.sha256fingerprint;:"/>
<label id="security-cert-sha256-fingerprint"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-sha256-fingerprint"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
value="&certmgr.certdetail.sha1fingerprint;:"/>
<label id="security-cert-sha1-fingerprint"
class="plain tabpanel-summary-value devtools-monospace"
crop="end"
flex="1"/>
<textbox id="security-cert-sha1-fingerprint"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
</vbox>

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

@ -37,7 +37,7 @@ add_task(function* () {
is(errorbox.hidden, false, "Error box is visble.");
is(infobox.hidden, true, "Information box is hidden.");
isnot(errormsg.textContent, "", "Error message is not empty.");
isnot(errormsg.value, "", "Error message is not empty.");
yield teardown(monitor);

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

@ -55,6 +55,7 @@ skip-if = true # bug 1092571
[browser_wa_graph-zoom.js]
[browser_wa_inspector.js]
[browser_wa_inspector-toggle.js]
[browser_wa_inspector-width.js]
[browser_wa_inspector-bypass-01.js]
[browser_wa_navigate.js]
[browser_wa_properties-view.js]

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

@ -0,0 +1,63 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that the WebAudioInspector's Width is saved as
* a preference
*/
add_task(function*() {
let { target, panel } = yield initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, InspectorView } = panelWin;
let gVars = InspectorView._propsView;
let started = once(gFront, "start-context");
reload(target);
let [actors] = yield Promise.all([
get3(gFront, "create-node"),
waitForGraphRendered(panelWin, 3, 2)
]);
let nodeIds = actors.map(actor => actor.actorID);
ok(!InspectorView.isVisible(), "InspectorView hidden on start.");
// Open inspector pane
$("#inspector-pane-toggle").click();
yield once(panelWin, EVENTS.UI_INSPECTOR_TOGGLED);
let newInspectorWidth = 500;
// Setting width to new_inspector_width
$("#web-audio-inspector").setAttribute("width", newInspectorWidth);
reload(target);
//Width should be 500 after reloading
[actors] = yield Promise.all([
get3(gFront, "create-node"),
waitForGraphRendered(panelWin, 3, 2)
]);
nodeIds = actors.map(actor => actor.actorID);
// Open inspector pane
$("#inspector-pane-toggle").click();
yield once(panelWin, EVENTS.UI_INSPECTOR_TOGGLED);
let nodeSet = Promise.all([
once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET),
once(panelWin, EVENTS.UI_PROPERTIES_TAB_RENDERED),
once(panelWin, EVENTS.UI_AUTOMATION_TAB_RENDERED)
]);
click(panelWin, findGraphNode(panelWin, nodeIds[1]));
yield nodeSet;
// Getting the width of the audio inspector
let width = $("#web-audio-inspector").getAttribute("width");
is(width, newInspectorWidth, "WebAudioEditor's Inspector width should be saved as a preference");
yield teardown(target);
});

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

@ -3,9 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// Store width as a preference rather than hardcode
// TODO bug 1009056
const INSPECTOR_WIDTH = 300;
const MIN_INSPECTOR_WIDTH = 300;
// Strings for rendering
const EXPAND_INSPECTOR_STRING = L10N.getStr("expandInspector");
@ -32,7 +30,7 @@ let InspectorView = {
// Set up view controller
this.el = $("#web-audio-inspector");
this.splitter = $("#inspector-splitter");
this.el.setAttribute("width", INSPECTOR_WIDTH);
this.el.setAttribute("width", Services.prefs.getIntPref("devtools.webaudioeditor.inspectorWidth"));
this.button = $("#inspector-pane-toggle");
mixin(this, ToggleMixin);
this.bindToggle();
@ -149,6 +147,10 @@ let InspectorView = {
},
_onResize: function () {
if (this.el.getAttribute("width") < MIN_INSPECTOR_WIDTH) {
this.el.setAttribute("width", MIN_INSPECTOR_WIDTH);
}
Services.prefs.setIntPref("devtools.webaudioeditor.inspectorWidth", this.el.getAttribute("width"));
window.emit(EVENTS.UI_INSPECTOR_RESIZE);
},

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

@ -579,10 +579,6 @@ label.requests-menu-status-code {
overflow: auto;
}
#security-error-message {
white-space: pre-wrap;
}
.security-warning-icon {
background-image: url(alerticon-warning.png);
background-size: 13px 12px;

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

@ -490,7 +490,7 @@ browser.jar:
* skin/classic/aero/browser/devedition.css (devedition-aero.css)
* skin/classic/aero/browser/browser-lightweightTheme.css
skin/classic/aero/browser/click-to-play-warning-stripes.png
* skin/classic/aero/browser/content-contextmenu.svg
skin/classic/aero/browser/content-contextmenu.svg
skin/classic/aero/browser/drm-icon.svg (../shared/drm-icon.svg)
* skin/classic/aero/browser/engineManager.css
skin/classic/aero/browser/fullscreen-darknoise.png

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

@ -298,11 +298,6 @@ pref("chrome.override_package.passwordmgr", "browser");
// enable xul error pages
pref("browser.xul.error_pages.enabled", true);
pref("browser.history.grouping", "day");
pref("browser.history.showSessions", false);
pref("browser.sessionhistory.max_entries", 50);
pref("browser.history_expire_sites", 40000);
// disable color management
pref("gfx.color_management.mode", 0);
@ -863,3 +858,6 @@ pref("reader.color_scheme.values", "[\"light\",\"dark\",\"auto\"]");
// Whether to use a vertical or horizontal toolbar.
pref("reader.toolbar.vertical", false);
// Whether or not to display buttons related to reading list in reader view.
pref("browser.readinglist.enabled", true);

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

@ -34,6 +34,8 @@ import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Locale;
public class SearchEngineManager implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -42,6 +44,9 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
// Gecko pref that defines the name of the default search engine.
private static final String PREF_GECKO_DEFAULT_ENGINE = "browser.search.defaultenginename";
// Gecko pref that defines the name of the default searchplugin locale.
private static final String PREF_GECKO_DEFAULT_LOCALE = "distribution.searchplugins.defaultLocale";
// Key for shared preference that stores default engine name.
private static final String PREF_DEFAULT_ENGINE_KEY = "search.engines.defaultname";
@ -65,6 +70,10 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
// This should only be accessed from the background thread.
private String fallbackLocale;
// Cached version of default locale included in Distribution preferences.
// This should only be accessed from the background thread.
private String distributionLocale;
public static interface SearchEngineCallback {
public void execute(SearchEngine engine);
}
@ -239,7 +248,16 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
try {
final JSONObject all = new JSONObject(FileUtils.getFileContents(prefFile));
// First, check to see if there's a locale-specific override.
// First, look for a default locale specified by the distribution.
if (all.has("Preferences")) {
final JSONObject prefs = all.getJSONObject("Preferences");
if (prefs.has(PREF_GECKO_DEFAULT_LOCALE)) {
Log.d(LOG_TAG, "Found default searchplugin locale in distribution Preferences.");
distributionLocale = prefs.getString(PREF_GECKO_DEFAULT_LOCALE);
}
}
// Then, check to see if there's a locale-specific default engine override.
final String languageTag = Locales.getLanguageTag(Locale.getDefault());
final String overridesKey = "LocalizablePreferences." + languageTag;
if (all.has(overridesKey)) {
@ -250,7 +268,7 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
}
}
// Next, check to see if there's a non-override default pref.
// Next, check to see if there's a non-override default engine pref.
if (all.has("LocalizablePreferences")) {
final JSONObject localizablePrefs = all.getJSONObject("LocalizablePreferences");
if (localizablePrefs.has(PREF_GECKO_DEFAULT_ENGINE)) {
@ -443,12 +461,43 @@ public class SearchEngineManager implements SharedPreferences.OnSharedPreference
return null;
}
final File[] files = (new File(pluginsDir, "common")).listFiles();
if (files == null) {
// Collect an array of files to scan using the same approach as
// DirectoryService._appendDistroSearchDirs which states:
// Common engines are loaded for all locales. If there is no locale directory for
// the current locale, there is a pref: "distribution.searchplugins.defaultLocale",
// which specifies a default locale to use.
ArrayList<File> files = new ArrayList<>();
// Load files from the common folder first
final File[] commonFiles = (new File(pluginsDir, "common")).listFiles();
if (commonFiles != null) {
Collections.addAll(files, commonFiles);
}
// Next, check to see if there's a locale-specific override.
final File localeDir = new File(pluginsDir, "locale");
if (localeDir != null) {
final String languageTag = Locales.getLanguageTag(Locale.getDefault());
final File[] localeFiles = (new File(localeDir, languageTag)).listFiles();
if (localeFiles != null) {
Collections.addAll(files, localeFiles);
} else {
// We didn't append the locale dir - try the default one.
if (distributionLocale != null) {
final File[] defaultLocaleFiles = (new File(localeDir, distributionLocale)).listFiles();
if (defaultLocaleFiles != null) {
Collections.addAll(files, defaultLocaleFiles);
}
}
}
}
if (files.isEmpty()) {
Log.e(LOG_TAG, "Could not find search plugin files in distribution directory");
return null;
}
return createEngineFromFileList(files, name);
return createEngineFromFileList(files.toArray(new File[files.size()]), name);
}
/**

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

@ -57,9 +57,16 @@ let AboutReader = function(mm, win) {
this._setupStyleDropdown();
this._setupButton("close-button", this._onReaderClose.bind(this), "aboutReader.toolbar.close");
this._setupButton("toggle-button", this._onReaderToggle.bind(this), "aboutReader.toolbar.addToReadingList");
this._setupButton("share-button", this._onShare.bind(this), "aboutReader.toolbar.share");
this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
try {
if (Services.prefs.getBoolPref("browser.readinglist.enabled")) {
this._setupButton("toggle-button", this._onReaderToggle.bind(this), "aboutReader.toolbar.addToReadingList");
this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
}
} catch (e) {
// Pref doesn't exist.
}
let colorSchemeValues = JSON.parse(Services.prefs.getCharPref("reader.color_scheme.values"));
let colorSchemeOptions = colorSchemeValues.map((value) => {
@ -699,6 +706,7 @@ AboutReader.prototype = {
_setupButton: function Reader_setupButton(id, callback, titleEntity) {
let button = this._doc.getElementById(id);
button.removeAttribute("hidden");
button.setAttribute("title", gStrings.GetStringFromName(titleEntity));
button.addEventListener("click", function(aEvent) {

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

@ -38,8 +38,8 @@
<div class="dropdown-arrow"/>
</li>
</ul>
<li><button id="toggle-button" class="button toggle-button"/></li>
<li><button id="list-button" class="button list-button"/></li>
<li><button id="toggle-button" class="button toggle-button" hidden="true"/></li>
<li><button id="list-button" class="button list-button" hidden="true"/></li>
</ul>
</body>

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

@ -229,6 +229,10 @@ let FrameSnapshotFront = protocol.FrontClass(FrameSnapshotActor, {
* made when drawing frame inside an animation loop.
*/
let CanvasActor = exports.CanvasActor = protocol.ActorClass({
// Reset for each recording, boolean indicating whether or not
// any draw calls were called for a recording.
_animationContainsDrawCall: false,
typeName: "canvas",
initialize: function(conn, tabActor) {
protocol.Actor.prototype.initialize.call(this, conn);
@ -286,6 +290,16 @@ let CanvasActor = exports.CanvasActor = protocol.ActorClass({
response: { initialized: RetVal("boolean") }
}),
/**
* Returns whether or not the CanvasActor is recording an animation.
* Used in tests.
*/
isRecording: method(function() {
return !!this._callWatcher.isRecording();
}, {
response: { recording: RetVal("boolean") }
}),
/**
* Records a snapshot of all the calls made during the next animation frame.
* The animation should be implemented via the de-facto requestAnimationFrame
@ -300,6 +314,7 @@ let CanvasActor = exports.CanvasActor = protocol.ActorClass({
return this._currentAnimationFrameSnapshot.promise;
}
this._recordingContainsDrawCall = false;
this._callWatcher.eraseRecording();
this._callWatcher.resumeRecording();
@ -340,7 +355,11 @@ let CanvasActor = exports.CanvasActor = protocol.ActorClass({
_handleAnimationFrame: function(functionCall) {
if (!this._animationStarted) {
this._handleAnimationFrameBegin();
} else {
}
// Check to see if draw calls occurred yet, as it could be future frames,
// like in the scenario where requestAnimationFrame is called to trigger an animation,
// and rAF is at the beginning of the animate loop.
else if (this._animationContainsDrawCall) {
this._handleAnimationFrameEnd(functionCall);
}
},
@ -362,6 +381,7 @@ let CanvasActor = exports.CanvasActor = protocol.ActorClass({
// previously recorded calls.
let functionCalls = this._callWatcher.pauseRecording();
this._callWatcher.eraseRecording();
this._animationContainsDrawCall = false;
// Since the animation frame finished, get a hold of the (already retrieved)
// canvas pixels to conveniently create a screenshot of the final rendering.
@ -410,6 +430,8 @@ let CanvasActor = exports.CanvasActor = protocol.ActorClass({
let dimensions = CanvasFront.THUMBNAIL_SIZE;
let thumbnail;
this._animationContainsDrawCall = true;
// Create a thumbnail on every draw call on the canvas context, to augment
// the respective function call actor with this additional data.
if (global == CallWatcherFront.CANVAS_WEBGL_CONTEXT) {

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

@ -248,6 +248,10 @@ body {
border-bottom: 1px solid #c1c1c1;
}
.button[hidden] {
display: none;
}
.dropdown {
text-align: center;
list-style: none;