Revert "Bug 1973189 - Enable context menu for input elements in History and Synced Tabs. a=RyanVM DONTBUILD"
This reverts commit a2c5175274.
This commit is contained in:
committed by
rvandermeulen@mozilla.com
parent
42e2d8fdfa
commit
99c859a252
@@ -42,8 +42,6 @@
|
||||
src="chrome://browser/content/sidebar/sidebar-history.mjs"
|
||||
></script>
|
||||
<script src="chrome://browser/content/contentTheme.js"></script>
|
||||
<script src="chrome://global/content/globalOverlay.js"></script>
|
||||
<script src="chrome://global/content/editMenuOverlay.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -68,9 +68,7 @@ export class SidebarHistory extends SidebarPage {
|
||||
}
|
||||
|
||||
handleContextMenuEvent(e) {
|
||||
this.triggerNode =
|
||||
this.findTriggerNode(e, "sidebar-tab-row") ||
|
||||
this.findTriggerNode(e, "moz-input-search");
|
||||
this.triggerNode = this.findTriggerNode(e, "sidebar-tab-row");
|
||||
if (!this.triggerNode) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
@@ -119,7 +119,6 @@ export class SidebarPage extends MozLitElement {
|
||||
e.originalTarget.flattenedTreeParentNode,
|
||||
// Event might be in shadow DOM, check the host element.
|
||||
e.explicitOriginalTarget.flattenedTreeParentNode.getRootNode().host,
|
||||
e.originalTarget.flattenedTreeParentNode.getRootNode().host,
|
||||
];
|
||||
for (let el of elements) {
|
||||
if (el?.localName == localName) {
|
||||
|
||||
@@ -47,8 +47,6 @@
|
||||
src="chrome://browser/content/sidebar/sidebar-syncedtabs.mjs"
|
||||
></script>
|
||||
<script src="chrome://browser/content/contentTheme.js"></script>
|
||||
<script src="chrome://global/content/globalOverlay.js"></script>
|
||||
<script src="chrome://global/content/editMenuOverlay.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@@ -60,9 +60,7 @@ class SyncedTabsInSidebar extends SidebarPage {
|
||||
}
|
||||
|
||||
handleContextMenuEvent(e) {
|
||||
this.triggerNode =
|
||||
this.findTriggerNode(e, "sidebar-tab-row") ||
|
||||
this.findTriggerNode(e, "moz-input-search");
|
||||
this.triggerNode = this.findTriggerNode(e, "sidebar-tab-row");
|
||||
if (!this.triggerNode) {
|
||||
e.preventDefault();
|
||||
return;
|
||||
|
||||
@@ -195,8 +195,8 @@ add_task(async function test_history_cards_created() {
|
||||
SidebarController.hide();
|
||||
});
|
||||
|
||||
add_task(async function test_history_searchbox_focus_and_context_menu() {
|
||||
const { component, contentWindow } = await showHistorySidebar();
|
||||
add_task(async function test_history_searchbox_focus() {
|
||||
const { component } = await showHistorySidebar();
|
||||
const { searchTextbox } = component;
|
||||
|
||||
ok(component.shadowRoot.activeElement, "check activeElement is present");
|
||||
@@ -205,24 +205,6 @@ add_task(async function test_history_searchbox_focus_and_context_menu() {
|
||||
searchTextbox,
|
||||
"Check search box is focused"
|
||||
);
|
||||
|
||||
const promisePopupShown = BrowserTestUtils.waitForEvent(
|
||||
contentWindow,
|
||||
"popupshown"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
searchTextbox,
|
||||
{ type: "contextmenu", button: 2 },
|
||||
contentWindow
|
||||
);
|
||||
const { target: menu } = await promisePopupShown;
|
||||
Assert.equal(
|
||||
menu.id,
|
||||
"textbox-contextmenu",
|
||||
"The correct context menu is shown."
|
||||
);
|
||||
menu.hidePopup();
|
||||
|
||||
SidebarController.hide();
|
||||
});
|
||||
|
||||
|
||||
@@ -203,9 +203,9 @@ add_task(async function test_tabs() {
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
add_task(async function test_syncedtabs_searchbox_focus_and_context_menu() {
|
||||
add_task(async function test_syncedtabs_searchbox_focus() {
|
||||
await SidebarController.show("viewTabsSidebar");
|
||||
const { contentDocument, contentWindow } = SidebarController.browser;
|
||||
const { contentDocument } = SidebarController.browser;
|
||||
const component = contentDocument.querySelector("sidebar-syncedtabs");
|
||||
const { searchTextbox } = component;
|
||||
|
||||
@@ -215,24 +215,6 @@ add_task(async function test_syncedtabs_searchbox_focus_and_context_menu() {
|
||||
searchTextbox,
|
||||
"Check search box is focused"
|
||||
);
|
||||
|
||||
const promisePopupShown = BrowserTestUtils.waitForEvent(
|
||||
contentWindow,
|
||||
"popupshown"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
searchTextbox,
|
||||
{ type: "contextmenu", button: 2 },
|
||||
contentWindow
|
||||
);
|
||||
const { target: menu } = await promisePopupShown;
|
||||
Assert.equal(
|
||||
menu.id,
|
||||
"textbox-contextmenu",
|
||||
"The correct context menu is shown."
|
||||
);
|
||||
menu.hidePopup();
|
||||
|
||||
SidebarController.hide();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user