Bug 1405288 - Remove pickColorFromPage actor method check from then inspector draft
authorPatrick Brosset <pbrosset@mozilla.com>
Thu, 19 Oct 2017 11:20:57 +0200
changeset 701121 f0dfdd63e2d01268cbc5910e051d8f6cdb576355
parent 701120 6788eb6f74a47eb5a5515034b7bce9503f06d793
child 741096 13b893fe93cab9bc26335aa61a196dd6a544a1ba
push id90078
push userbmo:pbrosset@mozilla.com
push dateTue, 21 Nov 2017 08:39:27 +0000
bugs1405288, 1262439
milestone59.0a1
Bug 1405288 - Remove pickColorFromPage actor method check from then inspector This method was added in bug 1262439 last year, and shipped with FF50. We support all the way back to the latest ESR (52 now). So let's remove the backward compat code for this method. MozReview-Commit-ID: LUL7FFWWC5M
devtools/client/inspector/inspector.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -833,30 +833,28 @@ Inspector.prototype = {
    *
    * @return {Boolean} true if the eyedropper highlighter is supported by the current
    *         document.
    */
   supportsEyeDropper: Task.async(function* () {
     try {
       let hasSupportsHighlighters =
         yield this.target.actorHasMethod("inspector", "supportsHighlighters");
-      let hasPickColorFromPage =
-        yield this.target.actorHasMethod("inspector", "pickColorFromPage");
 
       let supportsHighlighters;
       if (hasSupportsHighlighters) {
         supportsHighlighters = yield this.inspector.supportsHighlighters();
       } else {
         // If the actor does not provide the supportsHighlighter method, fallback to
         // check if the selected node's document is a HTML document.
         let { nodeFront } = this.selection;
         supportsHighlighters = nodeFront && nodeFront.isInHTMLDocument;
       }
 
-      return supportsHighlighters && hasPickColorFromPage;
+      return supportsHighlighters;
     } catch (e) {
       console.error(e);
       return false;
     }
   }),
 
   setupToolbar: Task.async(function* () {
     this.teardownToolbar();
@@ -1698,18 +1696,17 @@ Inspector.prototype = {
                          .catch(console.error);
   },
 
   /**
    * Hide the eyedropper.
    * @return {Promise} resolves when the eyedropper is hidden.
    */
   hideEyeDropper: function () {
-    // The eyedropper button doesn't exist, most probably because the actor doesn't
-    // support the pickColorFromPage, or because the page isn't HTML.
+    // The eyedropper button doesn't exist, most probably  because the page isn't HTML.
     if (!this.eyeDropperButton) {
       return null;
     }
 
     this.eyeDropperButton.classList.remove("checked");
     this.stopEyeDropperListeners();
     return this.inspector.cancelPickColorFromPage()
                          .catch(console.error);