Commit 3b7e99d0 authored by Jérome Perrin's avatar Jérome Perrin

ui_test_core: workaround a bug with html2canvas calculating wrong box size

parent e0e636be
...@@ -258,7 +258,13 @@ Selenium.prototype.doVerifyImageMatchSnapshot = ( ...@@ -258,7 +258,13 @@ Selenium.prototype.doVerifyImageMatchSnapshot = (
var destinationCanvas = element.ownerDocument.createElement("canvas"); var destinationCanvas = element.ownerDocument.createElement("canvas");
destinationCanvas.width = element.scrollWidth; destinationCanvas.width = element.scrollWidth;
destinationCanvas.height = element.scrollHeight; destinationCanvas.height = element.scrollHeight;
canvasPromise = html2canvas(element, { canvas: destinationCanvas }); canvasPromise = html2canvas(element, {
canvas: destinationCanvas,
// XXX These are supposed to be the default values for width and height,
// but html2canvas sometimes calculate them wrongly.
width: element.scrollWidth,
height: element.scrollHeight,
});
} }
return wrapPromise( return wrapPromise(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment