Implemented the plumbing for paint worklets.

This commit is contained in:
Alan Jeffrey 2017-04-03 14:35:57 -05:00
parent 7e273d6c9b
commit fd17dcd604
23 changed files with 600 additions and 156 deletions

View file

@ -6736,6 +6736,18 @@
],
{}
]
],
"mozilla/worklets/test_paint_worklet.html": [
[
"/_mozilla/mozilla/worklets/test_paint_worklet.html",
[
[
"/_mozilla/mozilla/worklets/test_paint_worklet_ref.html",
"=="
]
],
{}
]
]
},
"reftest_node": {
@ -11208,6 +11220,16 @@
{}
]
],
"mozilla/worklets/test_paint_worklet.js": [
[
{}
]
],
"mozilla/worklets/test_paint_worklet_ref.html": [
[
{}
]
],
"mozilla/worklets/test_worklet.js": [
[
{}
@ -31775,6 +31797,18 @@
"f3a9b8c78346507bc0b3190c8000ccf80cc133f6",
"support"
],
"mozilla/worklets/test_paint_worklet.html": [
"67fccbde17c28e13b5f4dc54d70b1279d6e9d602",
"reftest"
],
"mozilla/worklets/test_paint_worklet.js": [
"e714db50da9e5cb18c652629fcc1b5ccc453564d",
"support"
],
"mozilla/worklets/test_paint_worklet_ref.html": [
"e9cfa945824a8ecf07c41a269f82a2c2ca002406",
"support"
],
"mozilla/worklets/test_worklet.html": [
"fe9c93a5307c616f878b6623155e1b04c86dd994",
"testharness"

View file

@ -0,0 +1,4 @@
[test_paint_worklet.html]
type: reftest
expected: FAIL

View file

@ -0,0 +1,18 @@
<!doctype html>
<html class="reftest-wait">
<head>
<meta charset=utf-8>
<title>A basic paint worklet test</title>
<link rel=match href=/_mozilla/mozilla/worklets/test_paint_worklet_ref.html>
</head>
<body>
<div style="height: 100px; width: 100px; background: paint(test);"></div>
</body>
<script>
// This reftest will TIMEOUT if loading the paint worklet fails,
// It will PASS if the worklet draws a green rectangle.
window.paintWorklet
.addModule("test_paint_worklet.js")
.then(function() { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>

View file

@ -0,0 +1,6 @@
registerPaint("test", class {
paint(ctx, size) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, size.width, size.height);
}
});

View file

@ -0,0 +1,6 @@
<!doctype html>
<html>
<body>
<div style="height: 100px; width: 100px; background: green;"></div>
</body>
</html>