On Wed, Jan 14, 2015 at 12:31 PM, Anne van Kesteren <ann...@annevk.nl> wrote: > On Wed, Jan 14, 2015 at 4:28 PM, Erik Arvidsson <a...@google.com> wrote: >> I don't see why it has to be done synchronously? We can do what we do >> it today and do it synchronously-ish, that is before any user script >> (script element) is executed. That way the parser does not have to be >> stalled by user script until user script would run anyway. > > Could you explain how this works in more detail? E.g. what would the > processing model be for something like this (assuming a registry > entry): > > <script> > document.write("<my-div>") > alert(document.querySelector("my-div")) > </script>
document.write empties the callback queue after it has been executed. This means that the createdCallback for my-div is called after document.write() and before alert. I'm not sure how that is speced but in Blink we have an extended IDL attribute called CustomElementCallbacks which means that we are going to call the pending callbacks after the method/setter. -- erik