gecko-dev/testing/web-platform/tests/css/css-paint-api/parse-input-arguments-008.https.html
Yuki Shiino 0d8e2b4320 Bug 1530852 [wpt PR 15497] - v8binding: Make PaintWorkletGlobalScope use IDL callback function, a=testonly
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
2019-03-16 12:13:25 +00:00

49 lines
1.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('foo4', class {
static get inputProperties() {
return 42;
}
});
} catch(ex) {
// 'inputProperties' property is 42, not a sequence<DOMString>.
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>