Closed Bug 1174731 Opened 8 years ago Closed 8 years ago

Make searchParams attribute readonly


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

Not set



Tracking Status
firefox41 --- fixed


(Reporter: annevk, Assigned: baku)



(Keywords: dev-doc-needed, site-compat, user-doc-needed)


(2 files, 1 obsolete file)

This would significantly simplify the complexity of the object and not really reduce the functionality.
(I will update the specification if this is successful, as far as I know we're still the only ones implementing this.)
To clarify, the reason the specification is not changed is because this rather simplifies URLSearchParams as the relationship to URL objects becomes 1:1. I'd like to make sure we can land this without issue as otherwise I end up changing the specification twice.
Attached patch usp2.patchSplinter Review
Attachment #8625476 - Flags: review?(bugs)
Anne, is the idea then to have something like .clear() in URLSearchParams?
Though, I guess one can always use = "";
Flags: needinfo?(annevk)
Attachment #8625476 - Flags: review?(bugs) → review+
Depends on: 1105677
Yeah, we could add new methods later. Need to figure out what kind of methods make sense for multimap objects. Note that FormData/URLSearchParams/Headers are extremely close in terms of API.
Flags: needinfo?(annevk)
Keywords: user-doc-needed
Attached patch usp3.patch (obsolete) — Splinter Review
Attachment #8625778 - Flags: review?(annevk)
Comment on attachment 8625778 [details] [diff] [review]

Review of attachment 8625778 [details] [diff] [review]:

Please lose the indentation so that the word "attribute" is aligned with the lines before. Also, this should be a new URLUtilsSearchParams interface, no?
Attachment #8625778 - Flags: review?(annevk) → review-
Attached patch usp3.patchSplinter Review
Attachment #8625778 - Attachment is obsolete: true
Attachment #8625786 - Flags: review?(annevk)
Comment on attachment 8625786 [details] [diff] [review]

I received a r+ from annevk in 'real life'.
Attachment #8625786 - Flags: review?(annevk)
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41 will fix this specification-wise.
Keywords: dev-doc-needed
It breaks my BzDeck app :(

Why searchParams is readonly even on new URL?
Keywords: site-compat
Flags: needinfo?(annevk)
> Why searchParams is readonly even on new URL?

Because 1:1 is much better than 1:M and you can simply assign to .search instead.
Flags: needinfo?(annevk)
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.