Closed Bug 1011831 Opened 11 years ago Closed 11 years ago

Support <template> element in XHTML parser.

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: wchen, Assigned: wchen)

References

Details

Attachments

(2 files, 1 obsolete file)

It turns out that we still use the old parser to parse XHTML document as XML when the mime type is application/xhtml+xml and the old parser does not have support for <template> elements: http://dxr.mozilla.org/mozilla-central/source/content/html/document/src/nsHTMLDocument.cpp#569
Attachment #8424282 - Flags: review?(hsivonen)
Comment on attachment 8424282 [details] [diff] [review] Support <template> element in XHTML parser. I guess we still need another bug&patch for XSLT...
Attachment #8424282 - Flags: review?(hsivonen) → review+
I've changed the approach for fixing this bug. It now pushes template content onto the stack instead of the template element. There were a couple places that would count the number of children of the node at the top of the stack and it would get the number wrong if we pushed the template element instead of the template contents. This new patch is also closer to what we do in the HTML parser for handing the template element. Also added some tests. Follow up bug for the XSLT issue here: Bug 1016720
Attachment #8424282 - Attachment is obsolete: true
Attachment #8429673 - Flags: review?(hsivonen)
Attachment #8429673 - Flags: review?(hsivonen) → review+
It turns out that we use a different serializer for xhtml parsed as xml that needs to be updated, and this was causing the failure in dev tools. I've updated the iterative serializer in nsDocumentEncoder to step into template contents, similar to what we do in the FragmentOrElement serializer.
Attachment #8432856 - Flags: review?(hsivonen)
Flags: needinfo?(wchen)
Attachment #8432856 - Flags: review?(hsivonen) → review+
Flags: in-testsuite? → in-testsuite+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Depends on: 1061419
See Also: → 1080029
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: