Skip to content

Commit

Permalink
merge mozilla-inboudn to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Aug 5, 2016
2 parents 99002c6 + 2b78b14 commit cf611be
Show file tree
Hide file tree
Showing 624 changed files with 14,304 additions and 6,403 deletions.
5 changes: 5 additions & 0 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,11 @@ DocAccessible::AttributeChanged(nsIDocument* aDocument,
accessible = this;
}

if (!accessible->IsBoundToParent()) {
MOZ_ASSERT_UNREACHABLE("DOM attribute change on accessible detached from tree");
return;
}

// Fire accessible events iff there's an accessible, otherwise we consider
// the accessible state wasn't changed, i.e. its state is initial state.
AttributeChangedImpl(accessible, aNameSpaceID, aAttribute);
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/browser-social.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ SocialUI = {
}
}
// update the disabled state of the button based on the command
for (let node of SocialMarks.nodes) {
for (let node of SocialMarks.nodes()) {
if (canShare) {
node.removeAttribute("disabled")
} else {
Expand Down Expand Up @@ -1300,7 +1300,7 @@ var SocialMarksWidgetListener = {
* Handles updates to toolbox and signals all buttons to update when necessary.
*/
SocialMarks = {
get nodes() {
*nodes() {
for (let p of Social.providers.filter(p => p.markURL)) {
let widgetId = SocialMarks._toolbarHelper.idFromOrigin(p.origin);
let widget = CustomizableUI.getWidget(widgetId);
Expand All @@ -1314,7 +1314,7 @@ SocialMarks = {
update: function() {
// querySelectorAll does not work on the menu panel, so we have to do this
// the hard way.
for (let node of this.nodes) {
for (let node of this.nodes()) {
// xbl binding is not complete on startup when buttons are not in toolbar,
// verify update is available
if (node.update) {
Expand Down
6 changes: 5 additions & 1 deletion browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7594,8 +7594,12 @@ var TabContextMenu = {

if (AppConstants.E10S_TESTING_ONLY) {
menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-remote");
for (let menuItem of menuItems)
for (let menuItem of menuItems) {
menuItem.hidden = !gMultiProcessBrowser;
if (menuItem.id == "context_openNonRemoteWindow") {
menuItem.disabled = !!parseInt(this.contextTab.getAttribute("usercontextid"));
}
}
}

disabled = gBrowser.visibleTabs.length == 1;
Expand Down
4 changes: 2 additions & 2 deletions browser/base/content/test/general/browser_contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ add_task(function* test_plaintext_sendpagetodevice() {
"context-viewinfo", true
];
yield test_contextmenu("#test-text", plainTextItems, {
onContextMenuShown() {
*onContextMenuShown() {
yield openMenuItemSubmenu("context-sendpagetodevice");
}
});
Expand Down Expand Up @@ -918,7 +918,7 @@ add_task(function* test_link_sendlinktodevice() {
"*All Devices", true], null,
],
{
onContextMenuShown() {
*onContextMenuShown() {
yield openMenuItemSubmenu("context-sendlinktodevice");
}
});
Expand Down
2 changes: 1 addition & 1 deletion browser/components/extensions/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"AllWindowEvents": true,
"currentWindow": true,
"EventEmitter": true,
"IconDetails": true,
"makeWidgetId": true,
"pageActionFor": true,
"IconDetails": true,
"PanelPopup": true,
"TabContext": true,
"ViewPopup": true,
Expand Down
17 changes: 13 additions & 4 deletions browser/components/extensions/ext-browserAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
"resource:///modules/CustomizableUI.jsm");

XPCOMUtils.defineLazyGetter(this, "colorUtils", () => {
return require("devtools/shared/css-color").colorUtils;
});

Cu.import("resource://devtools/shared/event-emitter.js");

Cu.import("resource://gre/modules/ExtensionUtils.jsm");
Expand Down Expand Up @@ -142,8 +146,8 @@ BrowserAction.prototype = {
"class", "toolbarbutton-badge");
if (badgeNode) {
let color = tabData.badgeBackgroundColor;
if (Array.isArray(color)) {
color = `rgb(${color[0]}, ${color[1]}, ${color[2]})`;
if (color) {
color = `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${color[3] / 255})`;
}
badgeNode.style.backgroundColor = color || "";
}
Expand Down Expand Up @@ -333,13 +337,18 @@ extensions.registerSchemaAPI("browserAction", (extension, context) => {

setBadgeBackgroundColor: function(details) {
let tab = details.tabId !== null ? TabManager.getTab(details.tabId) : null;
BrowserAction.for(extension).setProperty(tab, "badgeBackgroundColor", details.color);
let color = details.color;
if (!Array.isArray(color)) {
let col = colorUtils.colorToRGBA(color);
color = col && [col.r, col.g, col.b, Math.round(col.a * 255)];
}
BrowserAction.for(extension).setProperty(tab, "badgeBackgroundColor", color);
},

getBadgeBackgroundColor: function(details, callback) {
let tab = details.tabId !== null ? TabManager.getTab(details.tabId) : null;
let color = BrowserAction.for(extension).getProperty(tab, "badgeBackgroundColor");
return Promise.resolve(color);
return Promise.resolve(color || [0xd9, 0, 0, 255]);
},
},
};
Expand Down
1 change: 1 addition & 0 deletions browser/components/extensions/test/browser/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ support-files =
[browser_ext_pageAction_simple.js]
[browser_ext_popup_api_injection.js]
[browser_ext_runtime_openOptionsPage.js]
[browser_ext_runtime_openOptionsPage_uninstall.js]
[browser_ext_runtime_setUninstallURL.js]
[browser_ext_simple.js]
[browser_ext_tab_runtimeConnect.js]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,31 @@ add_task(function* testTabSwitchContext() {
},

getTests(tabs, expectDefaults) {
const DEFAULT_BADGE_COLOR = [0xd9, 0, 0, 255];

let details = [
{"icon": browser.runtime.getURL("default.png"),
"popup": browser.runtime.getURL("default.html"),
"title": "Default Title",
"badge": "",
"badgeBackgroundColor": null},
"badgeBackgroundColor": DEFAULT_BADGE_COLOR},
{"icon": browser.runtime.getURL("1.png"),
"popup": browser.runtime.getURL("default.html"),
"title": "Default Title",
"badge": "",
"badgeBackgroundColor": null},
"badgeBackgroundColor": DEFAULT_BADGE_COLOR},
{"icon": browser.runtime.getURL("2.png"),
"popup": browser.runtime.getURL("2.html"),
"title": "Title 2",
"badge": "2",
"badgeBackgroundColor": [0xff, 0, 0, 0xff],
"disabled": true},
"disabled": true},
{"icon": browser.runtime.getURL("1.png"),
"popup": browser.runtime.getURL("default-2.html"),
"title": "Default Title 2",
"badge": "d2",
"badgeBackgroundColor": [0, 0xff, 0, 0xff],
"disabled": true},
"disabled": true},
{"icon": browser.runtime.getURL("1.png"),
"popup": browser.runtime.getURL("default-2.html"),
"title": "Default Title 2",
Expand Down Expand Up @@ -237,7 +239,7 @@ add_task(function* testTabSwitchContext() {
browser.browserAction.setPopup({tabId, popup: "2.html"});
browser.browserAction.setTitle({tabId, title: "Title 2"});
browser.browserAction.setBadgeText({tabId, text: "2"});
browser.browserAction.setBadgeBackgroundColor({tabId, color: [0xff, 0, 0, 0xff]});
browser.browserAction.setBadgeBackgroundColor({tabId, color: "#ff0000"});
browser.browserAction.disable(tabId);

expectDefaults(details[0]).then(() => {
Expand Down Expand Up @@ -332,26 +334,28 @@ add_task(function* testDefaultTitle() {
},

getTests(tabs, expectDefaults) {
const DEFAULT_BADGE_COLOR = [0xd9, 0, 0, 255];

let details = [
{"title": "Foo Extension",
"popup": "",
"badge": "",
"badgeBackgroundColor": null,
"badgeBackgroundColor": DEFAULT_BADGE_COLOR,
"icon": browser.runtime.getURL("icon.png")},
{"title": "Foo Title",
"popup": "",
"badge": "",
"badgeBackgroundColor": null,
"badgeBackgroundColor": DEFAULT_BADGE_COLOR,
"icon": browser.runtime.getURL("icon.png")},
{"title": "Bar Title",
"popup": "",
"badge": "",
"badgeBackgroundColor": null,
"badgeBackgroundColor": DEFAULT_BADGE_COLOR,
"icon": browser.runtime.getURL("icon.png")},
{"title": "",
"popup": "",
"badge": "",
"badgeBackgroundColor": null,
"badgeBackgroundColor": DEFAULT_BADGE_COLOR,
"icon": browser.runtime.getURL("icon.png")},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,66 +257,3 @@ add_task(function* test_options_no_manifest() {
yield extension.awaitFinish("options-no-manifest");
yield extension.unload();
});

add_task(function* test_inline_options_uninstall() {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/");

let extension = yield loadExtension({
manifest: {
"options_ui": {
"page": "options.html",
},
},

background: function() {
let _optionsPromise;
let awaitOptions = () => {
browser.test.assertFalse(_optionsPromise, "Should not be awaiting options already");

return new Promise(resolve => {
_optionsPromise = {resolve};
});
};

browser.runtime.onMessage.addListener((msg, sender) => {
if (msg == "options.html") {
if (_optionsPromise) {
_optionsPromise.resolve(sender.tab);
_optionsPromise = null;
} else {
browser.test.fail("Saw unexpected options page load");
}
}
});

let firstTab;
browser.tabs.query({currentWindow: true, active: true}).then(tabs => {
firstTab = tabs[0].id;

browser.test.log("Open options page. Expect fresh load.");
return Promise.all([
browser.runtime.openOptionsPage(),
awaitOptions(),
]);
}).then(([, tab]) => {
browser.test.assertEq("about:addons", tab.url, "Tab contains AddonManager");
browser.test.assertTrue(tab.active, "Tab is active");
browser.test.assertTrue(tab.id != firstTab, "Tab is a new tab");

browser.test.sendMessage("options-ui-open");
}).catch(error => {
browser.test.fail(`Error: ${error} :: ${error.stack}`);
});
},
});

yield extension.awaitMessage("options-ui-open");
yield extension.unload();

is(gBrowser.selectedBrowser.currentURI.spec, "about:addons",
"Add-on manager tab should still be open");

yield BrowserTestUtils.removeTab(gBrowser.selectedTab);

yield BrowserTestUtils.removeTab(tab);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";

function* loadExtension(options) {
let extension = ExtensionTestUtils.loadExtension({
useAddonManager: "temporary",

manifest: Object.assign({
"permissions": ["tabs"],
}, options.manifest),

files: {
"options.html": `<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="options.js" type="text/javascript"></script>
</head>
</html>`,

"options.js": function() {
browser.runtime.sendMessage("options.html");
browser.runtime.onMessage.addListener((msg, sender, respond) => {
if (msg == "ping") {
respond("pong");
}
});
},
},

background: options.background,
});

yield extension.startup();

return extension;
}

add_task(function* test_inline_options_uninstall() {
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com/");

let extension = yield loadExtension({
manifest: {
"options_ui": {
"page": "options.html",
},
},

background: function() {
let _optionsPromise;
let awaitOptions = () => {
browser.test.assertFalse(_optionsPromise, "Should not be awaiting options already");

return new Promise(resolve => {
_optionsPromise = {resolve};
});
};

browser.runtime.onMessage.addListener((msg, sender) => {
if (msg == "options.html") {
if (_optionsPromise) {
_optionsPromise.resolve(sender.tab);
_optionsPromise = null;
} else {
browser.test.fail("Saw unexpected options page load");
}
}
});

let firstTab;
browser.tabs.query({currentWindow: true, active: true}).then(tabs => {
firstTab = tabs[0].id;

browser.test.log("Open options page. Expect fresh load.");
return Promise.all([
browser.runtime.openOptionsPage(),
awaitOptions(),
]);
}).then(([, tab]) => {
browser.test.assertEq("about:addons", tab.url, "Tab contains AddonManager");
browser.test.assertTrue(tab.active, "Tab is active");
browser.test.assertTrue(tab.id != firstTab, "Tab is a new tab");

browser.test.sendMessage("options-ui-open");
}).catch(error => {
browser.test.fail(`Error: ${error} :: ${error.stack}`);
});
},
});

yield extension.awaitMessage("options-ui-open");
yield extension.unload();

is(gBrowser.selectedBrowser.currentURI.spec, "about:addons",
"Add-on manager tab should still be open");

yield BrowserTestUtils.removeTab(gBrowser.selectedTab);

yield BrowserTestUtils.removeTab(tab);
});
5 changes: 3 additions & 2 deletions browser/config/tooltool-manifests/macosx64/releng.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"unpack": true
},
{
"size": 93295855,
"digest": "2b8fd0c1ba337a7035090c420305a7892e663ce6781569b100b36fa21cc26146e67f44a34c7715f0004f48bbe46c232bbbf2928c9d0595243d2584530770b504",
"version": "rust 1.10 repack",
"size": 150726627,
"digest": "a30476113212895a837b2c4c18eb34d767c7192c3e327fba84c0138eaf7e671e84d5294e75370af3fe7e527a61e0938cd6cce20fba0aec94537070eb0094e27e",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true
Expand Down
Loading

0 comments on commit cf611be

Please sign in to comment.