Closed
Bug 975248
Opened 11 years ago
Closed 10 years ago
[Web Notifications] Notification.get() should be Notification.getClones()
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: mikehenrty, Unassigned)
References
Details
(Whiteboard: [systemsfe])
Recently, the WHATWG changed the spec for fetching notifications from Notification.get to Notification.getClones. We need to update our WebIDL def to follow this.
http://notifications.spec.whatwg.org/#dom-notification-getclones
Discussion on github which lead to this change:
https://github.com/whatwg/notifications/issues/9
Comment 1•10 years ago
|
||
Is this going to happen or is it too late now? I saw some code that uses get()...
Reporter | ||
Comment 2•10 years ago
|
||
There is indeed code already using Notification.get(), but that was already the case when filing this bug. And it is still early enough that the change is not too painful.
What about supporting both for the time being with a JS deprecation warning whenever someone use get()?
Comment 3•10 years ago
|
||
We could do that. Jake had some concerns with respect to the name getClones() and they rather not adopt it elsewhere. Not sure how else to indicate you do not the same objects back. But maybe that is not important?
Reporter | ||
Comment 4•10 years ago
|
||
Jake Archibald? Do you remember his concerns? I didn't see it on the github issues.
My two cents is that so long as all the events work on both the `new Notification` and the .get() notification, we don't need to indicate they are not triple equivalent with the name `getClones`. I think web users will get used to the idea fairly quickly that fetched notifications are brand new objects regardless of the name.
Comment 5•10 years ago
|
||
See https://github.com/slightlyoff/ServiceWorker/issues/414#issuecomment-52067666 onwards. I guess I'll change the specification back to just get().
Comment 6•10 years ago
|
||
My concerns weren't anything greater than "ew". At first glance I didn't realise "clones" meant an object clone vs a duplicate visual notification vs getting notification objects that were previously cloned.
We're going to avoid equivalence in ServiceWorker as much as possible (https://github.com/slightlyoff/ServiceWorker/issues/416), adding it back in if (and where) it causes issues.
I don't think it's surprising for a method to return a new view of the same underlying data. array.slice() for example. I'd have preferred Notification.getAll() over .get(), but it's really minor.
Comment 7•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•