Bug 1207544 - Rename DPI to DPR in schreenshot gcli. r=jryans
authorJohan K. Jensen <jj@johanjensen.dk>
Wed, 23 Sep 2015 16:46:34 +0200
changeset 266920 4359a7f156274a4baca386c5338ef7320601d893
parent 266919 ea8b6281c4f4404e185d0beb361fc1855d2330ba
child 266921 741ee8870a8d5fd9e7f2df0bd013b823e539f5e7
push id66331
push userkwierso@gmail.com
push dateThu, 08 Oct 2015 21:35:51 +0000
treeherdermozilla-inbound@1a5167cd7688 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1207544
milestone44.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 1207544 - Rename DPI to DPR in schreenshot gcli. r=jryans
devtools/shared/gcli/commands/screenshot.js
toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties
--- a/devtools/shared/gcli/commands/screenshot.js
+++ b/devtools/shared/gcli/commands/screenshot.js
@@ -62,21 +62,21 @@ const standardParams = {
     {
       name: "delay",
       type: { name: "number", min: 0 },
       defaultValue: 0,
       description: l10n.lookup("screenshotDelayDesc"),
       manual: l10n.lookup("screenshotDelayManual")
     },
     {
-      name: "dpi",
+      name: "dpr",
       type: { name: "number", min: 0, allowFloat: true },
       defaultValue: 0,
-      description: l10n.lookup("screenshotDPIDesc"),
-      manual: l10n.lookup("screenshotDPIManual")
+      description: l10n.lookup("screenshotDPRDesc"),
+      manual: l10n.lookup("screenshotDPRManual")
     },
     {
       name: "fullpage",
       type: "boolean",
       description: l10n.lookup("screenshotFullPageDesc"),
       manual: l10n.lookup("screenshotFullPageManual")
     },
     {
@@ -288,17 +288,17 @@ function createScreenshotData(document, 
   const scrollbarHeight = {};
   const scrollbarWidth = {};
   winUtils.getScrollbarSize(false, scrollbarWidth, scrollbarHeight);
   width -= scrollbarWidth.value;
   height -= scrollbarHeight.value;
 
   const canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
   const ctx = canvas.getContext("2d");
-  const ratio = args.dpi ? args.dpi : window.devicePixelRatio;
+  const ratio = args.dpr ? args.dpr : window.devicePixelRatio;
   canvas.width = width * ratio;
   canvas.height = height * ratio;
   ctx.scale(ratio, ratio);
   ctx.drawWindow(window, left, top, width, height, "#fff");
   const data = canvas.toDataURL("image/png", "");
 
   // See comment above on bug 961832
   if (args.fullpage) {
--- a/toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties
+++ b/toolkit/locales/en-US/chrome/global/devtools/gclicommands.properties
@@ -91,25 +91,25 @@ screenshotAdvancedOptions=Advanced Optio
 # a dialog when the user is using this command.
 screenshotDelayDesc=Delay (seconds)
 
 # LOCALIZATION NOTE (screenshotDelayManual) A fuller description of the
 # 'delay' parameter to the 'screenshot' command, displayed when the user
 # asks for help on what it does.
 screenshotDelayManual=The time to wait (in seconds) before the screenshot is taken
 
-# LOCALIZATION NOTE (screenshotDPIDesc) A very short string to describe
-# the 'dpi' parameter to the 'screenshot' command, which is displayed in
+# LOCALIZATION NOTE (screenshotDPRDesc) A very short string to describe
+# the 'dpr' parameter to the 'screenshot' command, which is displayed in
 # a dialog when the user is using this command.
-screenshotDPIDesc=Dots per inch
+screenshotDPRDesc=Device pixel ratio
 
-# LOCALIZATION NOTE (screenshotDPIManual) A fuller description of the
-# 'dpi' parameter to the 'screenshot' command, displayed when the user
+# LOCALIZATION NOTE (screenshotDPRManual) A fuller description of the
+# 'dpr' parameter to the 'screenshot' command, displayed when the user
 # asks for help on what it does.
-screenshotDPIManual=The number of dots per inch in the screenshot
+screenshotDPRManual=The device pixel ratio to use when taking the screenshot
 
 # LOCALIZATION NOTE (screenshotFullscreenDesc) A very short string to describe
 # the 'fullscreen' parameter to the 'screenshot' command, which is displayed in
 # a dialog when the user is using this command.
 screenshotFullPageDesc=Entire webpage? (true/false)
 
 # LOCALIZATION NOTE (screenshotFullscreenManual) A fuller description of the
 # 'fullscreen' parameter to the 'screenshot' command, displayed when the user