Skip to content

Commit

Permalink
Merge inbound to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ncsoregi committed Jul 26, 2018
2 parents 85cca5e + 0b86a8d commit 3708e71
Show file tree
Hide file tree
Showing 480 changed files with 12,343 additions and 45,358 deletions.
17 changes: 4 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ pref("extensions.geckoProfiler.getSymbolRules", "localBreakpad,dump_syms.exe");
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';");

#if defined(XP_WIN) || defined(XP_MACOSX)
pref("extensions.webextensions.remote", true);
#endif

pref("extensions.webextensions.background-delayed-startup", true);

// Extensions that should not be flagged as legacy in about:addons
Expand Down
6 changes: 3 additions & 3 deletions browser/base/content/browser-siteIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ var gIdentityHandler = {
let block = document.createElement("vbox");
block.setAttribute("id", "identity-popup-popup-container");
menulist.setAttribute("sizetopopup", "none");
menulist.setAttribute("class", "identity-popup-popup-menulist subviewkeynav");
menulist.setAttribute("class", "identity-popup-popup-menulist");
menulist.setAttribute("id", "identity-popup-popup-menulist");

for (let state of SitePermissions.getAvailableStates(aPermission.id)) {
Expand Down Expand Up @@ -1090,7 +1090,7 @@ var gIdentityHandler = {
}

let button = document.createElement("button");
button.setAttribute("class", "identity-popup-permission-remove-button subviewkeynav");
button.setAttribute("class", "identity-popup-permission-remove-button");
let tooltiptext = gNavigatorBundle.getString("permissions.remove.tooltip");
button.setAttribute("tooltiptext", tooltiptext);
button.addEventListener("command", () => {
Expand Down Expand Up @@ -1146,7 +1146,7 @@ var gIdentityHandler = {

let text = document.createElement("label");
text.setAttribute("flex", "1");
text.setAttribute("class", "identity-popup-permission-label text-link subviewkeynav");
text.setAttribute("class", "identity-popup-permission-label text-link");

let popupCount = gBrowser.selectedBrowser.blockedPopups.length;
let messageBase = gNavigatorBundle.getString("popupShowBlockedPopupsIndicatorText");
Expand Down
20 changes: 9 additions & 11 deletions browser/components/controlcenter/content/panel.inc.xul
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</vbox>
</vbox>
<button id="identity-popup-security-expander"
class="identity-popup-expander subviewkeynav"
class="identity-popup-expander"
when-connection="not-secure secure secure-ev secure-cert-user-overridden"
oncommand="gIdentityHandler.showSecuritySubView();"/>
</hbox>
Expand Down Expand Up @@ -84,22 +84,22 @@
crop="end">&trackingProtection.reloadRequired2;</description>

<button id="tracking-action-reload"
class="tracking-protection-button subviewkeynav"
class="tracking-protection-button"
label="&trackingProtection.reload2.label;"
accesskey="&trackingProtection.reload2.accesskey;"
oncommand="TrackingProtection.hideIdentityPopupAndReload();" />
<button id="tracking-action-unblock"
class="tracking-protection-button subviewkeynav"
class="tracking-protection-button"
label="&trackingProtection.unblock3.label;"
accesskey="&trackingProtection.unblock3.accesskey;"
oncommand="TrackingProtection.disableForCurrentPage();" />
<button id="tracking-action-unblock-private"
class="tracking-protection-button subviewkeynav"
class="tracking-protection-button"
label="&trackingProtection.unblockPrivate3.label;"
accesskey="&trackingProtection.unblockPrivate3.accesskey;"
oncommand="TrackingProtection.disableForCurrentPage();" />
<button id="tracking-action-block"
class="tracking-protection-button subviewkeynav"
class="tracking-protection-button"
label="&trackingProtection.block4.label;"
accesskey="&trackingProtection.block4.accesskey;"
oncommand="TrackingProtection.enableForCurrentPage();" />
Expand Down Expand Up @@ -131,8 +131,7 @@
<vbox hidden="true"
id="identity-popup-clear-sitedata-footer"
class="identity-popup-footer">
<button class="subviewkeynav"
id="identity-popup-clear-sitedata-button"
<button id="identity-popup-clear-sitedata-button"
label="&identity.clearSiteData;"
oncommand="gIdentityHandler.clearSiteData(event);"/>
</vbox>
Expand Down Expand Up @@ -167,7 +166,6 @@

<!-- Remove Certificate Exception -->
<button when-connection="secure-cert-user-overridden"
class="subviewkeynav"
label="&identity.removeCertException.label;"
accesskey="&identity.removeCertException.accesskey;"
oncommand="gIdentityHandler.removeCertException()"/>
Expand Down Expand Up @@ -209,19 +207,19 @@
and-when-loginforms="insecure">&identity.description.activeLoaded; <label observes="identity-popup-mcb-learn-more"/></description>

<!-- Buttons to enable/disable mixed content blocking. -->
<button when-mixedcontent="active-blocked" class="subviewkeynav"
<button when-mixedcontent="active-blocked"
label="&identity.disableMixedContentBlocking.label;"
accesskey="&identity.disableMixedContentBlocking.accesskey;"
oncommand="gIdentityHandler.disableMixedContentProtection()"/>
<button when-mixedcontent="active-loaded" class="subviewkeynav"
<button when-mixedcontent="active-loaded"
label="&identity.enableMixedContentBlocking.label;"
accesskey="&identity.enableMixedContentBlocking.accesskey;"
oncommand="gIdentityHandler.enableMixedContentProtection()"/>
</vbox>

<vbox id="identity-popup-more-info-footer" class="identity-popup-footer">
<!-- More Security Information -->
<button id="identity-popup-more-info" class="subviewkeynav"
<button id="identity-popup-more-info"
label="&identity.moreInfoLinkText2;"
oncommand="gIdentityHandler.handleMoreInfoClick(event);"/>
</vbox>
Expand Down
56 changes: 29 additions & 27 deletions browser/components/customizableui/PanelMultiView.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1357,17 +1357,29 @@ var PanelView = class extends AssociatedToNode {
}

/**
* Retrieves the button elements that can be used for navigation using the
* keyboard, that is all enabled buttons including the back button if visible.
* Array of enabled elements that can be selected with the keyboard. This
* means all buttons, menulists, and text links including the back button.
*
* @return {Array}
* This list is cached until the view is closed, so elements that become
* enabled later may not be navigable.
*/
_getNavigableElements() {
let buttons = Array.from(this.node.querySelectorAll(
".subviewbutton:not([disabled]), .subviewkeynav:not([disabled])"));
get _navigableElements() {
if (this.__navigableElements) {
return this.__navigableElements;
}

let navigableElements = Array.from(this.node.querySelectorAll(
":-moz-any(button,toolbarbutton,menulist,.text-link):not([disabled])"));
let dwu = this._dwu;
return buttons.filter(button => {
let bounds = dwu.getBoundsWithoutFlushing(button);
return this.__navigableElements = navigableElements.filter(element => {
// Set the "tabindex" attribute to make sure the element is focusable.
if (!element.hasAttribute("tabindex")) {
element.setAttribute("tabindex", "0");
}
if (element.hasAttribute("disabled")) {
return false;
}
let bounds = dwu.getBoundsWithoutFlushing(element);
return bounds.width > 0 && bounds.height > 0;
});
}
Expand All @@ -1377,8 +1389,7 @@ var PanelView = class extends AssociatedToNode {
* is selected. Since the reference is held weakly, it can become null or
* undefined at any time.
*
* The element is usually, but not necessarily, in the "buttons" property
* which in turn is initialized from the _getNavigableElements list.
* The element is usually, but not necessarily, among the _navigableElements.
*/
get selectedElement() {
return this._selectedElement && this._selectedElement.get();
Expand All @@ -1396,19 +1407,19 @@ var PanelView = class extends AssociatedToNode {
* This is a no-op if there are no navigable elements.
*/
focusFirstNavigableElement() {
this.selectedElement = this._getNavigableElements()[0];
this.selectedElement = this._navigableElements[0];
this.focusSelectedElement();
}

/**
* Based on going up or down, select the previous or next focusable button.
* Based on going up or down, select the previous or next focusable element.
*
* @param {Boolean} isDown whether we're going down (true) or up (false).
*
* @return {DOMNode} the button we selected.
* @return {DOMNode} the element we selected.
*/
moveSelection(isDown) {
let buttons = this.buttons;
let buttons = this._navigableElements;
let lastSelected = this.selectedElement;
let newButton = null;
let maxIdx = buttons.length - 1;
Expand Down Expand Up @@ -1478,19 +1489,10 @@ var PanelView = class extends AssociatedToNode {
return;
}

let buttons = this.buttons;
if (!buttons || !buttons.length) {
buttons = this.buttons = this._getNavigableElements();
// Set the 'tabindex' attribute on the buttons to make sure they're focussable.
for (let button of buttons) {
if (!button.classList.contains("subviewbutton-back") &&
!button.hasAttribute("tabindex")) {
button.setAttribute("tabindex", 0);
}
}
}
if (!buttons.length)
let buttons = this._navigableElements;
if (!buttons.length) {
return;
}

let stop = () => {
event.stopPropagation();
Expand Down Expand Up @@ -1559,7 +1561,7 @@ var PanelView = class extends AssociatedToNode {
* Clear all traces of keyboard navigation happening right now.
*/
clearNavigation() {
delete this.buttons;
delete this.__navigableElements;
let selected = this.selectedElement;
if (selected) {
selected.blur();
Expand Down
1 change: 0 additions & 1 deletion browser/components/customizableui/content/panelUI.inc.xul
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@
label="&trackingProtection.title;"/>
<toolbarseparator orient="vertical"/>
<toolbarbutton id="appMenu-tp-toggle"
class="subviewkeynav"
enabled="false"
oncommand="TrackingProtection.onGlobalToggleCommand();" />
</toolbaritem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@
const {PanelView} = ChromeUtils.import("resource:///modules/PanelMultiView.jsm", {});
const kHelpButtonId = "appMenu-help-button";

function getEnabledNavigableElementsForView(panelView) {
return Array.from(panelView.querySelectorAll(
"button,toolbarbutton,menulist,.text-link"
)).filter(element => {
let bounds = element.getBoundingClientRect();
return !element.disabled && (bounds.width > 0 && bounds.height > 0);
});
}

add_task(async function testUpDownKeys() {
await gCUITestUtils.openMainMenu();

let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);

for (let button of buttons) {
if (button.disabled)
Expand Down Expand Up @@ -39,7 +48,7 @@ add_task(async function testUpDownKeys() {
add_task(async function testEnterKeyBehaviors() {
await gCUITestUtils.openMainMenu();

let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);

// Navigate to the 'Help' button, which points to a subview.
EventUtils.synthesizeKey("KEY_ArrowUp");
Expand All @@ -56,7 +65,7 @@ add_task(async function testEnterKeyBehaviors() {
EventUtils.synthesizeKey("KEY_Enter");
await promise;

let helpButtons = PanelView.forNode(PanelUI.helpView)._getNavigableElements();
let helpButtons = getEnabledNavigableElementsForView(PanelUI.helpView);
Assert.ok(helpButtons[0].classList.contains("subviewbutton-back"),
"First button in help view should be a back button");

Expand Down Expand Up @@ -132,7 +141,7 @@ add_task(async function testLeftRightKeys() {
add_task(async function testTabKey() {
await gCUITestUtils.openMainMenu();

let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);

for (let button of buttons) {
if (button.disabled)
Expand Down Expand Up @@ -165,7 +174,7 @@ add_task(async function testTabKey() {
add_task(async function testInterleavedTabAndArrowKeys() {
await gCUITestUtils.openMainMenu();

let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
let tab = false;

for (let button of buttons) {
Expand All @@ -188,7 +197,7 @@ add_task(async function testInterleavedTabAndArrowKeys() {
add_task(async function testSpaceDownAfterTabNavigation() {
await gCUITestUtils.openMainMenu();

let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
let button;

for (button of buttons) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,12 @@ add_task(async function testBrowserActionTabPopulation() {
let widget = getBrowserActionWidget(extension).forWindow(win);
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, win);

await extension.awaitMessage("tabTitle");
await new Promise(resolve => setTimeout(resolve, 100));

EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, win);

await extension.awaitMessage("tabTitle");

await extension.unload();
await BrowserTestUtils.closeWindow(win);
});
8 changes: 0 additions & 8 deletions browser/themes/osx/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@
%include ../shared/toolbarbutton-icons.inc.css
%include ../shared/menupanel.inc.css

/* Override OSX-specific toolkit findbar button styles */
.findbar-button {
background: none;
box-shadow: none;
border: none;
color: inherit;
}

/* On Mac, native buttons keep their full opacity when they become disabled
* and only the glyph or text on top of them becomes less opaque. */
:root:not([customizing]) #back-button[disabled="true"] {
Expand Down
6 changes: 0 additions & 6 deletions browser/themes/shared/toolbarbuttons.inc.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ toolbar[brighttext] {
background-color: Highlight;
}

.findbar-button {
-moz-appearance: none;
padding: 0;
color: inherit;
}

toolbar .toolbarbutton-1 {
-moz-appearance: none;
margin: 0;
Expand Down
Loading

0 comments on commit 3708e71

Please sign in to comment.