Bug 1550521 - Remove private browsing help message with settings hidden r=jaws
authorMark Striemer <mstriemer@mozilla.com>
Tue, 14 May 2019 17:36:10 +0000
changeset 535696 01fcbba06f1c5a79a6881c4a4378b0bd2476e22e
parent 535695 e1437ba34a4afff6cee82968503144f15e9e1949
child 535697 f1ace2853a4c8e42c77eea943f2938147a111118
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1550521
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 1550521 - Remove private browsing help message with settings hidden r=jaws Differential Revision: https://phabricator.services.mozilla.com/D30747
toolkit/mozapps/extensions/content/aboutaddons.css
toolkit/mozapps/extensions/content/aboutaddons.html
toolkit/mozapps/extensions/content/aboutaddons.js
toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js
--- a/toolkit/mozapps/extensions/content/aboutaddons.css
+++ b/toolkit/mozapps/extensions/content/aboutaddons.css
@@ -253,26 +253,29 @@ addon-details {
   justify-content: space-between;
   align-items: center;
   border-top: 1px solid var(--grey-90-a20);
   margin: 0 calc(var(--card-padding) * -1);
   padding: var(--card-padding);
   color: var(--grey-90);
 }
 
+.addon-detail-row.addon-detail-help-row {
+  display: block;
+  color: var(--grey-60);
+  padding-top: 4px;
+  padding-bottom: var(--card-padding);
+  border: none;
+}
+
 .addon-detail-row-has-help,
 .addon-detail-row:last-of-type {
   padding-bottom: 0;
 }
 
-.addon-detail-row-help {
-  color: var(--grey-60);
-  padding-bottom: var(--card-padding);
-}
-
 .addon-detail-row input[type="checkbox"] {
   margin: 0;
 }
 
 .addon-detail-rating {
   display: flex;
 }
 
--- a/toolkit/mozapps/extensions/content/aboutaddons.html
+++ b/toolkit/mozapps/extensions/content/aboutaddons.html
@@ -120,17 +120,17 @@
             <span data-l10n-id="addon-detail-private-browsing-allow"></span>
           </label>
           <label>
             <input type="radio" name="private-browsing" value="0"/>
             <span data-l10n-id="addon-detail-private-browsing-disallow"></span>
           </label>
         </div>
       </div>
-      <div class="addon-detail-row-help" data-l10n-id="addon-detail-private-browsing-help">
+      <div class="addon-detail-row addon-detail-help-row" data-l10n-id="addon-detail-private-browsing-help">
         <a target="_blank" data-l10n-name="learn-more"></a>
       </div>
       <div class="addon-detail-row addon-detail-row-author">
         <label data-l10n-id="addon-detail-author-label"></label>
       </div>
       <div class="addon-detail-row addon-detail-row-version">
         <label data-l10n-id="addon-detail-version-label"></label>
       </div>
--- a/toolkit/mozapps/extensions/content/aboutaddons.js
+++ b/toolkit/mozapps/extensions/content/aboutaddons.js
@@ -744,16 +744,19 @@ class AddonDetails extends HTMLElement {
     if (!allowPrivateBrowsingByDefault && addon.type == "extension" &&
         addon.incognito != "not_allowed") {
       let isAllowed = await isAllowedInPrivateBrowsing(addon);
       pbRow.querySelector(`[value="${isAllowed ? 1 : 0}"]`).checked = true;
       let learnMore = pbRow.nextElementSibling
         .querySelector('a[data-l10n-name="learn-more"]');
       learnMore.href = SUPPORT_URL + "extensions-pb";
     } else {
+      // Remove the help row, which is right after the settings.
+      pbRow.nextElementSibling.remove();
+      // Then remove the actual settings.
       pbRow.remove();
     }
 
     // Author.
     let creatorRow = this.querySelector(".addon-detail-row-author");
     if (addon.creator) {
       let creator;
       if (addon.creator.url) {
--- a/toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js
@@ -303,16 +303,23 @@ add_task(async function testFullDetails(
   ];
   let options = row.lastElementChild.querySelectorAll("label");
   checkOptions(doc, options, expectedOptions);
 
   // Private browsing, functionality checked in another test.
   row = rows.shift();
   checkLabel(row, "private-browsing");
 
+  // Private browsing help text.
+  row = rows.shift();
+  ok(row.classList.contains("addon-detail-help-row"), "There's a help row");
+  ok(!row.hidden, "The help row is shown");
+  is(doc.l10n.getAttributes(row).id, "addon-detail-private-browsing-help",
+     "The help row is for private browsing");
+
   // Author.
   row = rows.shift();
   checkLabel(row, "author");
   let link = row.querySelector("a");
   checkLink(link, "http://example.com/me", "The creator");
 
   // Version.
   row = rows.shift();
@@ -396,19 +403,27 @@ add_task(async function testMinimalExten
   ok(!contrib, "There is no contribution element");
 
   let rows = Array.from(details.querySelectorAll(".addon-detail-row"));
 
   // Automatic updates.
   let row = rows.shift();
   checkLabel(row, "updates");
 
+  // Private browsing settings.
   row = rows.shift();
   checkLabel(row, "private-browsing");
 
+  // Private browsing help text.
+  row = rows.shift();
+  ok(row.classList.contains("addon-detail-help-row"), "There's a help row");
+  ok(!row.hidden, "The help row is shown");
+  is(doc.l10n.getAttributes(row).id, "addon-detail-private-browsing-help",
+     "The help row is for private browsing");
+
   // Author.
   row = rows.shift();
   checkLabel(row, "author");
   let text = row.lastChild;
   is(text.textContent, "I made it", "The author is set");
   ok(text instanceof Text, "The author is a text node");
 
   is(rows.length, 0, "There are no more rows");