mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 05:39:41 +02:00
Automatic update from web-platform-tests v8binding: Make PaintWorkletGlobalScope use IDL callback function Converts PaintWorkletGlobalScope.registerPaint's second argument |paintCtor| into IDL callback function type. Also, makes Paint Worklet use |PaintCallback| of callback function type. Change-Id: I6706499705a116c85f5c092a46309854db88708c Reviewed-on: https://chromium-review.googlesource.com/c/1478850 Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Hitoshi Yoshida <peria@chromium.org> Commit-Queue: Yuki Shiino <yukishiino@chromium.org> Cr-Commit-Position: refs/heads/master@{#634582} -- wpt-commits: 270d9bf4444b52a2d66dd10ade64cdfa455f2300 wpt-pr: 15497
45 lines
1 KiB
HTML
45 lines
1 KiB
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<link rel="match" href="parse-input-arguments-ref.html">
|
|
<style>
|
|
.container {
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
|
|
#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">
|
|
var testsPassed = false;
|
|
try {
|
|
registerPaint('', class { });
|
|
} catch(ex) {
|
|
// The empty string is not a valid name.
|
|
if (ex.name == 'TypeError')
|
|
testsPassed = true;
|
|
}
|
|
|
|
registerPaint('geometry', class {
|
|
paint(ctx, geom) {
|
|
if (testsPassed)
|
|
ctx.strokeStyle = 'green';
|
|
else
|
|
ctx.strokeStyle = 'red';
|
|
ctx.lineWidth = 4;
|
|
ctx.strokeRect(0, 0, geom.width, geom.height);
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script>
|
|
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
|
|
</script>
|
|
</body>
|
|
</html>
|