Bug 1171614 - Remove the special path for data-URI images from the server inspector actor r=jdescottes
☠☠ backed out by b9cc2dcbf436 ☠ ☠
authorIan Moody <moz-ian@perix.co.uk>
Fri, 01 Jul 2016 18:28:36 +0100
changeset 304057 52434d177be3fd1dce4509b36d34b3a21c7d9223
parent 303880 c0e2702226bbb18cc6f907e0a6c41e2bc3727e74
child 304058 0dafaad484d42acb5f411b51c700e47ede4f0321
push id30411
push userkwierso@gmail.com
push dateFri, 08 Jul 2016 00:26:45 +0000
treeherdermozilla-central@23dc78b7b57e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1171614
milestone50.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 1171614 - Remove the special path for data-URI images from the server inspector actor r=jdescottes MozReview-Commit-ID: 2tWleM1wH1G
devtools/server/actors/inspector.js
--- a/devtools/server/actors/inspector.js
+++ b/devtools/server/actors/inspector.js
@@ -3023,32 +3023,25 @@ var imageToImageData = Task.async(functi
   let imgWidth = node.naturalWidth || node.width;
   let imgHeight = node.naturalHeight || node.height;
   let imgMax = Math.max(imgWidth, imgHeight);
   if (maxDim && imgMax > maxDim) {
     resizeRatio = maxDim / imgMax;
   }
 
   // Extract the image data
-  let imageData;
-  // The image may already be a data-uri, in which case, save ourselves the
-  // trouble of converting via the canvas.drawImage.toDataURL method
-  if (isImg && node.src.startsWith("data:")) {
-    imageData = node.src;
-  } else {
-    // Create a canvas to copy the rawNode into and get the imageData from
-    let canvas = node.ownerDocument.createElementNS(XHTML_NS, "canvas");
-    canvas.width = imgWidth * resizeRatio;
-    canvas.height = imgHeight * resizeRatio;
-    let ctx = canvas.getContext("2d");
-
-    // Copy the rawNode image or canvas in the new canvas and extract data
-    ctx.drawImage(node, 0, 0, canvas.width, canvas.height);
-    imageData = canvas.toDataURL("image/png");
-  }
+  // Create a canvas to copy the rawNode into and get the imageData from
+  let canvas = node.ownerDocument.createElementNS(XHTML_NS, "canvas");
+  canvas.width = imgWidth * resizeRatio;
+  canvas.height = imgHeight * resizeRatio;
+  let ctx = canvas.getContext("2d");
+
+  // Copy the rawNode image or canvas in the new canvas and extract data
+  ctx.drawImage(node, 0, 0, canvas.width, canvas.height);
+  let imageData = canvas.toDataURL("image/png");
 
   return {
     data: imageData,
     size: {
       naturalWidth: imgWidth,
       naturalHeight: imgHeight,
       resized: resizeRatio !== 1
     }