Bug 1383886 - Remove redundant element.closest() call since one call to closest() can do the work that was previously done by two calls to closest() and a property check. r=Gijs
authorJared Wein <jwein@mozilla.com>
Mon, 24 Jul 2017 16:27:10 -0400
changeset 419398 a08e0db2d20ad641bcda99a7875afe8ce9e11b7c
parent 419397 6607cf5eb6837ecef3d0041fe479128529fffacc
child 419399 ac8d8ab529f23c2edc2d27a0deb0e296a521dee6
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1383886
milestone56.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 1383886 - Remove redundant element.closest() call since one call to closest() can do the work that was previously done by two calls to closest() and a property check. r=Gijs MozReview-Commit-ID: L6weawO4qB0
browser/extensions/pocket/content/main.js
--- a/browser/extensions/pocket/content/main.js
+++ b/browser/extensions/pocket/content/main.js
@@ -92,18 +92,17 @@ var pktUI = (function() {
         getPanelFrame().setAttribute("src", "about:blank");
 
         if (_lastAddSucceeded) {
             var libraryButton = document.getElementById("library-button");
             if (!Services.prefs.getBoolPref("toolkit.cosmeticAnimations.enabled") ||
                 !libraryButton ||
                 libraryButton.getAttribute("cui-areatype") == "menu-panel" ||
                 libraryButton.getAttribute("overflowedItem") == "true" ||
-                !libraryButton.closest("toolbar") ||
-                libraryButton.closest("toolbar").id != "nav-bar") {
+                !libraryButton.closest("#nav-bar")) {
                 return;
             }
             libraryButton.removeAttribute("fade");
             libraryButton.setAttribute("animate", "pocket");
             libraryButton.addEventListener("animationend", onLibraryButtonAnimationEnd);
         }
     }