Bug 1415307 - Stop sampling background colour in DOMContentLoaded. r?rbarker draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Tue, 07 Nov 2017 22:17:04 +0100
changeset 694516 72429046ee30710481e229f950629b37c87b5b1a
parent 694515 b01f863567e88d2ac3316196a16f56bcfa72b543
child 739352 7c41cf477f4e6ad634e35466071ea3c90a17a99d
push id88148
push usermozilla@buttercookie.de
push dateTue, 07 Nov 2017 21:18:13 +0000
reviewersrbarker
bugs1415307, 1297850
milestone58.0a1
Bug 1415307 - Stop sampling background colour in DOMContentLoaded. r?rbarker Bug 1297850 removed the only consumer of the background colour on the Java side, so this can go as well. MozReview-Commit-ID: DJwrUVUHZ1t
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4075,28 +4075,16 @@ Tab.prototype = {
     switch (aEvent.type) {
       case "DOMContentLoaded": {
         let target = aEvent.originalTarget;
 
         // ignore on frames and other documents
         if (target != this.browser.contentDocument)
           return;
 
-        // Sample the background color of the page and pass it along. (This is used to draw the
-        // checkerboard.) Right now we don't detect changes in the background color after this
-        // event fires; it's not clear that doing so is worth the effort.
-        var backgroundColor = null;
-        try {
-          let { contentDocument, contentWindow } = this.browser;
-          let computedStyle = contentWindow.getComputedStyle(contentDocument.body);
-          backgroundColor = computedStyle.backgroundColor;
-        } catch (e) {
-          // Ignore. Catching and ignoring exceptions here ensures that Talos succeeds.
-        }
-
         let docURI = target.documentURI;
         let errorType = "";
         if (docURI.startsWith("about:certerror")) {
           errorType = "certerror";
         }
         else if (docURI.startsWith("about:blocked")) {
           errorType = "blocked";
         }
@@ -4130,17 +4118,16 @@ Tab.prototype = {
         // pages have any privilege themselves.
         if (docURI.startsWith("about:neterror")) {
           NetErrorHelper.attachToBrowser(this.browser);
         }
 
         GlobalEventDispatcher.sendRequest({
           type: "Content:DOMContentLoaded",
           tabID: this.id,
-          bgColor: backgroundColor,
           errorType: errorType,
           metadata: this.metatags,
         });
 
         this.metatags = null;
 
         if (docURI.startsWith("about:certerror") || docURI.startsWith("about:blocked")) {
           this.browser.addEventListener("click", ErrorPageEventHandler, true);