mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Move paintWorklet from "Window" to "CSS" according to new specification
Relevant discussion: https://github.com/w3c/css-houdini-drafts/issues/410
This commit is contained in:
parent
9e1479bbdd
commit
c7e3def9b2
7 changed files with 21 additions and 14 deletions
|
@ -2,11 +2,11 @@
|
|||
// requestAnimationFrame. In the second frame, we take a screenshot, that makes
|
||||
// sure that we already have a full frame.
|
||||
function importPaintWorkletAndTerminateTestAfterAsyncPaint(code) {
|
||||
if (typeof paintWorklet == "undefined") {
|
||||
if (typeof CSS.paintWorklet == "undefined") {
|
||||
takeScreenshot();
|
||||
} else {
|
||||
var blob = new Blob([code], {type: 'text/javascript'});
|
||||
paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
|
||||
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
|
||||
requestAnimationFrame(function() {
|
||||
requestAnimationFrame(function() {
|
||||
takeScreenshot();
|
||||
|
|
|
@ -30,7 +30,7 @@ if (window.testRunner) {
|
|||
var blob = new Blob([document.getElementById('code').textContent],
|
||||
{type: 'text/javascript'});
|
||||
var frame_cnt = 0;
|
||||
paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
|
||||
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
|
||||
var el = document.getElementById('output');
|
||||
el.style.backgroundImage = 'paint(green)';
|
||||
requestAnimationFrame(function() {
|
||||
|
|
|
@ -33,7 +33,7 @@ el.style.backgroundImage = 'paint(green)';
|
|||
var blob = new Blob([document.getElementById('code').textContent],
|
||||
{type: 'text/javascript'});
|
||||
var frame_cnt = 0;
|
||||
paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
|
||||
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
|
||||
requestAnimationFrame(function() {
|
||||
takeScreenshot(frame_cnt);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue