Closed
Bug 1206560
Opened 9 years ago
Closed 9 years ago
Show the site favicon in XUL web notifications/alerts, when available
Categories
(Toolkit Graveyard :: Notifications and Alerts, defect)
Toolkit Graveyard
Notifications and Alerts
Tracking
(firefox47 fixed)
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: MattN, Assigned: lina)
References
Details
Attachments
(5 files, 3 obsolete files)
The WIP design for bug 1201397 plans to show the site favicon beside the Notification title. If the alert is for a web property (not a chrome caller), we should fetch and display the favicon.
Assignee | ||
Comment 1•9 years ago
|
||
Bug 1206560 - Show the site favicon in XUL notifications.
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Here's a first cut. Depends on the refactoring in bug 1227300. Once the new interface lands, we can give bug 1224785 the same treatment.
Attachment #8694489 -
Flags: feedback?(MattN+bmo)
Assignee | ||
Updated•9 years ago
|
Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26781/diff/1-2/
Attachment #8694489 -
Attachment description: MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. → MozReview Request: Bug 1206560, Part 1 - Implement alert favicons backend. r?MattN
Attachment #8694489 -
Flags: feedback?(MattN+bmo) → review?(MattN+bmo)
Assignee | ||
Comment 4•9 years ago
|
||
Bug 1206560, Part 2 - Show the site favicon in XUL notifications.
Assignee | ||
Comment 5•9 years ago
|
||
https://reviewboard.mozilla.org/r/26781/#review24675
::: toolkit/components/alerts/AlertNotification.js:55
(Diff revision 2)
> + showWithFavicon(service, alertListener) {
This API is a bit odd, since the service needs to pass itself. I thought of having this take an `nsIFaviconDataCallback` instead, but that still requires the callback to be implemented in C++, along with `#ifdef MOZ_PLACES`. It's shy of four dozen lines in C++, compared to 10 in JS. WDYT?
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8696152 [details]
MozReview Request: Bug 1206560, Part 2 - Show the site favicon in XUL notifications.
Splitting out the design from the backend. I haven't updated the dimensions yet, but is the general approach right?
Attachment #8696152 -
Flags: feedback?(jaws)
Comment 7•9 years ago
|
||
https://reviewboard.mozilla.org/r/27287/#review25333
::: toolkit/components/alerts/resources/content/alert.xul:28
(Diff revision 1)
> + <hbox class="alertIconBox" align="center" pack="center">
Why does this need to be in a separate hbox? The #alertTitleBox is already an hbox, it seems that maybe this was done to get the correct alignment and packing? Can you try setting -moz-box-pack:center; and -moz-box-align:center; on #alertTitleBox instead?
::: toolkit/themes/shared/alert-common.css:62
(Diff revision 1)
> + padding: 6px 0 6px 8px;
This should use padding-inline-start and padding-inline-end so it will not look out of position in RTL builds.
::: toolkit/themes/shared/alert-common.css:66
(Diff revision 1)
> + width: 16px;
How does the notification look if a favicon is provided that is 16px wide but much taller than 16px?
Updated•9 years ago
|
Attachment #8696152 -
Flags: feedback?(jaws) → feedback+
Reporter | ||
Updated•9 years ago
|
Attachment #8694489 -
Flags: review?(MattN+bmo)
Assignee | ||
Comment 8•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26781/diff/2-3/
Attachment #8694489 -
Attachment description: MozReview Request: Bug 1206560, Part 1 - Implement alert favicons backend. r?MattN → MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r?jaws
Attachment #8694489 -
Flags: review?(jaws)
Assignee | ||
Updated•9 years ago
|
Attachment #8696152 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Updated•9 years ago
|
Attachment #8694489 -
Flags: review?(jaws)
Comment 9•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
https://reviewboard.mozilla.org/r/26781/#review26917
Holding off r+ until the questions below are answered.
::: toolkit/components/alerts/nsXULAlerts.cpp:91
(Diff revision 3)
> +nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
> + nsIObserver* aAlertListener,
> + nsIURI* aURI)
Please rename aURI to aIconURI since it is not obvious that aURI is referring to the icon here.
::: toolkit/components/alerts/nsXULAlerts.cpp:249
(Diff revision 3)
> + nsCOMPtr<nsISupportsInterfacePointer> iconURI = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
> + NS_ENSURE_SUCCESS(rv, rv);
> + nsCOMPtr<nsISupports> supportsIconURI(do_QueryInterface(aURI));
> + iconURI->SetData(supportsIconURI);
> + iconURI->SetDataIID(&NS_GET_IID(nsIURI));
> + rv = argsArray->AppendElement(iconURI);
> + NS_ENSURE_SUCCESS(rv, rv);
Please pass the spec here instead of the full nsIURI. alert.js only uses the spec and I would prefer if we keep the API surface as small as possible.
::: toolkit/components/alerts/resources/content/alert.css:21
(Diff revision 3)
> +#alertTitleBox {
> + -moz-box-pack: center;
> + -moz-box-align: center;
> +}
Did you test that this doesn't center the title text?
::: toolkit/themes/shared/alert-common.css:61
(Diff revision 3)
> + width: 16px;
If width is specified here, should height be specified also? If an icon is provided that is 16px tall and 2px wide, this will probably distort the icon. You should use `object-fit: scale-down;` here, as it will contain the image to the box size but not increase the size if it is intrinsically smaller than the box.
Assignee | ||
Comment 10•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26781/diff/3-4/
Attachment #8694489 -
Flags: review?(jaws)
Assignee | ||
Comment 11•9 years ago
|
||
https://reviewboard.mozilla.org/r/26781/#review26917
> Please pass the spec here instead of the full nsIURI. alert.js only uses the spec and I would prefer if we keep the API surface as small as possible.
Sounds good.
> Did you test that this doesn't center the title text?
Sure did. The title text is not centered, and looks the same as before for pages without an icon.
> If width is specified here, should height be specified also? If an icon is provided that is 16px tall and 2px wide, this will probably distort the icon. You should use `object-fit: scale-down;` here, as it will contain the image to the box size but not increase the size if it is intrinsically smaller than the box.
I didn't use `object-fit: scale-down;` to keep the appearance consistent with the tabs bar, bookmarks toolbar, and bookmarks menu, which will distort excessively tall icons. It looks like OS X does the same. I think the scaled icon looks cleaner, albeit less recognizable compared to the others. I'll upload some screenshots to compare. WDYT?
Assignee | ||
Comment 12•9 years ago
|
||
Assignee | ||
Comment 13•9 years ago
|
||
Assignee | ||
Comment 14•9 years ago
|
||
Comment 15•9 years ago
|
||
Is an image supplied for the notification in your two XUL screenshots? There is a large blank area where the image should be, I'm not sure if a transparent image is used in your screenshots or if there is a bug with the changes.
Flags: needinfo?(kcambridge)
Assignee | ||
Comment 16•9 years ago
|
||
Oof, yes. I specified an image with an invalid path, so it returns a 404. I thought we had a bug on file for that, but I can't seem to find it. Filed bug 1238240. Here's a better screenshot, too.
Attachment #8705890 -
Attachment is obsolete: true
Flags: needinfo?(kcambridge)
Comment 17•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
https://reviewboard.mozilla.org/r/26781/#review26943
Thanks for fixing and providing those screenshots. Sorry for not thinking of this earlier, but can you please update the browser_notification_close.js test to check that when the icon is provided it is correctly referenced in the notification?
r+ with the test updated
Attachment #8694489 -
Flags: review?(jaws) → review+
Assignee | ||
Updated•9 years ago
|
Attachment #8694489 -
Attachment description: MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r?jaws → MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Assignee | ||
Comment 18•9 years ago
|
||
Comment on attachment 8694489 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26781/diff/4-5/
Comment 20•9 years ago
|
||
Assignee | ||
Comment 21•9 years ago
|
||
Hmm, I'm seeing intermittent failures for the icon test on Windows: https://treeherder.mozilla.org/#/jobs?repo=try&revision=cc0a80cc9333 I backed out for failing M-e10s(bc4), but it's reproducible on M(bc2).
I wonder if this is caused by a race, where we're showing the notification before the icon has been downloaded and saved to Places. Maybe `mozIAsyncFavicons.setAndFetchFaviconForPage` can help here? (Or `mozIAsyncFavicons.replaceFaviconData{FromDataURL}`).
Though I wonder if that could race with adding the visit to Places, and if we should unconditionally add a visit for the page first.
Does that sound right, :jaws?
Flags: needinfo?(jaws)
Comment 22•9 years ago
|
||
Paolo knows a bit more about mozIAsyncFavicons than I do, perhaps he knows?
Flags: needinfo?(jaws) → needinfo?(paolo.mozmail)
Assignee | ||
Comment 23•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/36389/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/36389/
Attachment #8723181 -
Flags: review?(jaws)
Assignee | ||
Updated•9 years ago
|
Attachment #8694489 -
Attachment is obsolete: true
Assignee | ||
Comment 24•9 years ago
|
||
Let's see if this works: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1aeca4693300
Assignee | ||
Comment 25•9 years ago
|
||
Interdiff.
Assignee | ||
Comment 26•9 years ago
|
||
Comment on attachment 8723181 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/36389/diff/1-2/
Comment 27•9 years ago
|
||
Comment on attachment 8723181 [details]
MozReview Request: Bug 1206560 - Show the site favicon in XUL notifications. r=jaws
https://reviewboard.mozilla.org/r/36389/#review32981
Attachment #8723181 -
Flags: review?(jaws) → review+
Updated•9 years ago
|
Flags: needinfo?(paolo.mozmail)
Assignee | ||
Comment 28•9 years ago
|
||
That appears to have done the trick: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2c489416501b
Comment 29•9 years ago
|
||
Comment 30•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Updated•9 years ago
|
Flags: qe-verify+
Comment 31•9 years ago
|
||
Can you please provide a way I can make those web notification show up in order to reproduce the issue on old Nightly build and then verify on latest builds?
Flags: needinfo?(kcambridge)
Assignee | ||
Comment 32•9 years ago
|
||
Hi! We disabled favicons in web notifications in bug 1250288. You can flip the "alerts.showFavicons" pref in about:config, but it needs some UX attention (bug 1250285) before we can ship it.
Flags: needinfo?(kcambridge)
Updated•1 year ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•