mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Automatic update from web-platform-tests Fix a wrong paint worklet layout test expectation There are actually two problems in this test: 1. The expectation file is wrong, when canvas context.fillRect takes int as size, not '50px'. 2. The test file needs parseInt to convert string to it. This CL fixes the test. Bug: 1096078 Change-Id: I01e6a753d3d9772a39dfacfe8b87f80b6f877b88 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254449 Reviewed-by: Kevin Ellis <[email protected]> Commit-Queue: Xida Chen <[email protected]> Cr-Commit-Position: refs/heads/master@{#780773} -- wpt-commits: 2e70a19bfdd6fdb76924f2673f9f7086fe607d29 wpt-pr: 24253
40 lines
799 B
HTML
40 lines
799 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
#background {
|
|
background-color: yellow;
|
|
display: inline-block;
|
|
}
|
|
|
|
.container {
|
|
font-size: 0px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="background">
|
|
<div class="container">
|
|
<canvas id ="box-1" width="200" height="200"></canvas>
|
|
</div>
|
|
<div class="container">
|
|
<canvas id ="box-2" width="200" height="200"></canvas>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function drawCanvas(canvasID, color, width) {
|
|
var canvas = document.getElementById(canvasID);
|
|
var context = canvas.getContext("2d", {alpha: true});
|
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
|
context.fillStyle = color;
|
|
context.fillRect(40, 40, width, width);
|
|
};
|
|
|
|
drawCanvas('box-1', 'rgb(50, 100, 150)', '50');
|
|
drawCanvas('box-2', 'rgb(150, 100, 50)', '100');
|
|
</script>
|
|
</body>
|
|
</html>
|