Skip to content

Commit 205ba7e

Browse files
nhirokichromium-wpt-export-bot
authored andcommitted
PaintWorklet: Move paintWorklet from "window" to "CSS"
Before this CL, "paintWorklet" attribute is defined on "Window" interface, but that should be defined on "CSS" interface[1]. According to the spec discussion[2], "CSS" will be changed from "interface" to "namespace", but "namespace" is not supported yet in Blink. As a stopgap, this CL changes "paintWorklet" to a static attribute and moves it to "CSS" interface to emulate an attribute-on-namespace. [1] https://drafts.css-houdini.org/css-paint-api-1/#dom-css-paintworklet [2] w3c/css-houdini-drafts#410 Bug: 719303 Change-Id: I01f371f0d4f9a193352d1ede1fe28632d52cf312 Reviewed-on: https://chromium-review.googlesource.com/630899 Commit-Queue: Hiroki Nakagawa Reviewed-by: Xida Chen Reviewed-by: Ian Kilpatrick Reviewed-by: Kentaro Hara WPT-Export-Revision: ff3957a21bc1bc8bf5df4e44f29832e424dfa49e
1 parent e45b910 commit 205ba7e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

common/css-paint-tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// requestAnimationFrame. In the second frame, we take a screenshot, that makes
33
// sure that we already have a full frame.
44
function importPaintWorkletAndTerminateTestAfterAsyncPaint(code) {
5-
if (typeof paintWorklet == "undefined") {
5+
if (typeof CSS.paintWorklet == "undefined") {
66
takeScreenshot();
77
} else {
88
var blob = new Blob([code], {type: 'text/javascript'});
9-
paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
9+
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
1010
requestAnimationFrame(function() {
1111
requestAnimationFrame(function() {
1212
takeScreenshot();

css-paint-api/valid-image-after-load.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
var blob = new Blob([document.getElementById('code').textContent],
3131
{type: 'text/javascript'});
3232
var frame_cnt = 0;
33-
paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
33+
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
3434
var el = document.getElementById('output');
3535
el.style.backgroundImage = 'paint(green)';
3636
requestAnimationFrame(function() {

css-paint-api/valid-image-before-load.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
var blob = new Blob([document.getElementById('code').textContent],
3434
{type: 'text/javascript'});
3535
var frame_cnt = 0;
36-
paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
36+
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
3737
requestAnimationFrame(function() {
3838
takeScreenshot(frame_cnt);
3939
});

0 commit comments

Comments
 (0)