Bug 1363428 - Skip element highlighting if there are no highlights, r=ato draft
authorJames Graham <james@hoppipolla.co.uk>
Tue, 09 May 2017 17:26:45 +0100
changeset 600207 dd220667cbf6dd9e2701306502161dc1058c4bd1
parent 600206 477ef51adf854e5a3f498e2d9b5647ae54da202e
child 600208 5d4eb99c56ec840b17ddde6fcd95c2daaddd927a
push id65688
push userbmo:james@hoppipolla.co.uk
push dateSat, 24 Jun 2017 11:04:46 +0000
reviewersato
bugs1363428
milestone56.0a1
Bug 1363428 - Skip element highlighting if there are no highlights, r=ato MozReview-Commit-ID: 3rc4XnykV1S
testing/marionette/capture.js
--- a/testing/marionette/capture.js
+++ b/testing/marionette/capture.js
@@ -117,17 +117,19 @@ capture.canvas = function (win, left, to
     // Needs https://github.com/w3c/web-platform-tests/issues/4383 fixed.
     // ctx.DRAWWINDOW_DRAW_VIEW;
     // Bug 1009762 - Crash in [@ mozilla::gl::ReadPixelsIntoDataSurface]
     // ctx.DRAWWINDOW_USE_WIDGET_LAYERS;
    }
 
   ctx.scale(scale, scale);
   ctx.drawWindow(win, left, top, width, height, BG_COLOUR, flags);
-  ctx = capture.highlight_(ctx, highlights, top, left);
+  if (highlights.length) {
+    ctx = capture.highlight_(ctx, highlights, top, left);
+  }
 
   return canvas;
 };
 
 capture.highlight_ = function (context, highlights, top = 0, left = 0) {
   if (!highlights) {
     return;
   }