Closed Bug 940196 Opened 12 years ago Closed 12 years ago

add dir, lang and tag options to notifications (and align with WebNotifications api?)

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: zombie, Assigned: zombie)

Details

Attachments

(2 files)

while working on bug 895693, and reading the docs for nsIAlertsService, i noticed new arguments added in Firefox 22: `dir` and `lang`, so i implemented them (along with `tag`), and Jordan asked for this to be in a separate bug. it's obvious those were added for the Web Notification implementation, and with this addition, the `sdk/notifications` api looks fairly close to w3c specification, so it might be a good idea to align with it where possible. http://www.w3.org/TR/notifications/#api differences: 1) uses the Notification constructor for each new notification 2) has one required argument `title`, and the rest are in the `options` object 3) uses `body` instead of `text` option key 4) uses lowercase `onerror` event handler those all seem solvable in a backwards-compatible way. what do you think Irakli?
Flags: needinfo?(rFobic)
Attached file link to pr 1298
note: this is just the patch for dir, lang and tag options, not the Web Notifications compatibility stuff proposed above. also, where i said 'onerror' above, i meant 'onclick'.
Attachment #8334710 - Flags: review?
Assignee: nobody → tomica+amo
Status: NEW → ASSIGNED
Attachment #8334710 - Flags: review?(rFobic) → review+
(In reply to Tomislav Jovanovic [:zombie] from comment #0) > while working on bug 895693, and reading the docs for nsIAlertsService, i > noticed new arguments added in Firefox 22: `dir` and `lang`, so i > implemented them (along with `tag`), and Jordan asked for this to be in a > separate bug. > > > it's obvious those were added for the Web Notification implementation, and > with this addition, the `sdk/notifications` api looks fairly close to w3c > specification, so it might be a good idea to align with it where possible. > > http://www.w3.org/TR/notifications/#api > > differences: > 1) uses the Notification constructor for each new notification > 2) has one required argument `title`, and the rest are in the `options` > object > 3) uses `body` instead of `text` option key > 4) uses lowercase `onerror` event handler > > those all seem solvable in a backwards-compatible way. what do you think > Irakli? I think we should totally embrace standard APIs where possible. I have already landed your change. I have also made a WIP patch that exposes HTML5 notifications API directly as implemented in DOM. It needs some tests cleanup etc, but cool thing is it actually works. I'll try to finish it up in coming days. If anyone want's to take over, I'm happy to delegate.
Flags: needinfo?(rFobic)
Submitted separate bug to expose HTML5 notifications API (see bug 946016)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: