Closed Bug 722071 Opened 12 years ago Closed 12 years ago

Implement array style indexing for SVGStringList

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

For compatibility with the other list types (see bug 631437), we should implement array style indexing for SVGStringList.
Attached patch patchSplinter Review
Attachment #592427 - Flags: review?(mounir)
Comment on attachment 592427 [details] [diff] [review]
patch

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

Blake seems more appropriate to do this review.
Attachment #592427 - Flags: review?(mounir) → review?(mrbkap)
Comment on attachment 592427 [details] [diff] [review]
patch

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

::: dom/base/nsDOMClassInfo.cpp
@@ +10912,5 @@
> +// SVGStringList helper
> +
> +NS_IMETHODIMP
> +nsSVGStringListSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
> +                               JSObject *obj, jsid id, jsval *vp, bool *_retval)

This implementation of GetProperty doesn't seem to add anything to the base class' implementation. Seems like it can be removed.

@@ +10954,5 @@
> +    list->GetLength(&length);
> +    NS_ASSERTION(PRUint32(aIndex) >= length, "Item should only return null for out-of-bounds access");
> +  }
> +#endif
> +  if (rv == NS_ERROR_DOM_INDEX_SIZE_ERR) {

Are there any tests to exercise this codepath?
Attachment #592427 - Flags: review?(mrbkap) → review+
(In reply to Blake Kaplan (:mrbkap) from comment #3)
> This implementation of GetProperty doesn't seem to add anything to the base
> class' implementation. Seems like it can be removed.

Ah, yeah I'll remove that.

> Are there any tests to exercise this codepath?

Yes, specifically the test that is modified in the patch (the ok() test after the 'for' loop).

Thanks for the speedy review!
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/7b0c5dcf5bcb
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 724993
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: