Bug 1430773 - The eyedropper should not copy colors as uppercase to the clipboard; r=nchevobbe
MozReview-Commit-ID: 8ShdtDuTKfr
--- 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));
}