Re: [css-houdini-drafts] Long running scripts

We've discussed this previously at a F2F... there is a bit of context 
here / reasons for this.

(1) A long running paint worklet script (on the main thread), isn't 
different to a long running script in the main js environment. Hence 
should put up a slow script dialog thing.

(fundementally people can still do `while(1);` on the main thread, 
doesn't matter if this is inside worklet of main js environment).

(2) We don't want to force implementors to explicitly run the paint 
worklet on a separate thread, just so that they can kill it if there 
is a `while(1);` loop. We want to have the option to say "bad script" 
or whatever.

(3) There is debate as to whether we want paint to explicitly block 
the frame, and I think the rough consensus at the moment is that we 
do; but to add an option later to skip a paint function if it is 
running too long. E.g.

```js
registerPaint('foo', class {
  static get mayBeAsync() { return true; }  // Implies can skip this 
if not enough time in a frame.
});
```

We haven't placed this in yet, as we want to see how authors actually 
use this initially before speccing something like this.

There is some debate as to whether the UA can "intervene" and place 
known bad painters on a background thread and be async (i think this 
might be a good compromise), but again need more real world experience
 here.


-- 
GitHub Notification of comment by bfgeek
Please view or discuss this issue at 
https://github.com/w3c/css-houdini-drafts/issues/236#issuecomment-227834086
 using your GitHub account

Received on Wednesday, 22 June 2016 18:25:38 UTC