https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 987da2edd8b2610e1ce46cc1b0053d6f903883f5 authored by Darren Shen on 19 March 2018, 00:26:33 UTC
[css-typed-om] Clean up CSSUnitValue tests.
Tip revision: 987da2e
2d.transformation.scale.zero.html
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.transformation.scale.zero</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/canvas-tests.js"></script>

<h1>2d.transformation.scale.zero</h1>
<p class="desc">scale() with a scale factor of zero works</p>


<script>
var t = async_test("scale() with a scale factor of zero works");
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
ctx.save();
ctx.translate(50, 0);
ctx.scale(0, 1);
ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 50);
ctx.restore();
ctx.save();
ctx.translate(0, 25);
ctx.scale(1, 0);
ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 50);
ctx.restore();
_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");

t.done();

});
</script>
back to top