Bug 1550529 - Load tabprompts.css as document stylesheet in the XUL about:addons page. r=jaws
authorLuca Greco <lgreco@mozilla.com>
Mon, 13 May 2019 20:29:48 +0000
changeset 473658 e3fc2a2d52de73e82fbf2fe0d4de1afed118d056
parent 473657 f8d305fa503b24a1a965a6dd02c6ee2a3cdfd258
child 473659 5d66a70eebdbe0e8cbd592350741cfcab1420b0d
push id36009
push userapavel@mozilla.com
push dateTue, 14 May 2019 04:07:34 +0000
treeherdermozilla-central@96563508f9fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1550529
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1550529 - Load tabprompts.css as document stylesheet in the XUL about:addons page. r=jaws Differential Revision: https://phabricator.services.mozilla.com/D30655
browser/components/extensions/test/browser/browser_ext_optionsPage_modals.js
toolkit/mozapps/extensions/content/extensions.xul
--- a/browser/components/extensions/test/browser/browser_ext_optionsPage_modals.js
+++ b/browser/components/extensions/test/browser/browser_ext_optionsPage_modals.js
@@ -74,18 +74,23 @@ add_task(async function test_tab_options
   // be the parent of the currently selected tabbrowser's browser.
   if (optionsBrowser.isRemoteBrowser) {
     stack = optionsBrowser.parentNode;
   } else {
     stack = gBrowser.selectedBrowser.parentNode;
   }
 
   let dialogs = stack.querySelectorAll("tabmodalprompt");
+  Assert.equal(dialogs.length, 1, "Expect a tab modal opened for the about addons tab");
 
-  Assert.equal(dialogs.length, 1, "Expect a tab modal opened for the about addons tab");
+  // Verify that the expected stylesheets have been applied on the
+  // tabmodalprompt element (See Bug 1550529).
+  const tabmodalStyle = dialogs[0].ownerGlobal.getComputedStyle(dialogs[0]);
+  is(tabmodalStyle["background-color"], "rgba(26, 26, 26, 0.5)",
+     "Got the expected styles applied to the tabmodalprompt");
 
   info("Close the tab modal prompt");
   dialogs[0].querySelector(".tabmodalprompt-button0").click();
 
   await extension.awaitFinish("options-ui-modals");
 
   Assert.equal(stack.querySelectorAll("tabmodalprompt").length, 0,
                "Expect the tab modal to be closed");
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -2,16 +2,20 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://mozapps/content/extensions/extensions.css"?>
 <?xml-stylesheet href="chrome://mozapps/skin/extensions/extensions.css"?>
 
+<!-- Used for the modals related to the inline options_page XUL browser -->
+<?xml-stylesheet href="chrome://global/content/tabprompts.css" type="text/css"?>
+<?xml-stylesheet href="chrome://global/skin/tabprompts.css" type="text/css"?>
+
 <!DOCTYPE page [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
 %brandDTD;
 <!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
 %extensionsDTD;
 ]>
 
 <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"