Backed out 4 changesets (bug 1550093) for browser_parsable_css.js failures
authorBogdan Tara <btara@mozilla.com>
Sat, 18 May 2019 03:56:20 +0300
changeset 536313 366a49e70140c78e213fe86b7616e2c8c88fc906
parent 536312 c0a07a2c5d0263b35ceb271c668a41256b959630
child 536314 2c73613d29c29e9301bfeab78b9c3b756eb30837
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)
bugs1550093
milestone68.0a1
backs out058d6d7a23a64ffc0051d2cc1ec6a78c3d050897
38cafbd4a35fc02e9c3b26f27338b7907878b6eb
510a686041bb31f70684c29a72e8a5f1163836b2
faf4415303fb85890222c1ca3b4a975ddd33b22a
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
Backed out 4 changesets (bug 1550093) for browser_parsable_css.js failures Backed out changeset 058d6d7a23a6 (bug 1550093) Backed out changeset 38cafbd4a35f (bug 1550093) Backed out changeset 510a686041bb (bug 1550093) Backed out changeset faf4415303fb (bug 1550093)
browser/components/aboutlogins/content/aboutLogins.ftl
browser/components/aboutlogins/content/aboutLogins.html
browser/components/aboutlogins/content/components/copy-to-clipboard-button.css
browser/components/aboutlogins/content/components/copy-to-clipboard-button.js
browser/components/aboutlogins/content/components/login-item.js
browser/components/aboutlogins/jar.mn
browser/components/aboutlogins/tests/browser/browser.ini
browser/components/aboutlogins/tests/browser/browser_copyToClipboardButton.js
--- a/browser/components/aboutlogins/content/aboutLogins.ftl
+++ b/browser/components/aboutlogins/content/aboutLogins.ftl
@@ -24,19 +24,15 @@ login-list =
 
 login-item =
   .cancel-button = Cancel
   .delete-button = Delete
   .edit-button = Edit
   .hostname-label = Website Address
   .modal-input-reveal-checkbox-hide = Hide password
   .modal-input-reveal-checkbox-show = Show password
-  .copied-password-button = ✓ Copied!
-  .copied-username-button = ✓ Copied!
-  .copy-password-button = Copy
-  .copy-username-button = Copy
   .open-site-button = Launch
   .password-label = Password
   .save-changes-button = Save Changes
   .time-created = Created: { DATETIME($timeCreated, day: "numeric", month: "long", year: "numeric") }
   .time-changed = Last changed: { DATETIME($timeChanged, day: "numeric", month: "long", year: "numeric") }
   .time-used = Last used: { DATETIME($timeUsed, day: "numeric", month: "long", year: "numeric") }
   .username-label = Username
--- a/browser/components/aboutlogins/content/aboutLogins.html
+++ b/browser/components/aboutlogins/content/aboutLogins.html
@@ -5,17 +5,16 @@
 <!DOCTYPE html>
 <html>
   <head>
     <meta charset="utf-8">
     <meta http-equiv="Content-Security-Policy" content="default-src 'none'; object-src 'none'; script-src resource: chrome:; connect-src https:; img-src https: data: blob:; style-src 'unsafe-inline';"/>
     <title data-l10n-id="about-logins-page-title"></title>
     <link rel="localization" href="browser/aboutLogins.ftl">
     <script defer="defer" src="chrome://browser/content/aboutlogins/components/reflected-fluent-element.js"></script>
-    <script defer="defer" src="chrome://browser/content/aboutlogins/components/copy-to-clipboard-button.js"></script>
     <script defer="defer" src="chrome://browser/content/aboutlogins/components/login-filter.js"></script>
     <script defer="defer" src="chrome://browser/content/aboutlogins/components/login-item.js"></script>
     <script defer="defer" src="chrome://browser/content/aboutlogins/components/login-list.js"></script>
     <script defer="defer" src="chrome://browser/content/aboutlogins/components/login-list-item.js"></script>
     <script defer="defer" src="chrome://browser/content/aboutlogins/components/modal-input.js"></script>
     <script defer="defer" src="chrome://browser/content/aboutlogins/aboutLogins.js"></script>
     <link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
     <link rel="stylesheet" href="chrome://browser/content/aboutlogins/aboutLogins.css">
@@ -27,20 +26,16 @@
                     data-l10n-attrs="placeholder"></login-filter>
     </header>
     <login-list data-l10n-id="login-list"
                 data-l10n-attrs="count"
                 data-l10n-args='{"count": 0}'></login-list>
     <login-item data-l10n-id="login-item"
                 data-l10n-args='{"timeCreated": 0, "timeChanged": 0, "timeUsed": 0}'
                 data-l10n-attrs="cancel-button,
-                                 copy-password-button,
-                                 copy-username-button,
-                                 copied-password-button,
-                                 copied-username-button,
                                  delete-button,
                                  edit-button,
                                  hostname-label,
                                  modal-input-reveal-checkbox-hide,
                                  modal-input-reveal-checkbox-show,
                                  open-site-button,
                                  password-label,
                                  save-changes-button,
@@ -81,24 +76,22 @@
         </label>
         <button class="open-site-button"></button>
       </div>
       <div class="detail-row">
         <label>
           <span class="username-label field-label"></span>
           <modal-input name="username"/>
         </label>
-        <copy-to-clipboard-button class="copy-username-button"></copy-to-clipboard-button>
       </div>
       <div class="detail-row">
         <label>
           <span class="password-label field-label"></span>
           <modal-input type="password" name="password"/>
         </label>
-        <copy-to-clipboard-button class="copy-password-button"></copy-to-clipboard-button>
       </div>
       <p class="time-created meta-info"></p>
       <p class="time-changed meta-info"></p>
       <p class="time-used meta-info"></p>
       <button class="save-changes-button"></button>
       <button class="cancel-button"></button>
     </template>
 
@@ -110,19 +103,10 @@
 
     <template id="modal-input-template">
       <link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
       <link rel="stylesheet" href="chrome://browser/content/aboutlogins/components/modal-input.css">
       <span class="locked-value"></span>
       <input type="text" class="unlocked-value"/>
       <input type="checkbox" class="reveal-checkbox"/>
     </template>
-
-    <template id="copy-to-clipboard-button-template">
-      <link rel="stylesheet" href="chrome://global/skin/in-content/common.css">
-      <link rel="stylesheet" href="chrome://browser/content/aboutlogins/components/copy-to-clipboard-button.css">
-      <button class="copy-button">
-        <span class="copied-button-text"></span>
-        <span class="copy-button-text"></span>
-      </button>
-    </template>
   </body>
 </html>
deleted file mode 100644
--- a/browser/components/aboutlogins/content/components/copy-to-clipboard-button.css
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 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/. */
-
-:host {
-  --success-color: #00c100;
-}
-
-@supports -moz-bool-pref("browser.in-content.dark-mode") {
-@media (prefers-color-scheme: dark) {
-  :host {
-    --success-color: #86DE74;
-  }
-}
-}
-
-:host(:not([copied])) .copied-button-text,
-:host([copied]) .copy-button-text {
-  display: none;
-}
-
-:host([copied]) {
-  color: var(--success-color);
-}
-
-:host([copied]) button {
-  background-color: transparent;
-  opacity: 1; /* override common.css fading out disabled buttons */
-}
deleted file mode 100644
--- a/browser/components/aboutlogins/content/components/copy-to-clipboard-button.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* 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/. */
-
-/* globals ReflectedFluentElement */
-
-class CopyToClipboardButton extends ReflectedFluentElement {
-  static get BUTTON_RESET_TIMEOUT() {
-    return 5000;
-  }
-
-  constructor() {
-    super();
-
-    this._relatedInput = null;
-  }
-
-  connectedCallback() {
-    if (this.children.length) {
-      return;
-    }
-
-    let CopyToClipboardButtonTemplate = document.querySelector("#copy-to-clipboard-button-template");
-    this.attachShadow({mode: "open"})
-        .appendChild(CopyToClipboardButtonTemplate.content.cloneNode(true));
-
-    this.shadowRoot.querySelector(".copy-button").addEventListener("click", this);
-  }
-
-  static get reflectedFluentIDs() {
-    return ["copy-button-text", "copied-button-text"];
-  }
-
-  static get observedAttributes() {
-    return CopyToClipboardButton.reflectedFluentIDs;
-  }
-
-  handleSpecialCaseFluentString(attrName) {
-    if (attrName != "copied-button-text" &&
-        attrName != "copy-button-text") {
-      return false;
-    }
-
-    let span = this.shadowRoot.querySelector("." + attrName);
-    span.textContent = this.getAttribute(attrName);
-    return true;
-  }
-
-  handleEvent(event) {
-    let copyButton = this.shadowRoot.querySelector(".copy-button");
-    if (event.type != "click" || event.currentTarget != copyButton) {
-      return;
-    }
-
-    copyButton.disabled = true;
-    navigator.clipboard.writeText(this._relatedInput.value).then(() => {
-      this.setAttribute("copied", "");
-      setTimeout(() => {
-        copyButton.disabled = false;
-        this.removeAttribute("copied");
-      }, CopyToClipboardButton.BUTTON_RESET_TIMEOUT);
-    }, () => copyButton.disabled = false);
-  }
-
-  set relatedInput(val) {
-    this._relatedInput = val;
-  }
-}
-customElements.define("copy-to-clipboard-button", CopyToClipboardButton);
--- a/browser/components/aboutlogins/content/components/login-item.js
+++ b/browser/components/aboutlogins/content/components/login-item.js
@@ -18,45 +18,34 @@ class LoginItem extends ReflectedFluentE
 
     let loginItemTemplate = document.querySelector("#login-item-template");
     this.attachShadow({mode: "open"})
         .appendChild(loginItemTemplate.content.cloneNode(true));
 
     this.reflectFluentStrings();
 
     for (let selector of [
-      ".copy-password-button",
-      ".copy-username-button",
       ".delete-button",
       ".edit-button",
       ".open-site-button",
       ".save-changes-button",
       ".cancel-button",
     ]) {
       let button = this.shadowRoot.querySelector(selector);
       button.addEventListener("click", this);
     }
 
     window.addEventListener("AboutLoginsLoginSelected", this);
 
-    let copyUsernameButton = this.shadowRoot.querySelector(".copy-username-button");
-    let copyPasswordButton = this.shadowRoot.querySelector(".copy-password-button");
-    copyUsernameButton.relatedInput = this.shadowRoot.querySelector("modal-input[name='username']");
-    copyPasswordButton.relatedInput = this.shadowRoot.querySelector("modal-input[name='password']");
-
     this.render();
   }
 
   static get reflectedFluentIDs() {
     return [
       "cancel-button",
-      "copied-password-button",
-      "copied-username-button",
-      "copy-password-button",
-      "copy-username-button",
       "delete-button",
       "edit-button",
       "hostname-label",
       "modal-input-reveal-checkbox-hide",
       "modal-input-reveal-checkbox-show",
       "open-site-button",
       "password-label",
       "save-changes-button",
@@ -68,30 +57,16 @@ class LoginItem extends ReflectedFluentE
   }
 
   static get observedAttributes() {
     return this.reflectedFluentIDs;
   }
 
   handleSpecialCaseFluentString(attrName) {
     switch (attrName) {
-      case "copied-password-button":
-      case "copy-password-button": {
-        let copyPasswordButton = this.shadowRoot.querySelector(".copy-password-button");
-        let newAttrName = attrName.substr(0, attrName.indexOf("-")) + "-button-text";
-        copyPasswordButton.setAttribute(newAttrName, this.getAttribute(attrName));
-        break;
-      }
-      case "copied-username-button":
-      case "copy-username-button": {
-        let copyUsernameButton = this.shadowRoot.querySelector(".copy-username-button");
-        let newAttrName = attrName.substr(0, attrName.indexOf("-")) + "-button-text";
-        copyUsernameButton.setAttribute(newAttrName, this.getAttribute(attrName));
-        break;
-      }
       case "modal-input-reveal-checkbox-hide": {
         this.shadowRoot.querySelector("modal-input[name='password']")
                        .setAttribute("reveal-checkbox-hide", this.getAttribute(attrName));
         break;
       }
       case "modal-input-reveal-checkbox-show": {
         this.shadowRoot.querySelector("modal-input[name='password']")
                        .setAttribute("reveal-checkbox-show", this.getAttribute(attrName));
@@ -124,22 +99,16 @@ class LoginItem extends ReflectedFluentE
         break;
       }
       case "click": {
         if (event.target.classList.contains("cancel-button")) {
           this.toggleEditing();
           this.render();
           return;
         }
-        if (event.target.classList.contains("copy-password-button")) {
-          return;
-        }
-        if (event.target.classList.contains("copy-username-button")) {
-          return;
-        }
         if (event.target.classList.contains("delete-button")) {
           document.dispatchEvent(new CustomEvent("AboutLoginsDeleteLogin", {
             bubbles: true,
             detail: this._login,
           }));
           return;
         }
         if (event.target.classList.contains("edit-button")) {
--- a/browser/components/aboutlogins/jar.mn
+++ b/browser/components/aboutlogins/jar.mn
@@ -1,15 +1,13 @@
 # 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/.
 
 browser.jar:
-  content/browser/aboutlogins/components/copy-to-clipboard-button.css (content/components/copy-to-clipboard-button.css)
-  content/browser/aboutlogins/components/copy-to-clipboard-button.js  (content/components/copy-to-clipboard-button.js)
   content/browser/aboutlogins/components/login-filter.css      (content/components/login-filter.css)
   content/browser/aboutlogins/components/login-filter.js       (content/components/login-filter.js)
   content/browser/aboutlogins/components/login-item.css        (content/components/login-item.css)
   content/browser/aboutlogins/components/login-item.js         (content/components/login-item.js)
   content/browser/aboutlogins/components/login-list.css        (content/components/login-list.css)
   content/browser/aboutlogins/components/login-list.js         (content/components/login-list.js)
   content/browser/aboutlogins/components/login-list-item.css   (content/components/login-list-item.css)
   content/browser/aboutlogins/components/login-list-item.js    (content/components/login-list-item.js)
--- a/browser/components/aboutlogins/tests/browser/browser.ini
+++ b/browser/components/aboutlogins/tests/browser/browser.ini
@@ -1,9 +1,8 @@
 [DEFAULT]
 prefs =
   signon.management.page.enabled=true
 
-[browser_copyToClipboardButton.js]
 [browser_deleteLogin.js]
 [browser_loginListChanges.js]
 [browser_openSite.js]
 [browser_updateLogin.js]
deleted file mode 100644
--- a/browser/components/aboutlogins/tests/browser/browser_copyToClipboardButton.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(async function test() {
-  await SpecialPowers.pushPrefEnv({"set": [["dom.events.testing.asyncClipboard", true]] });
-
-  await BrowserTestUtils.withNewTab({gBrowser, url: "about:logins"}, async function(browser) {
-    let TEST_LOGIN = {
-      guid: "70a",
-      username: "jared",
-      password: "deraj",
-      hostname: "https://www.example.com",
-    };
-
-    await ContentTask.spawn(browser, TEST_LOGIN, async function(login) {
-      let loginItem = Cu.waiveXrays(content.document.querySelector("login-item"));
-
-      // The login object needs to be cloned into the content global.
-      loginItem.setLogin(Cu.cloneInto(login, content));
-
-      // Lower the timeout for the test.
-      let copyButton = loginItem.shadowRoot.querySelector(".copy-username-button");
-      Object.defineProperty(copyButton.constructor, "BUTTON_RESET_TIMEOUT", {
-          configurable: true,
-          writable: true,
-          value: 1000,
-      });
-    });
-
-    for (let testCase of [
-      [TEST_LOGIN.username, ".copy-username-button"],
-      [TEST_LOGIN.password, ".copy-password-button"],
-    ]) {
-      let testObj = {
-        expectedValue: testCase[0],
-        copyButtonSelector: testCase[1],
-      };
-      await SimpleTest.promiseClipboardChange(testObj.expectedValue, async () => {
-        await ContentTask.spawn(browser, testObj, async function(aTestObj) {
-          let loginItem = content.document.querySelector("login-item");
-          let copyButton = loginItem.shadowRoot.querySelector(aTestObj.copyButtonSelector);
-          let innerButton = copyButton.shadowRoot.querySelector("button");
-          info("Clicking 'copy' button");
-          innerButton.click();
-        });
-      });
-      ok(true, "Username is on clipboard now");
-
-      await ContentTask.spawn(browser, testObj, async function(aTestObj) {
-        let loginItem = content.document.querySelector("login-item");
-        let copyButton = loginItem.shadowRoot.querySelector(aTestObj.copyButtonSelector);
-        ok(copyButton.hasAttribute("copied"), "Success message should be shown");
-        await ContentTaskUtils.waitForCondition(() => !copyButton.hasAttribute("copied"),
-          "'copied' attribute should be removed after a timeout");
-      });
-    }
-  });
-});