Closed Bug 1174731 Opened 4 years ago Closed 4 years ago

Make searchParams attribute readonly

Categories

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

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: annevk, Assigned: baku)

References

Details

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

Attachments

(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 url.search = "";
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]
usp3.patch

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]
usp3.patch

I received a r+ from annevk in 'real life'.
Attachment #8625786 - Flags: review?(annevk)
https://hg.mozilla.org/mozilla-central/rev/9c93813baadc
https://hg.mozilla.org/mozilla-central/rev/44002ebe4e2c
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27596 will fix this specification-wise.
Keywords: dev-doc-needed
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.