Bug 1430773 - The eyedropper should not copy colors as uppercase to the clipboard; r=nchevobbe draft
authorabhinav <abhinav.koppula@gmail.com>
Thu, 18 Jan 2018 07:44:56 +0530
changeset 721901 a960d10c4f00ef9141c3792a343e0408baddeb26
parent 721495 4e429d313fd2e0f9202271ee8f3fb798817ec3e7
child 746477 eeb8c4230903670b5491e97c0797f634f55291b5
push id95992
push userbmo:abhinav.koppula@gmail.com
push dateThu, 18 Jan 2018 02:15:28 +0000
reviewersnchevobbe
bugs1430773
milestone59.0a1
Bug 1430773 - The eyedropper should not copy colors as uppercase to the clipboard; r=nchevobbe MozReview-Commit-ID: 8ShdtDuTKfr
devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js
devtools/server/actors/highlighters/eye-dropper.js
--- a/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js
+++ b/devtools/client/inspector/test/browser_inspector_highlighter-eyedropper-clipboard.js
@@ -21,17 +21,17 @@ add_task(function* () {
   yield show("html", {copyOnSelect: true});
 
   info("Make sure to wait until the eyedropper is done taking a screenshot of the page");
   yield waitForElementAttributeSet("root", "drawn", helper);
 
   yield waitForClipboardPromise(() => {
     info("Activate the eyedropper so the background color is copied");
     EventUtils.synthesizeKey("VK_RETURN", {});
-  }, "#FF0000");
+  }, "#ff0000");
 
   ok(true, "The clipboard contains the right value");
 
   yield waitForElementAttributeRemoved("root", "drawn", helper);
   yield waitForElementAttributeSet("root", "hidden", helper);
   ok(true, "The eyedropper is now hidden");
 
   finalize();
--- a/devtools/server/actors/highlighters/eye-dropper.js
+++ b/devtools/server/actors/highlighters/eye-dropper.js
@@ -519,14 +519,14 @@ function toColorString(rgb, format) {
 
 /**
  * Produce a hex-formatted color string from rgb values.
  * @param {array} rgb Rgb values of color to stringify.
  * @return {string} Hex formatted string for color, e.g. "#FFEE00".
  */
 function hexString([r, g, b]) {
   let val = (1 << 24) + (r << 16) + (g << 8) + (b << 0);
-  return "#" + val.toString(16).substr(-6).toUpperCase();
+  return "#" + val.toString(16).substr(-6);
 }
 
 function cap(value, min, max) {
   return Math.max(min, Math.min(value, max));
 }