Custom elements and the HTML parser

I tried to explore the synchronous constructor option a bit more. (See
https://wiki.whatwg.org/wiki/CustomElements for details.)

>From an HTML parser perspective the main problem would be that
elements with a dash would have to go into the same path that is
basically a special case for </script> today. So the performance of
the parser would suffer. It's unclear how much of a hit that would be.

Only </script> causes synchronous invocation of script. Otherwise
script is invoked based on a timer or lack of incoming data from the
network to process. This would change that as elements with a dash
could cause synchronous invocation of script as well.

This would give custom elements the same freedom as builtin elements.
We could even add a hook for popping of the end tag so you can emulate
the behavior of these elements: script, style, object, video, and
audio. I don't think there's a way to do that with the alternative
strategies.

(I checked and Servo has no plans to parallelize tree building.)


-- 
https://annevankesteren.nl/

Received on Thursday, 29 January 2015 10:46:48 UTC