DescriptionThis fixes issue 1589
https://code.google.com/p/google-caja/issues/detail?id=1589
Input like this:
<html>
<head> <script>;</script></head>
<body>foo</body>
</html>
will cause the cajoler to emit html like this:
<caja-v-html>
<caja-v-head> <span id="id_2___"></span></caja-v-head>
<caja-v-body>foo</caja-v-body>
</caja-v-html>
which is fine. But when html-emitter is done, the result looks like this:
<caja-v-html>
<caja-v-head><caja-v-body></caja-v-body></caja-v-head>
<caja-v-body>foo</caja-v-body>
</caja-v-html>
So what's happening:
When we call htmlEmitter.finish(),
insertionPoint is at the caja-v-head,
everything after that is detached,
and insertionMode is afterHead (rather than inHead).
finish() calls notifyEOF() before reattaching the detached nodes.
notifyEOF() calls afterHead.endOfFile(),
which adds an empty body at the insertionPoint,
so it goes inside the head instead of after.
And then finish() reattaches the detached nodes,
so we end up with two caja-v-body nodes.
This fixes that.
Patch Set 1 #
Total comments: 7
Patch Set 2 : html-emitter screws up document structure #Patch Set 3 : html-emitter screws up document structure #
Total comments: 1
MessagesTotal messages: 15
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||