mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 21:28:04 +02:00
Automatic update from web-platform-tests [PW] Implement setTransform with DOMMatrix Right now the PaintRenderingContext2D::setTransform that takes a DOMMatrix would crash because it is NOTREACHED(). This CL implements that and add a layout test. Bug: 1029362 Change-Id: I1038dbe1bfcee14e128c46f73606fabcf3923caf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951566 Commit-Queue: Xida Chen <xidachen@chromium.org> Reviewed-by: Yi Gu <yigu@chromium.org> Cr-Commit-Position: refs/heads/master@{#723549} -- wpt-commits: 93281ec5a4c254d472eaaa988fb3859877a6ae13 wpt-pr: 20710
38 lines
899 B
HTML
38 lines
899 B
HTML
<!DOCTYPE html>
|
|
<title>setTransform with DOMMatrix behaves correctly</title>
|
|
<html class="reftest-wait">
|
|
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
|
|
<link rel="match" href="setTransform-ref.html">
|
|
<style>
|
|
.container {
|
|
width: 200px;
|
|
height: 200px;
|
|
}
|
|
|
|
#foo {
|
|
background: paint(foo);
|
|
}
|
|
</style>
|
|
<script src="/common/reftest-wait.js"></script>
|
|
<script src="/common/worklet-reftest.js"></script>
|
|
<body>
|
|
<div id="foo" class="container"></div>
|
|
|
|
<script id="code" type="text/worklet">
|
|
registerPaint('foo', class {
|
|
paint(ctx, geom) {
|
|
ctx.fillStyle = 'green';
|
|
let m = ctx.getTransform();
|
|
m.a = 2;
|
|
m.d = 2;
|
|
ctx.setTransform(m);
|
|
ctx.fillRect(0, 0, 50, 50);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
|
|
</script>
|
|
</body>
|
|
</html>
|