Closed
Bug 170776
Opened 23 years ago
Closed 22 years ago
text nodes should not be created where they are illegal per the DTD
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: stummala, Assigned: harishd)
Details
(Keywords: helpwanted, Whiteboard: WONTFIX?)
It is illegal to create a textnode in the <head> block and between the <TD> &
<TR> according to the dtd.
So all the whitespaces, newlines should be ignored by the parser.
#document
HTML
HEAD
TITLE
#text
#text -- not allowed
SCRIPT
#text
#text
BODY
...
...
When trying to access the script node, i actually got the text node.
we should not have a #text node as child of head element.
ref: http://www.w3.org/TR/1998/REC-html40-19980424/struct/global.html#h-7.4.1
| Reporter | ||
Updated•23 years ago
|
sivakiran: Please don't set priority for bugs that you don't own.
Priority: P2 → --
Comment 2•23 years ago
|
||
This may not in fact be a bug (due to SGML->DOM conversion being
broken-as-designed). See bug 26179.
Comment 3•23 years ago
|
||
<html>
<body>
This is illegal text
</body>
</html>
Should we drop the text there too? Or just in head and tables and such?
| Reporter | ||
Comment 4•23 years ago
|
||
I think this should be fixed, where we can be sure that we do not break any web
sites.
Comment 5•23 years ago
|
||
I think that would be a lot of work and would break lots of websites we failed
to notice... but that's just my opinion. If someone is willing to do the work,
go for it by all means.
Keywords: helpwanted
Comment 7•22 years ago
|
||
Is this a request just for HTML? If so, I think we should WONTFIX it, since we
are basically a tag soup parser, not an HTML parser. Certainly, this is no more
important than implementing support for SHORTTAG features, IMHO.
Whiteboard: WONTFIX?
Comment 8•22 years ago
|
||
Impedance mismatch. In SGML, the DTD limits where "text" (#PCDATA) can appear.
However, SGML allows a limited subset of text, whitespace, to appear in many
different places (between tags, etc.). In the DOM, both #PCDATA and whitespace
are represented by text nodes, hence the problem reported here.
More precisely, the initial statement "It is illegal to create a textnode in the
<head> block and between the <TD> & <TR> according to the dtd." is incorrect; it
is illegal to have non-whitespace text in those places, but a text*node* is part
of the DOM and not constrained by DTD.
I agree that this should be WONTFIX.
Comment 9•22 years ago
|
||
ok, one less bug to worry squash.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•