> OK. It looks like writing a new parser directly in Rust (possibly using a
> translated Tokenizer.java as a tokenizer starting point) is the sensible way
> forward. I'm sorry about wasting your time with the translator.

Not at all :) It was an interesting project and definitely an approach worth 
considering.  Thanks for doing a big chunk of the initial work so we could 
evaluate.


> No, </script> does nothing in the on-the-main-thread case.
>
> Since </script> doesn't do anything in innerHTML, document.write can't happen 
> from innerHTML.

Okay; if I understand correctly, you're saying that writing a <script> tag to 
an element's innerHTML will not actually execute the script.  But I think we 
still need to process innerHTML writes synchronously because of mutation 
observers and such.  Basically we cannot guarantee that DOM manipulations don't 
modify pure JS state.  (I thought that COW DOM was based on that assumption, 
but it's not; script will continue to interact synchronously with the live DOM 
while layout works from a snapshot.)


> Gecko whines to the developer console when document.write() invalidates
> speculations. When I tested the whine during Firefox 4 development, real
> sites didn't tend to trigger the whine

That's good.  The behaviors which invalidate speculation are basically what's 
listed at 
https://developer.mozilla.org/en-US/docs/HTML/Optimizing_Your_Pages_for_Speculative_Parsing#Avoiding_losing_tree_builder_output
 ?

Gecko also does speculative loads of resources discovered through speculative 
parsing, which may be useful even when parse speculation fails.  I think this 
is an optimization we don't need to implement right away, unless it affects the 
overall parser design, and I'm failing to come up with reasons why it would.  
We don't necessarily have the resource loading / caching infrastructure to 
support it, anyway.


keegan
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to