Closed Bug 823549 Opened 12 years ago Closed 11 years ago

Make NodeIterator.detach() a no-op

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: annevk, Assigned: Ms2ger)

References

()

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file)

Just as we did with Range.detach(), NodeIterator.detach() should do nothing. (Removing it altogether seems unwise.)
Status: NEW → ASSIGNED
Attached patch Patch v1Splinter Review
Attachment #704324 - Flags: review?(jonas)
Attachment #704324 - Flags: review?(jonas) → review?(mounir)
Comment on attachment 704324 [details] [diff] [review]
Patch v1

Review of attachment 704324 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, with the error being reported to the console. Feel free to open a follow-up to address the comment but please address it :)

::: content/base/src/nsNodeIterator.cpp
@@ +266,1 @@
>      return NS_OK;

Should we add a message in the console saying that this method doesn't do anything any more?

By the way, why doesn't the spec call the method deprecated?

::: content/base/test/test_NodeIterator_basics_filters.xhtml
@@ +121,5 @@
>        iterator.nextNode();
>      try {
>        iterator[method]();
> +      ok(true, "Able to call " + method + " on a detached NodeIterator");
> +    } catch (x) { ok(false, x) }

A comment saying that the node isn't really detached would be nice.
Attachment #704324 - Flags: review?(mounir) → review+
https://hg.mozilla.org/mozilla-central/rev/4854f48986eb
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
I've added this bug to the compatibility doc. Please correct the info if wrong.
https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_22

Also, please update the following docs:
https://developer.mozilla.org/en-US/docs/DOM/NodeIterator.detach
Component: DOM: Traversal-Range → DOM: Core & HTML
Keywords: site-compat
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: