Open bzbarsky opened 5 years ago
https://drafts.css-houdini.org/css-paint-api-1/#invoke-a-paint-callback step 5.3 does:
Let paintInstance be the result of Construct(paintCtor).
but doesn't define the state changes necessary to do things like handle Promises queued from inside the constructor and whatnot. See https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-script and https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-script
Depending on what things the constructor can be here, https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-a-callback and https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-a-callback might be needed too.
In general, using https://heycam.github.io/webidl/#construct-a-callback-function here instead of manually calling https://tc39.es/ecma262/#sec-construct might be a good idea.
Also, this would let you make it clear what the return value of the constructor is expected to be, by just writing it clearly in the IDL. Presumably just object in this case.
object
https://drafts.css-houdini.org/css-paint-api-1/#invoke-a-paint-callback step 5.3 does:
but doesn't define the state changes necessary to do things like handle Promises queued from inside the constructor and whatnot. See https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-script and https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-script
Depending on what things the constructor can be here, https://html.spec.whatwg.org/multipage/webappapis.html#prepare-to-run-a-callback and https://html.spec.whatwg.org/multipage/webappapis.html#clean-up-after-running-a-callback might be needed too.
In general, using https://heycam.github.io/webidl/#construct-a-callback-function here instead of manually calling https://tc39.es/ecma262/#sec-construct might be a good idea.