aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2017-11-15 12:15:13 -0500
committerJosh Matthews <josh@joshmatthews.net>2017-11-15 12:47:30 -0500
commitc227604a2c79a247011a5d986a943a2ae911bab2 (patch)
tree01e72ba2a8a61b56fbbbb6f465e2a9a2c249bd89 /tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html
parent85fa6409bb699647b4f5e22952538365e87418d7 (diff)
downloadservo-c227604a2c79a247011a5d986a943a2ae911bab2.tar.gz
servo-c227604a2c79a247011a5d986a943a2ae911bab2.zip
Update web-platform-tests to revision 44702f2bc8ea98bc32b5b244f2fe63c6ce66d49d
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html')
-rw-r--r--tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html b/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html
new file mode 100644
index 00000000000..8d5b8d720a2
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-paint-api/parse-input-arguments-004.https.html
@@ -0,0 +1,49 @@
+<!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/css-paint-tests.js"></script>
+<body>
+<div id="canvas-geometry" class="container"></div>
+
+<script id="code" type="text/worklet">
+var testsPassed = false;
+try {
+ registerPaint('foo3', class {
+ static get inputArguments() {
+ return ['<length>'];
+ }
+ paint() { }
+ });
+ testsPassed = true;
+} catch(ex) {
+ testsPassed = false;
+}
+
+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>
+ importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent);
+</script>
+</body>
+</html>