mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update web-platform-tests to revision 0b22439430b6d8d9a6d43a0908e86c0366f207c0
This commit is contained in:
parent
39ec04a065
commit
c8e806d0ef
93 changed files with 2118 additions and 597 deletions
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<canvas id ="canvas" width="540" height="550"></canvas>
|
||||
<script>
|
||||
var canvas = document.getElementById('canvas');
|
||||
canvas.style.width = (canvas.width / devicePixelRatio) + 'px';
|
||||
canvas.style.height = (canvas.height / devicePixelRatio) + 'px';
|
||||
var ctx = canvas.getContext("2d");
|
||||
ctx.scale(devicePixelRatio, devicePixelRatio);
|
||||
var fillW = 250;
|
||||
var fillH = 50;
|
||||
ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 100);
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, fillW, fillH);
|
||||
ctx.closePath();
|
||||
ctx.clip();
|
||||
ctx.fillStyle = 'green';
|
||||
ctx.fillRect(0, 0, fillW, fillH);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/#dom-css-paintworklet">
|
||||
<link rel="match" href="canvas-transform-ref.html">
|
||||
<style>
|
||||
.container {
|
||||
width: 270px;
|
||||
height: 275px;
|
||||
}
|
||||
|
||||
#canvas-geometry {
|
||||
background-image: paint(geometry);
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
<body>
|
||||
<div id="canvas-geometry" class="container"></div>
|
||||
|
||||
<script id="code" type="text/worklet">
|
||||
// Regression test for crbug.com/970783. The canvas transform matrix should
|
||||
// account for the devicePixelRatio, such that the clip bounds can be
|
||||
// properly computed when applying clips.
|
||||
registerPaint('geometry', class {
|
||||
paint(ctx, geom) {
|
||||
var fillW = 250;
|
||||
var fillH = 50;
|
||||
ctx.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 100);
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, fillW, fillH);
|
||||
ctx.closePath();
|
||||
ctx.clip();
|
||||
ctx.fillStyle = 'green';
|
||||
ctx.fillRect(0, 0, fillW, fillH);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue