Bug 1540396 - Remove Array.slice and Array.map from PageStyleChild.jsm. r=mconley
authorTom Schuster <evilpies@gmail.com>
Mon, 01 Apr 2019 18:02:16 +0000
changeset 467089 80fcea2e4efc22e871e4206675debca7cdc62664
parent 467088 0d5da6e22753f0995109072b4c3c0c76bb9f46e6
child 467090 e4aca7c222e604687247c1767c5dfbf6dd64fdfc
push id35795
push usercsabou@mozilla.com
push dateMon, 01 Apr 2019 21:54:51 +0000
treeherdermozilla-central@5a85cf971fef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1540396
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 1540396 - Remove Array.slice and Array.map from PageStyleChild.jsm. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D25543
browser/actors/PageStyleChild.jsm
--- a/browser/actors/PageStyleChild.jsm
+++ b/browser/actors/PageStyleChild.jsm
@@ -22,18 +22,18 @@ class PageStyleChild extends ActorChild 
         filteredStyleSheets,
         authorStyleDisabled: this.getViewer(content).authorStyleDisabled,
         preferredStyleSheetSet: content.document.preferredStyleSheetSet,
       });
     });
   }
 
   getAllStyleSheets(frameset) {
-    let selfSheets = Array.slice(frameset.document.styleSheets);
-    let subSheets = Array.map(frameset.frames, frame => this.getAllStyleSheets(frame));
+    let selfSheets = Array.from(frameset.document.styleSheets);
+    let subSheets = Array.from(frameset.frames, frame => this.getAllStyleSheets(frame));
     return selfSheets.concat(...subSheets);
   }
 
   receiveMessage(msg) {
     let content = msg.target.content;
     switch (msg.name) {
       case "PageStyle:Switch":
         this.getViewer(content).authorStyleDisabled = false;
@@ -78,17 +78,17 @@ class PageStyleChild extends ActorChild 
         docStyleSheet.disabled = (docStyleSheet.title != title);
       } else if (docStyleSheet.disabled) {
         docStyleSheet.disabled = false;
       }
     }
   }
 
   _stylesheetInFrame(frame, title) {
-    return Array.some(frame.document.styleSheets, (styleSheet) => styleSheet.title == title);
+    return Array.from(frame.document.styleSheets).some((styleSheet) => styleSheet.title == title);
   }
 
   _filterStyleSheets(styleSheets, content) {
     let result = [];
 
     for (let currentStyleSheet of styleSheets) {
       if (!currentStyleSheet.title)
         continue;