- From: Ryosuke Niwa <rniwa@apple.com>
- Date: Thu, 05 Dec 2013 21:45:26 -0800
- To: Dimitri Glazkov <dglazkov@chromium.org>
- Cc: Webapps WG <public-webapps@w3.org>
- Message-id: <1104D218-033B-4E68-98CB-29C5688C40DB@apple.com>
On Dec 5, 2013, at 9:23 PM, Dimitri Glazkov <dglazkov@chromium.org> wrote: > On Thu, Dec 5, 2013 at 9:03 PM, Ryosuke Niwa <rniwa@apple.com> wrote: > On Dec 5, 2013, at 8:43 PM, Dimitri Glazkov <dglazkov@chromium.org> wrote: >> There were several threads around this in March/April, but the main gist is that we can't allow running user code when the parser is building the tree, and thus we would need to decouple the timing of the constructor being called from the [[Construct]] internal method to make constructors workable. > > That sounds like an implementation detail of Blink/WebKit. Also, JS "wrappers" aren't even constructed immediately for builtin elements in WebKit and Blink so delaying the construction of elements until later time (e.g. end of micro task) seems fine. > > FWIW, the concern was brought up first by Microsoft's Tony Ross and then separately Mozilla's Jonas Sicking. Technically, both Blink and WebKit are capable of doing this. It's just mostly a terrible idea to interrupt tree construction with user code. Delaying construction of elements until end of microtask doesn't solve the problem -- you're just shifting the timing of tree construction. I'm not suggesting to do that. Simply call the constructor at when createdCallback is currently called. - R. Niwa
Received on Friday, 6 December 2013 05:46:29 UTC