Bug 1430773 - The eyedropper should not copy colors as uppercase to the clipboard; r=pbro
authorabhinav <abhinav.koppula@gmail.com>
Thu, 18 Jan 2018 07:44:56 +0530
changeset 399786 822f8d3aff90d66d763e44269e30367338e5959c
parent 399785 27d2fb339f71592bf934a5ae2182d1eb2b8555b9
child 399808 683dbd9a3330d378a950134970e0c7d152f6e0d5
push id58280
push userpbrosset@mozilla.com
push dateThu, 18 Jan 2018 09:40:58 +0000
treeherderautoland@822f8d3aff90 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1430773
milestone59.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 1430773 - The eyedropper should not copy colors as uppercase to the clipboard; r=pbro 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));
 }