Skip to content

Commit

Permalink
Merge autoland to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Tuns committed Jul 1, 2024
2 parents 89c3b3b + 3e36b95 commit 040bb7f
Show file tree
Hide file tree
Showing 18 changed files with 385 additions and 338 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>

<!-- Firefox searchbar -->
<?xml-stylesheet href="chrome://browser/content/browser.css"
type="text/css"?>
<!-- SeaMonkey searchbar -->
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
type="text/css"?>
Expand Down
3 changes: 0 additions & 3 deletions accessible/tests/mochitest/states/test_expandable.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>

<!-- Firefox searchbar -->
<?xml-stylesheet href="chrome://browser/content/browser.css"
type="text/css"?>
<!-- SeaMonkey searchbar -->
<?xml-stylesheet href="chrome://navigator/content/navigator.css"
type="text/css"?>
Expand Down
4 changes: 0 additions & 4 deletions accessible/tests/mochitest/tree/test_formctrl.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>

<!-- Firefox toolbar -->
<?xml-stylesheet href="chrome://browser/content/browser.css"
type="text/css"?>

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Accessible XUL checkbox and radio hierarchy tests">

Expand Down
50 changes: 0 additions & 50 deletions browser/base/content/browser.css

This file was deleted.

36 changes: 20 additions & 16 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,13 +893,15 @@ function SetClickAndHoldHandlers() {
let backButton = document.getElementById("back-button");
backButton.setAttribute("type", "menu");
popup.addEventListener("command", backForwardMenuCommand);
popup.addEventListener("popupshowing", FillHistoryMenu);
backButton.prepend(popup);
gClickAndHoldListenersOnElement.add(backButton);

let forwardButton = document.getElementById("forward-button");
popup = popup.cloneNode(true);
forwardButton.setAttribute("type", "menu");
popup.addEventListener("command", backForwardMenuCommand);
popup.addEventListener("popupshowing", FillHistoryMenu);
forwardButton.prepend(popup);
gClickAndHoldListenersOnElement.add(forwardButton);
}
Expand Down Expand Up @@ -2686,36 +2688,39 @@ function CreateContainerTabMenu(event) {
// Do not open context menus within menus.
// Note that triggerNode is null if we're opened by long press.
if (event.target.triggerNode?.closest("menupopup")) {
return false;
event.preventDefault();
return;
}
createUserContextMenu(event, {
useAccessKeys: false,
showDefaultTab: true,
});
}

function FillHistoryMenu(aParent) {
function FillHistoryMenu(event) {
let parent = event.target;

// Lazily add the hover listeners on first showing and never remove them
if (!aParent.hasStatusListener) {
if (!parent.hasStatusListener) {
// Show history item's uri in the status bar when hovering, and clear on exit
aParent.addEventListener("DOMMenuItemActive", function (aEvent) {
parent.addEventListener("DOMMenuItemActive", function (aEvent) {
// Only the current page should have the checked attribute, so skip it
if (!aEvent.target.hasAttribute("checked")) {
XULBrowserWindow.setOverLink(aEvent.target.getAttribute("uri"));
}
});
aParent.addEventListener("DOMMenuItemInactive", function () {
parent.addEventListener("DOMMenuItemInactive", function () {
XULBrowserWindow.setOverLink("");
});

aParent.hasStatusListener = true;
parent.hasStatusListener = true;
}

// Remove old entries if any
let children = aParent.children;
let children = parent.children;
for (var i = children.length - 1; i >= 0; --i) {
if (children[i].hasAttribute("index")) {
aParent.removeChild(children[i]);
parent.removeChild(children[i]);
}
}

Expand All @@ -2733,15 +2738,15 @@ function FillHistoryMenu(aParent) {
if (!initial) {
if (count <= 1) {
// if there is only one entry now, close the popup.
aParent.hidePopup();
parent.hidePopup();
return;
} else if (aParent.id != "backForwardMenu" && !aParent.parentNode.open) {
} else if (parent.id != "backForwardMenu" && !parent.parentNode.open) {
// if the popup wasn't open before, but now needs to be, reopen the menu.
// It should trigger FillHistoryMenu again. This might happen with the
// delay from click-and-hold menus but skip this for the context menu
// (backForwardMenu) rather than figuring out how the menu should be
// positioned and opened as it is an extreme edgecase.
aParent.parentNode.open = true;
parent.parentNode.open = true;
return;
}
}
Expand Down Expand Up @@ -2811,7 +2816,7 @@ function FillHistoryMenu(aParent) {
}

if (!item.parentNode) {
aParent.appendChild(item);
parent.appendChild(item);
}

existingIndex++;
Expand All @@ -2820,7 +2825,7 @@ function FillHistoryMenu(aParent) {
if (!initial) {
let existingLength = children.length;
while (existingIndex < existingLength) {
aParent.removeChild(aParent.lastElementChild);
parent.removeChild(parent.lastElementChild);
existingIndex++;
}
}
Expand All @@ -2832,7 +2837,8 @@ function FillHistoryMenu(aParent) {
if (sessionHistory?.count) {
// Don't show the context menu if there is only one item.
if (sessionHistory.count <= 1) {
return false;
event.preventDefault();
return;
}

updateSessionHistory(sessionHistory, true, true);
Expand All @@ -2843,8 +2849,6 @@ function FillHistoryMenu(aParent) {
);
updateSessionHistory(sessionHistory, true, false);
}

return true;
}

function toOpenWindowByType(inType, uri, features) {
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/browser.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
both "content" and "skin" packages, which bug 1385444 will unify later. -->
<link rel="stylesheet" href="chrome://global/skin/global.css" />

<link rel="stylesheet" href="chrome://browser/content/browser.css" />
<link
rel="stylesheet"
href="chrome://browser/content/downloads/downloads.css"
Expand Down
47 changes: 15 additions & 32 deletions browser/base/content/main-popupset.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
<popupset id="mainPopupSet">
<script src="chrome://browser/content/main-popupset.js" />

<menupopup id="tabContextMenu"
onpopupshowing="if (event.target == this) TabContextMenu.updateContextMenu(this);"
onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;">
<menupopup id="tabContextMenu">
<menuitem id="context_openANewTab" data-lazy-l10n-id="tab-context-new-tab"/>
<menuseparator/>
<menuitem id="context_reloadTab" data-lazy-l10n-id="reload-tab"/>
Expand Down Expand Up @@ -46,14 +44,12 @@
class="sync-ui-item"
data-lazy-l10n-id="tab-context-send-tabs-to-device"
data-l10n-args='{"tabCount": 1}'>
<menupopup id="context_sendTabToDevicePopupMenu"
onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI, TabContextMenu.contextTab.linkedBrowser.contentTitle, TabContextMenu.contextTab.multiselected);"/>
<menupopup id="context_sendTabToDevicePopupMenu"/>
</menu>
<menu id="context_reopenInContainer"
data-lazy-l10n-id="tab-context-open-in-new-container-tab"
hidden="true">
<menupopup id="context_reopenInContainerPopupMenu"
onpopupshowing="TabContextMenu.createReopenInContainerMenu(event);"/>
<menupopup id="context_reopenInContainerPopupMenu"/>
</menu>
<menuitem id="context_selectAllTabs" data-lazy-l10n-id="select-all-tabs"/>
<menuseparator/>
Expand Down Expand Up @@ -86,13 +82,12 @@
</menupopup>

<!-- This node can be cloned by SetClickAndHoldHandlers. -->
<menupopup id="backForwardMenu"
onpopupshowing="return FillHistoryMenu(event.target);"/>
<menupopup id="backForwardMenu"/>
<tooltip id="aHTMLTooltip" page="true"/>
<tooltip id="remoteBrowserTooltip"/>

<menupopup id="new-tab-button-popup"
onpopupshowing="return CreateContainerTabMenu(event);"/>
<!-- This node can be cloned by MozTabbrowserTabs.observes. -->
<menupopup id="new-tab-button-popup"/>
<!-- for search and content formfill/pw manager -->

<panel is="autocomplete-richlistbox-popup"
Expand Down Expand Up @@ -260,8 +255,7 @@
contexttype="extension-action"/>
</menupopup>

<menupopup id="toolbar-context-menu"
onpopupshowing="if (event.target == this) { onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator')) }; ToolbarContextMenu.updateDownloadsAutoHide(this); ToolbarContextMenu.updateDownloadsAlwaysOpenPanel(this); ToolbarContextMenu.updateExtension(this, event)">
<menupopup id="toolbar-context-menu">
<menuitem id="toolbar-context-manage-extension"
data-lazy-l10n-id="toolbar-context-menu-manage-extension"
contexttype="toolbaritem"
Expand Down Expand Up @@ -338,9 +332,7 @@
data-lazy-l10n-id="full-screen-exit"/>
</menupopup>

<menupopup id="blockedPopupOptions"
onpopupshowing="gPopupBlockerObserver.fillPopupList(event);"
onpopuphiding="gPopupBlockerObserver.onPopupHiding(event);">
<menupopup id="blockedPopupOptions">
<menuitem id="blockedPopupAllowSite"/>
<menuitem id="blockedPopupEdit"
data-l10n-id="edit-popup-settings"/>
Expand Down Expand Up @@ -429,8 +421,7 @@
</panel>
</html:template>

<menupopup id="pageActionContextMenu"
onpopupshowing="BrowserPageActions.onContextMenuShowing(event, this);">
<menupopup id="pageActionContextMenu">
<menuitem id="pageActionContextMenuManageExtension"
class="pageActionContextMenuItem extensionPinned extensionUnpinned manageExtensionItem"
data-l10n-id="page-action-manage-extension2"/>
Expand All @@ -442,9 +433,7 @@
#include ../../components/places/content/bookmarksHistoryTooltip.inc.xhtml

<tooltip id="tabbrowser-tab-tooltip"
class="places-tooltip"
onpopupshowing="gBrowser.createTooltip(event);"
onpopuphiding="this.removeAttribute('position')">
class="places-tooltip">
<box class="places-tooltip-box">
<description class="tooltip-label places-tooltip-title"/>
<hbox>
Expand Down Expand Up @@ -475,8 +464,7 @@
#include ../../components/translations/content/fullPageTranslationsPanel.inc.xhtml
#include ../../components/tabbrowser/content/browser-allTabsMenu.inc.xhtml

<tooltip id="dynamic-shortcut-tooltip"
onpopupshowing="UpdateDynamicShortcutTooltipText(this);"/>
<tooltip id="dynamic-shortcut-tooltip"/>

<menupopup id="SyncedTabsSidebarContext">
<menuitem data-lazy-l10n-id="synced-tabs-context-open"
Expand All @@ -486,8 +474,7 @@
<menu data-lazy-l10n-id="synced-tabs-context-open-in-container-tab"
id="syncedTabsOpenSelectedInContainerTab"
hidden="true">
<menupopup id="SyncedTabsOpenSelectedInContainerTabMenu"
onpopupshowing="createUserContextMenu(event, { isContextMenu: true });"/>
<menupopup id="SyncedTabsOpenSelectedInContainerTabMenu"/>
</menu>
<menuitem data-lazy-l10n-id="synced-tabs-context-open-in-window"
id="syncedTabsOpenSelectedInWindow" where="window"/>
Expand Down Expand Up @@ -545,8 +532,7 @@
orient="vertical"
ignorekeys="true"
consumeoutsideclicks="never"
norolluponanchor="true"
onpopupshown="gSharedTabWarning.sharedTabWarningShown();">
norolluponanchor="true">
<hbox type="window" align="start">
<image class="screen-icon popup-notification-icon"></image>
<vbox flex="1" pack="start">
Expand All @@ -573,8 +559,7 @@

#include ../../../toolkit/components/pictureinpicture/content/pictureInPicturePanel.inc.xhtml

<menupopup id="unified-extensions-context-menu"
onpopupshowing="gUnifiedExtensions.updateContextMenu(this, event)">
<menupopup id="unified-extensions-context-menu">
<menuitem id="unified-extensions-context-menu-pin-to-toolbar"
data-lazy-l10n-id="unified-extensions-context-menu-pin-to-toolbar"
type="checkbox"
Expand All @@ -597,9 +582,7 @@
id="unified-extensions-context-menu-report-extension"/>
</menupopup>

<menupopup id="full-page-translations-panel-settings-menupopup"
onpopupshown="FullPageTranslationsPanel.handleSettingsPopupShownEvent()"
onpopuphidden="FullPageTranslationsPanel.handleSettingsPopupHiddenEvent()">
<menupopup id="full-page-translations-panel-settings-menupopup">
<menuitem class="always-offer-translations-menuitem"
data-l10n-id="translations-panel-settings-always-offer-translation"
type="checkbox"
Expand Down
Loading

0 comments on commit 040bb7f

Please sign in to comment.