[Bug 10803] Ignore document.written charset metas

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10803

--- Comment #11 from Henri Sivonen <hsivonen@iki.fi> 2010-12-07 09:12:45 UTC ---
(In reply to comment #10)
> Do these parsers share state? That seems like the only way to correctly parse
> this test:
>    http://www.hixie.ch/tests/adhoc/html/parsing/028.html

They don't have shared state in the sense that they'd concurrently poke at the
same memory. They share state in the sense that at well-defined points, they
copy state from one parser to the other.

In this case, at the </script> end tag, the state of the network stream parser
is copied to the document.write parser. The network parser then continues to
parse the stream. When the script has been executed and the document.written
content has been consumed by the document.write parser, its state is compared
with the state the network stream parser had right after </script>. In this
case, the state doesn't match, so the work done by the network stream parser is
thrown away, the steam is rewound and the state of the document.write parser is
copied into the network stream parser.

If an incomplete tag has been document.written and the state gets copied over,
a '>' coming from the network stream can complete the tag. This is why I said:
"A
charset meta is considered to have been document.written if the character that
caused the token to be emitted (i.e. the '>' character that ends the tag) came
from a document.write argument." in comment 0.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 7 December 2010 09:12:47 UTC