[css-houdini-drafts] [css-paint-api] Running author function without proper preparation.

yuki3 has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-paint-api] Running author function without proper preparation. ==
In short, [invoke a paint callback](https://drafts.css-houdini.org/css-paint-api/#invoke-a-paint-callback) does not follow Web IDL nor HTML specs.  The CSS Painting API spec and its algorithms are defined using ECMAScript directly, and it violates Web IDL and HTML specs.

I cannot list up all the places that are conflicting with Web IDL and/or HTML, so let me show an example.

In [invoke a paint callback](https://drafts.css-houdini.org/css-paint-api/#invoke-a-paint-callback), step 5.3. "Let paintInstance be the result of Construct(paintCtor)."; this step invokes an author function |paintCtor| without performing [prepare to run script](https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-script) nor [prepare to run a callback](https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-a-callback).  This is NOT allowed in Web IDL nor HTML.  |paintCtor| will run without the Incumbent realm having been set up, so we cannot tell what would happen if |paintCtor| invoked an Web API that uses the Incumbent realm.

I originally reported [the same issue](https://github.com/WICG/animation-worklet/issues/94) to Animation Worklet.  It seems like better to report this to CSS Paint API, too, so I'm now reporting here.

Ideally, each Web API spec should not be defined with ECMAScript.  Web IDL provides all the necessary abstraction and it's easier with Web IDL to make each spec consistent.


Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/743 using your GitHub account

Received on Tuesday, 3 April 2018 09:12:23 UTC