Implement array style indexing for SVGStringList

RESOLVED FIXED in mozilla13

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

({dev-doc-complete})

Trunk
mozilla13
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
For compatibility with the other list types (see bug 631437), we should implement array style indexing for SVGStringList.
(Assignee)

Comment 1

7 years ago
Posted 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+
(Assignee)

Comment 4

7 years ago
(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
(Assignee)

Comment 5

7 years ago
https://hg.mozilla.org/mozilla-central/rev/7b0c5dcf5bcb
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED

Updated

7 years ago
Depends on: 724993
You need to log in before you can comment on or make changes to this bug.