Bug 1363428 - Skip element highlighting if there are no highlights, r=ato
MozReview-Commit-ID: 3rc4XnykV1S
--- 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;
}