From af1fcf56340afc2d48fde3824ba0ef1abe01fd1a Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Thu, 4 Mar 2021 08:50:30 +0000 Subject: [PATCH] Bug 1686931, merge view image and view background image commands on context menu, r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D103775 --- browser/base/content/browser-context.inc | 5 - browser/base/content/nsContextMenu.js | 42 +++--- .../test/contextMenu/browser_contextmenu.js | 132 ++++++++++++++---- .../contextMenu/browser_contextmenu_input.js | 4 - .../test/contextMenu/subtst_contextmenu.html | 5 +- .../content/test/general/browser_bug734076.js | 6 +- .../locales/en-US/browser/browserContext.ftl | 4 - ...browser_test_view_image_data_navigation.js | 6 +- 8 files changed, 140 insertions(+), 64 deletions(-) diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc index 22ce1d6c7e5c..6798aa803fae 100644 --- a/browser/base/content/browser-context.inc +++ b/browser/base/content/browser-context.inc @@ -236,11 +236,6 @@ - - - +Text with background + image + . + diff --git a/browser/base/content/test/general/browser_bug734076.js b/browser/base/content/test/general/browser_bug734076.js index 184aebab45db..8c00f2785417 100644 --- a/browser/base/content/test/general/browser_bug734076.js +++ b/browser/base/content/test/general/browser_bug734076.js @@ -19,7 +19,7 @@ add_task(async function() { let tests = [ { - name: "view background image", + name: "view image with background image", url: "http://mochi.test:8888/", element: "body", go() { @@ -31,7 +31,7 @@ add_task(async function() { contentBody.style.backgroundImage = "url('" + arg.writeDomainURL + "')"; - return "context-viewbgimage"; + return "context-viewimage"; } ); }, @@ -41,7 +41,7 @@ add_task(async function() { ) { Assert.ok( !content.document.body.textContent, - "no domain was inherited for view background image" + "no domain was inherited for view image with background image" ); }); }, diff --git a/browser/locales/en-US/browser/browserContext.ftl b/browser/locales/en-US/browser/browserContext.ftl index caa2ca3aeacc..a644e6360861 100644 --- a/browser/locales/en-US/browser/browserContext.ftl +++ b/browser/locales/en-US/browser/browserContext.ftl @@ -298,10 +298,6 @@ main-context-menu-send-to-device = .label = Send Page to Device .accesskey = n -main-context-menu-view-background-image = - .label = View Background Image - .accesskey = w - main-context-menu-generate-new-password = .label = Use Generated Password… .accesskey = G diff --git a/dom/security/test/general/browser_test_view_image_data_navigation.js b/dom/security/test/general/browser_test_view_image_data_navigation.js index 19548b63aa0c..c75b773a5f73 100644 --- a/dom/security/test/general/browser_test_view_image_data_navigation.js +++ b/dom/security/test/general/browser_test_view_image_data_navigation.js @@ -50,10 +50,10 @@ add_task(async function test_right_click_open_bg_image() { true ); - // simulate right-click->view-bg-image + // simulate right-click->view-image BrowserTestUtils.waitForEvent(document, "popupshown", false, event => { // These are operations that must be executed synchronously with the event. - document.getElementById("context-viewbgimage").doCommand(); + document.getElementById("context-viewimage").doCommand(); event.target.hidePopup(); return true; }); @@ -67,7 +67,7 @@ add_task(async function test_right_click_open_bg_image() { let spec = gBrowser.selectedBrowser.currentURI.spec; ok( spec.startsWith("data:image/svg+xml;"), - "data:image/svg navigation allowed through right-click view-bg-image" + "data:image/svg navigation allowed through right-click view-image with background image" ); }); });