Closed Bug 5544 Opened 26 years ago Closed 26 years ago

Comment nodes in the content model contain markup delimeters

Categories

(Core :: DOM: HTML Parser, defect, P3)

All
Windows NT
defect

Tracking

()

VERIFIED DUPLICATE of bug 6071

People

(Reporter: kostello, Assigned: rickg)

References

Details

(Whiteboard: 7/9 waiting for developer response to dbaron who says that #6071 (& hence this bug) is not fixed.)

Attachments

(1 file)

Comment nodes in the content model are storing the delimiters as well as the contents. According to Vidur, this should be changed. RickG will remove the delimeters during the parse process.
*** Bug 5543 has been marked as a duplicate of this bug. ***
QA Contact: 3847 → 4141
Status: NEW → ASSIGNED
Target Milestone: M6
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed by stripping the comment tag delimiters <!..>. Let me know if you see anything break due to this; I tested script and style tags.
*** Bug 6071 has been marked as a duplicate of this bug. ***
Attempting to steal gem's HTMLParser bugs all at once. Changing QAContact to janc.
janc, please look at bug 6071 before you verify this one...
Bug 6071 is not fixed. I don't know whether you want to hold the delimiters in the content model or add them only when the DOM returns them. You should do one or the other.
Whiteboard: 6/21 waiting for developer response to dbaron who says that #6071 (& hense this bug) is not fixed.
Whiteboard: 6/21 waiting for developer response to dbaron who says that #6071 (& hense this bug) is not fixed. → 6/21 waiting for developer response to dbaron who says that #6071 (& hence this bug) is not fixed.
If you want to keep the current internal representation of comments, you could reopen bug 6071 and make it so comment nodes nodeValues are just returned differently when accessed in the DOM.
Whiteboard: 6/21 waiting for developer response to dbaron who says that #6071 (& hence this bug) is not fixed. → 7/9 waiting for developer response to dbaron who says that #6071 (& hence this bug) is not fixed.
Status: RESOLVED → REOPENED
It would be a little more complicated than just that (my previous comment) because you also need to get all the text manipulation functions to work based on the 4-character offset. That would be a pain I think. Also, since this is working correctly in XML, but not HTML, and since having two bugs that are RESOLVED doesn't get much attention, I'm going to reopen this one. Compare the following to see why I think you may be better off not storing the delimiters in the content model: http://www.fas.harvard.edu/~dbaron/dom/test/one-core-html/Comment http://www.fas.harvard.edu/~dbaron/dom/test/one-core-xml/Comment I don't think the comment delimiters should be removable through the DOM, nor should all the substringData/insertData/appendData/deleteData have their offsets messed up. Right now, the test is fine in XML, and all wrong in HTML.
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: FIXED → WONTFIX
I pass the comments through without changing the delimiters. We can't remove them in the case of script, and so we won't remove them anywhere.
Is that still true now that bug 7853 has been fixed? The correct way to parse SCRIPT and STYLE is with a CDATA content model, which means that <!-- and --> have no special meaning, and do not cause comment nodes to be generated. I think this may be being done correctly now that bug 7853 is fixed (though I'd have to check). This would mean that you don't need to store the delimiters. This is the "right way" to do things according to the SGML/HTML/DOM specs (using the DOM's definition of a comment, not SGML's). Leaving as RESOLVED-WONTFIX, for now.
The test I'm about to attach makes me think you're not using comment nodes for anything within script or style elements, and haven't been even since before the fix for bug 7853. This makes me think stripping the delimeters won't be a problem. Should this bug be reopened, or should bug 7853?
Status: RESOLVED → VERIFIED
Well, rickg marked this Won't Fix. And it seems like here that the other bugs cover ths issue. Reopen 7853 if still an open issue. Thanks!
I reopened bug 6071.
Status: VERIFIED → REOPENED
This is incorrect w.r.t. the DOM. Delimiters should be stripped either by the parser or by the Comment content class when returning the data. In past conversations with RickG, I was under the impression that the parser would strip them. This should be orthogonal to their inclusion in SCRIPT and STYLE elements, since in those cases, they should come through in the skipped content for the elements. Reopening. Rick, please talk to me if you have any questions.
Resolution: WONTFIX → ---
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → DUPLICATE
Oops, my change clashed with David's. 6071 is the reopened version. *** This bug has been marked as a duplicate of 6071 ***
Status: RESOLVED → VERIFIED
verified dup
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: