Closed
Bug 63560
Opened 24 years ago
Closed 24 years ago
XMLSerializer does not output html:script contents
Categories
(Core :: XML, defect)
Core
XML
Tracking
()
VERIFIED
FIXED
People
(Reporter: hjtoi-bugzilla, Assigned: hjtoi-bugzilla)
Details
(Keywords: testcase, Whiteboard: [fixinhand])
Attachments
(4 files)
5.46 KB,
patch
|
Details | Diff | Splinter Review | |
886 bytes,
text/xml
|
Details | |
6.99 KB,
patch
|
Details | Diff | Splinter Review | |
6.55 KB,
patch
|
Details | Diff | Splinter Review |
html:script element will always be empty when it is serialized.
Assignee | ||
Comment 1•24 years ago
|
||
If you save this document as test.xml it will output empty script element:
<script xmlns="http://www.w3.org/1999/xhtml">
setTimeout("dump(new XMLSerializer().serializeToString(document))",1000);
</script>
Now if you save it as test.html, you will get the correct script element
contents. So it looks like we loose the script contents somewhere in XML path
only. The mChildren of the script element is empty in XML document case while
there are children in HTML document case.
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•24 years ago
|
||
Ok, found the place. In nsXMLContentSink::ProcessEndSCRIPTTag() we have
FlushText(PR_FALSE);. This means that the text of the script contents are not
added to the DOM (even though the script is run). Calling FlushText(); fixes
this. There is an interesting side effect: if the test document only contains
the script element, the contents are now displayed in the document. If there are
additional elements (or maybe it is just a root element thing), it is not visible.
We also need to take care of the situation where the script element contents are
inside a CDATA section.
I'll attach a wip for fix. wip because I am seeing a lot of warnings and even an
exception in JS code in the console. The wip also contains some small other
fixes in dom and expat and the content sink.
Assignee | ||
Comment 3•24 years ago
|
||
Assignee | ||
Comment 4•24 years ago
|
||
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
I no longer see any problems reported on the console, and everything seems to be
working fine.
I changed some booleans in the content sink class to packed bools, which saves 4
bytes (yeah, like it matters), but I also needed to intruduce a new string
member that holds the contents of a currently open script tag as text. This was
needed to account for the case where a script tag could contain several CDATA
sections as well as normal text sections. The testcase has a situation like
this. I also found an unused define, which I removed. The patch contains also a
fix to doctype handling - the XML parser has already detected if there were
multiple doctypes so we do not need to worry about that in XML.
The fixes in expat dir are two fix compiler warnings, and the fixes to dom to
enable the method "initMouseEvent".
Whiteboard: [fixinhand]
Assignee | ||
Comment 7•24 years ago
|
||
Assignee | ||
Comment 8•24 years ago
|
||
harishd says r.
Comment 10•24 years ago
|
||
sr=vidur for all but the nsDOMPropEnums/nsDOMPropNames change (which shouldn't
be necessary). Also, the compiler warnings fixed in xmlparse.c could be fed back
into the original (SourceForge-based) repository.
Assignee | ||
Comment 11•24 years ago
|
||
The last patch (minus changes in the dom directory) checked in yesterday.
Marking fixed.
You need to log in
before you can comment on or make changes to this bug.
Description
•