Skip to content

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Apr 25, 2016
2 parents b01381b + 6011f08 commit 8a1b8bd
Show file tree
Hide file tree
Showing 413 changed files with 8,263 additions and 3,452 deletions.
3 changes: 3 additions & 0 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,9 @@ pref("layout.accessiblecaret.bar.enabled", true);
pref("layout.accessiblecaret.use_long_tap_injector", false);
#endif

// Hide carets and text selection dialog during scrolling.
pref("layout.accessiblecaret.always_show_when_scrolling", false);

// Enable sync and mozId with Firefox Accounts.
pref("services.sync.fxaccounts.enabled", true);
pref("identity.fxaccounts.enabled", true);
Expand Down
4 changes: 4 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/Sys
// See the SCOPE constants in AddonManager.jsm for values to use here.
pref("extensions.autoDisableScopes", 15);

// Add-on content security policies.
pref("extensions.webextensions.base-content-security-policy", "script-src 'self' https://* moz-extension: blob: filesystem: 'unsafe-eval' 'unsafe-inline'; object-src 'self' https://* moz-extension: blob: filesystem:;");
pref("extensions.webextensions.default-content-security-policy", "script-src 'self'; object-src 'self';");

// Require signed add-ons by default
pref("xpinstall.signatures.required", true);
pref("xpinstall.signatures.devInfoURL", "https://wiki.mozilla.org/Addons/Extension_Signing");
Expand Down
13 changes: 13 additions & 0 deletions browser/base/content/aboutNetError.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,17 @@
var event = new CustomEvent("AboutNetErrorLoad", {bubbles:true});
document.dispatchEvent(event);

if (err == "inadequateSecurityError") {
// Remove the "Try again" button for HTTP/2 inadequate security as it
// is useless.
document.getElementById("errorTryAgain").style.display = "none";

var container = document.getElementById("errorLongDesc");
for (var span of container.querySelectorAll("span.hostname")) {
span.textContent = document.location.hostname;
}
}

addDomainErrorLinks();
}

Expand Down Expand Up @@ -493,6 +504,7 @@
<h1 id="et_corruptedContentError">&corruptedContentError.title;</h1>
<h1 id="et_sslv3Used">&sslv3Used.title;</h1>
<h1 id="et_weakCryptoUsed">&weakCryptoUsed.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
Expand Down Expand Up @@ -521,6 +533,7 @@
<div id="ed_corruptedContentError">&corruptedContentError.longDesc;</div>
<div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
<div id="ed_weakCryptoUsed">&weakCryptoUsed.longDesc2;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,84 @@ XPCOMUtils.defineLazyGetter(gEMEHandler, "_brandShortName", function() {
return document.getElementById("bundle_brand").getString("brandShortName");
});

let gDecoderDoctorHandler = {
shouldShowLearnMoreButton() {
return AppConstants.platform == "win";
},

getLabelForNotificationBox(type) {
if (type == "adobe-cdm-not-found" &&
AppConstants.platform == "win") {
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
// We supply our own Learn More button so we don't need to populate the message here.
return gNavigatorBundle.getFormattedString("emeNotifications.drmContentDisabled.message", [""]);
}
return gNavigatorBundle.getString("decoder.noCodecs.message");
}
if (type == "adobe-cdm-not-activated" &&
AppConstants.platform == "win") {
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
return gNavigatorBundle.getString("decoder.noCodecsXP.message");
}
return gNavigatorBundle.getString("decoder.noCodecs.message");
}
if (type == "platform-decoder-not-found") {
if (AppConstants.isPlatformAndVersionAtLeast("win", "6")) {
return gNavigatorBundle.getString("decoder.noHWAcceleration.message");
}
if (AppConstants.platform == "linux") {
return gNavigatorBundle.getString("decoder.noCodecsLinux.message");
}
}
return "";
},

receiveMessage({target: browser, data: data}) {
let box = gBrowser.getNotificationBox(browser);
let notificationId = "decoder-doctor-notification";
if (box.getNotificationWithValue(notificationId)) {
return;
}

let parsedData;
try {
parsedData = JSON.parse(data);
} catch (ex) {
Cu.reportError("Malformed Decoder Doctor message with data: " + data);
return;
}
let {type} = parsedData;
type = type.toLowerCase();
let title = gDecoderDoctorHandler.getLabelForNotificationBox(type);
if (!title) {
return;
}

let buttons = [];
if (gDecoderDoctorHandler.shouldShowLearnMoreButton()) {
buttons.push({
label: gNavigatorBundle.getString("decoder.noCodecs.button"),
accessKey: gNavigatorBundle.getString("decoder.noCodecs.accesskey"),
callback() {
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
openUILinkIn(baseURL + "fix-video-audio-problems-firefox-windows", "tab");
}
});
}

box.appendNotification(
title,
notificationId,
"", // This uses the info icon as specified below.
box.PRIORITY_INFO_LOW,
buttons
);
},
}

window.messageManager.addMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler);
window.messageManager.addMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler);
window.addEventListener("unload", function() {
window.messageManager.removeMessageListener("EMEVideo:ContentMediaKeysRequest", gEMEHandler);
window.messageManager.removeMessageListener("DecoderDoctor:Notification", gDecoderDoctorHandler);
}, false);
2 changes: 1 addition & 1 deletion browser/base/content/global-scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<script type="application/javascript" src="chrome://browser/content/browser-ctrlTab.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-customization.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-devedition.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-eme.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-feeds.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-fullScreen.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-fullZoom.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-gestureSupport.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-media.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-places.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-plugins.js"/>
<script type="application/javascript" src="chrome://browser/content/browser-refreshblocker.js"/>
Expand Down
17 changes: 12 additions & 5 deletions browser/base/content/tab-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,11 @@ var DOMFullscreenHandler = {
},

receiveMessage: function(aMessage) {
let windowUtils = this._windowUtils;
switch(aMessage.name) {
case "DOMFullscreen:Entered": {
if (!this._windowUtils.handleFullscreenRequests() &&
this._lastTransactionId = windowUtils.lastTransactionId;
if (!windowUtils.handleFullscreenRequests() &&
!content.document.fullscreenElement) {
// If we don't actually have any pending fullscreen request
// to handle, neither we have been in fullscreen, tell the
Expand All @@ -644,8 +646,9 @@ var DOMFullscreenHandler = {
break;
}
case "DOMFullscreen:CleanUp": {
if (this._windowUtils) {
this._windowUtils.exitFullscreen();
if (windowUtils) {
this._lastTransactionId = windowUtils.lastTransactionId;
windowUtils.exitFullscreen();
}
this._fullscreenDoc = null;
break;
Expand Down Expand Up @@ -682,8 +685,12 @@ var DOMFullscreenHandler = {
break;
}
case "MozAfterPaint": {
removeEventListener("MozAfterPaint", this);
sendAsyncMessage("DOMFullscreen:Painted");
// Only send Painted signal after we actually finish painting
// the transition for the fullscreen change.
if (aEvent.transactionId > this._lastTransactionId) {
removeEventListener("MozAfterPaint", this);
sendAsyncMessage("DOMFullscreen:Painted");
}
break;
}
}
Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ skip-if = toolkit == "gtk2" || toolkit == "gtk3" # disabled on Linux due to bug
[browser_ctrlTab.js]
[browser_datachoices_notification.js]
skip-if = !datareporting
[browser_decoderDoctor.js]
skip-if = os == "mac" # decoder doctor isn't implemented on osx
[browser_devedition.js]
[browser_devices_get_user_media.js]
skip-if = buildapp == 'mulet' || (os == "linux" && debug) # linux: bug 976544
Expand Down
94 changes: 94 additions & 0 deletions browser/base/content/test/general/browser_decoderDoctor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"use strict";

function* test_decoder_doctor_notification(type, notificationMessage, options) {
yield BrowserTestUtils.withNewTab({ gBrowser }, function*(browser) {
let awaitNotificationBar =
BrowserTestUtils.waitForNotificationBar(gBrowser, browser, "decoder-doctor-notification");

yield ContentTask.spawn(browser, type, function*(type) {
Services.obs.notifyObservers(content.window,
"decoder-doctor-notification",
JSON.stringify({type: type}));
});

let notification;
try {
notification = yield awaitNotificationBar;
} catch (ex) {
ok(false, ex);
return;
}
ok(notification, "Got decoder-doctor-notification notification");

is(notification.getAttribute("label"), notificationMessage,
"notification message should match expectation");
let button = notification.childNodes[0];
if (options && options.noLearnMoreButton) {
ok(!button, "There should not be a Learn More button");
return;
}

is(button.getAttribute("label"), gNavigatorBundle.getString("decoder.noCodecs.button"),
"notification button should be 'Learn more'");
is(button.getAttribute("accesskey"), gNavigatorBundle.getString("decoder.noCodecs.accesskey"),
"notification button should have accesskey");

let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
let url = baseURL + "fix-video-audio-problems-firefox-windows";
let awaitNewTab = BrowserTestUtils.waitForNewTab(gBrowser, url);
button.click();
let sumoTab = yield awaitNewTab;
yield BrowserTestUtils.removeTab(sumoTab);
});
}

add_task(function* test_adobe_cdm_not_found() {
// This is only sent on Windows.
if (AppConstants.platform != "win") {
return;
}

let message;
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
message = gNavigatorBundle.getFormattedString("emeNotifications.drmContentDisabled.message", [""]);
} else {
message = gNavigatorBundle.getString("decoder.noCodecs.message");
}

yield test_decoder_doctor_notification("adobe-cdm-not-found", message);
});

add_task(function* test_adobe_cdm_not_activated() {
// This is only sent on Windows.
if (AppConstants.platform != "win") {
return;
}

let message;
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
message = gNavigatorBundle.getString("decoder.noCodecsXP.message");
} else {
message = gNavigatorBundle.getString("decoder.noCodecs.message");
}

yield test_decoder_doctor_notification("adobe-cdm-not-activated", message);
});

add_task(function* test_platform_decoder_not_found() {
// Not sent on Windows XP.
if (AppConstants.isPlatformAndVersionAtMost("win", "5.9")) {
return;
}

let message;
let isLinux = AppConstants.platform == "linux";
if (isLinux) {
message = gNavigatorBundle.getString("decoder.noCodecsLinux.message");
} else {
message = gNavigatorBundle.getString("decoder.noHWAcceleration.message");
}

yield test_decoder_doctor_notification("platform-decoder-not-found",
message,
{noLearnMoreButton: isLinux});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ let gWhitelist = [{
file: "netError.dtd",
key: "weakCryptoAdvanced.override",
type: "single-quote"
}, {
file: "netError.dtd",
key: "inadequateSecurityError.longDesc",
type: "single-quote"
}, {
file: "phishing-afterload-warning-message.dtd",
key: "safeb.blocked.malwarePage.shortDesc",
Expand Down
2 changes: 1 addition & 1 deletion browser/base/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ browser.jar:
content/browser/browser-customization.js (content/browser-customization.js)
content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js)
content/browser/browser-devedition.js (content/browser-devedition.js)
content/browser/browser-eme.js (content/browser-eme.js)
content/browser/browser-feeds.js (content/browser-feeds.js)
content/browser/browser-fullScreen.js (content/browser-fullScreen.js)
content/browser/browser-fullZoom.js (content/browser-fullZoom.js)
content/browser/browser-fxaccounts.js (content/browser-fxaccounts.js)
content/browser/browser-gestureSupport.js (content/browser-gestureSupport.js)
content/browser/browser-media.js (content/browser-media.js)
content/browser/browser-places.js (content/browser-places.js)
content/browser/browser-plugins.js (content/browser-plugins.js)
content/browser/browser-refreshblocker.js (content/browser-refreshblocker.js)
Expand Down
6 changes: 3 additions & 3 deletions browser/components/extensions/ext-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ function getSender(context, target, sender) {

sender.tab = TabManager.convert(context.extension, tab);
} else if ("tabId" in sender) {
// The message came from an ExtensionPage. In that case, it should
// The message came from an ExtensionContext. In that case, it should
// include a tabId property (which is filled in by the page-open
// listener below).
sender.tab = TabManager.convert(context.extension, TabManager.getTab(sender.tabId));
delete sender.tabId;
}
}

// WeakMap[ExtensionPage -> {tab, parentWindow}]
// WeakMap[ExtensionContext -> {tab, parentWindow}]
var pageDataMap = new WeakMap();

/* eslint-disable mozilla/balanced-listeners */
// This listener fires whenever an extension page opens in a tab
// (either initiated by the extension or the user). Its job is to fill
// in some tab-specific details and keep data around about the
// ExtensionPage.
// ExtensionContext.
extensions.on("page-load", (type, page, params, sender, delegate) => {
if (params.type == "tab" || params.type == "popup") {
let browser = params.docShell.chromeEventHandler;
Expand Down
2 changes: 1 addition & 1 deletion browser/components/extensions/ext-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class BasePopup {
.getInterface(Ci.nsIDOMWindowUtils)
.allowScriptsToClose();

this.context = new ExtensionPage(this.extension, {
this.context = new ExtensionContext(this.extension, {
type: "popup",
contentWindow,
uri: popupURI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ add_task(function* testPageActionPopup() {
},

files: {
"popup-a.html": String.raw`<html><head><meta charset="utf-8"><script type="application/javascript">
browser.test.sendMessage("from-popup-a");
</script></head></html>`,
"popup-a.html": `<html><head><meta charset="utf-8">
<script type="application/javascript" src="popup-a.js"></script></head></html>`,
"popup-a.js": 'browser.test.sendMessage("from-popup-a");',

"popup-b.html": String.raw`<html><head><meta charset="utf-8"><script type="application/javascript">
browser.test.sendMessage("from-popup-b");
</script></head></html>`,
"popup-b.html": `<html><head><meta charset="utf-8">
<script type="application/javascript" src="popup-b.js"></script></head></html>`,
"popup-b.js": 'browser.test.sendMessage("from-popup-b");',
},

background: function() {
Expand Down
Loading

0 comments on commit 8a1b8bd

Please sign in to comment.