Closed Bug 166419 Opened 22 years ago Closed 17 years ago

Mozilla's DOM Ranges don't support comment nodes

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: aaronlev, Assigned: mozeditor)

References

Details

(Keywords: qawanted)

Attachments

(1 file)

If one tries to use nsIDOMRange::SetStart() or SetEnd() with a comment node, it returns an error. This is because nsRange::GetNodeLength() does not handle comment nodes. It only supports node length for text nodes and cdata section nodes. However, I noticed there are other places in dom ranges where comment nodes are not supported. Is this by design or was it just never completed?
Is this the right thing to do? Seeking r=/sr=
Blocks: 166340
I already have a work around for my particular bug, so I'm going to pass this to jrfrancis, so he can get all the places that should support comment nodes right. On the other hand, if this doesn't seem to affect anyone it doesn't bother me if it's futured.
Assignee: aaronl → jfrancis
Summary: nsIDOMRange::GetNodeLength() returning incorrect value for comment nodes → Mozilla's DOM Ranges don't support comment nodes
What does the DOM Range spec say on this? This sounds to me like something we should really fix....
Blocks: 175046
futuring for now. if someone is affected by this please comment.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
I think my fix for bug 332148 handles this, if it's not fixed already.
Depends on: 332148
Someone want to submit a testcase beyond the one provided in bug 332148?
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Alex, does that testcase test comment nodes? If not, care to just write a test for this bug?
bz: it does, but only for the extractContents and cloneContents cases. IMHO, that's not enough. :) I'd really rather not write the tests myself (nor would I want to burden you, bz).
So setStart/setEnd per comment 0 work? That's what needs to be tested. For what it's worth, this is now in my to-do list, since _someone_ has to do it. I'd be quite happy if someone else gets to it, of course.
Keywords: qawanted
(In reply to comment #9) > So setStart/setEnd per comment 0 work? That's what needs to be tested. Yes, that's one thing the tests for extractContents covers.
Sounds like this bug is covered then... what else needs testing?
Component: DOM: Traversal-Range → DOM: Core & HTML
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: