Closed
Bug 1422289
Opened 7 years ago
Closed 7 years ago
ContentLinkHandler should guess icon type from the extension when type is not defined
Categories
(Firefox :: New Tab Page, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: mak, Assigned: Mardak)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxsearch])
Attachments
(2 files)
Bug 1422289 - ContentLinkHandler should guess icon type from the extension when type is not defined.
(deleted),
text/x-review-board-request
|
mak
:
review+
|
Details |
(deleted),
image/png
|
Details |
See bug 1421495, if the page doesn't define a type, we don't pick a preferred icon and end up just using the last defined favicon.
We can guess type from the extension, when possible.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → edilee
Iteration: --- → 1.25
status-firefox59:
--- → affected
Component: General → Activity Streams: Newtab
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•7 years ago
|
||
The website still has the double <link rel=icon> with no type from bug 1421495, and this fix works for pontoon.
Reporter | ||
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8933794 [details]
Bug 1422289 - ContentLinkHandler should guess icon type from the extension when type is not defined.
https://reviewboard.mozilla.org/r/204728/#review210624
::: browser/modules/ContentLinkHandler.jsm:141
(Diff revision 1)
> + case "image/vnd.microsoft.icon":
> + case TYPE_ICO:
> + return TYPE_ICO;
> + case TYPE_SVG:
> + return TYPE_SVG;
> + }
nit: I think this would be a bit more compact:
if (icon.type === "image/vnd.microsoft.icon") {
return TYPE_ICO;
}
if (!icon.type) {
let extension...
}
return icon.type || "";
::: browser/modules/ContentLinkHandler.jsm:144
(Diff revision 1)
> + case TYPE_SVG:
> + return TYPE_SVG;
> + }
> +
> + // Use the file extension to guess at a type we're interested in
> + let extension = icon.iconUri.filePath.split(".").slice(-1)[0];
.pop()?
Attachment #8933794 -
Flags: review?(mak77) → review+
Assignee | ||
Comment 4•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8933794 [details]
Bug 1422289 - ContentLinkHandler should guess icon type from the extension when type is not defined.
https://reviewboard.mozilla.org/r/204728/#review210624
> nit: I think this would be a bit more compact:
> if (icon.type === "image/vnd.microsoft.icon") {
> return TYPE_ICO;
> }
> if (!icon.type) {
> let extension...
> }
> return icon.type || "";
Combined the type check to the same line as fallback while keeping the extension check as only if there's not a type. There is a slight behavior change of the original patch would check the extension even if there was a type, e.g., `<link type="invalid" href="….ico" />` which might not be desired anyway… ? Although there's also a related issue of someone doing `<link type="image/svg+xml" href="….png" />` which would confuse our selection logic…
Also added a test to touch the vnd.microsoft.icon code path.
> .pop()?
Oh. Duh :p
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Pushed by edilee@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/87305b25064e
ContentLinkHandler should guess icon type from the extension when type is not defined. r=mak
Comment 8•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
Updated•5 years ago
|
Component: Activity Streams: Newtab → New Tab Page
You need to log in
before you can comment on or make changes to this bug.
Description
•