Closed Bug 1087978 Opened 10 years ago Closed 6 years ago

Support W3C format of the icons manifest property

Categories

(Core Graveyard :: DOM: Apps, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: benfrancis, Unassigned)

References

Details

(Keywords: feature)

The latest draft of the W3C spec for Web Manifests proposes a slightly different format for the "icons" property to what is currently used in Open Web Apps manifests. Open Web App manifests use a map of sizes to paths: "icons": { "128": "/img/icon-1.png", "512": "/img/icon-2.jpg" } W3C Web Manifests use an array of objects containing src, sizes and type properties [1]: "icons": [ { "src": "icon/lowres", "sizes": "64x64", "type": "image/webp" }, { "src": "icon/hd_small", "sizes": "64x64" }, { "src": "icon/hd_hi", "sizes": "128x128", "density": 2 } ] http://w3c.github.io/manifest/#icons-member This bug is to track adding support for the W3C proposed format.
This property is used in lots of places in Gaia (e.g. System, Homescreen, Settings, Search). Fabrice, do you think we should attempt to translate the W3C format into the Open Web App format so that no changes are required in Gaia to begin with, or do you think we should modify Gaia to support both formats by detecting whether the value is an array or not?
Flags: needinfo?(fabrice)
If we do a conversion, it will be best effort and potentially lossy. We'll need a default value for "any" and decide what to do if a non-square image is specified (though it's probably and edge case). Would gaia benefit from using the new format?
Flags: needinfo?(fabrice)
It seems the logic to parse the icons property is duplicated in many apps in Gaia. It would be a lot simpler on the Gaia side if Gecko just translated from one format to the other, but actually what might be better would be if we update all the places in Gaia that parse the icons property to use the new App.getIcons() method on the Apps API instead (added in bug 1000305), then Gecko can support whatever it likes. Ted, would you have bandwidth to add support for the W3C format of the icons property to the getIcon() method before 2.2 FL so we can start to replace all the occurrences in Gaia to use that and automatically support both formats?
Flags: needinfo?(tclancy)
Hey Ben. I haven't had a chance to check with Gregor, but I do have some spare cycles right now, and unless something comes up in triage tomorrow, I can start work on this.
Assignee: nobody → tclancy
Flags: needinfo?(tclancy)
Great, thanks! For what it's worth, I already mentioned this to Gregor in a standup. I'll start filing bugs for all the places in Gaia we need to start using this...
I filed meta bug 1134657 to track all the places this needs updating in Gaia.
Hi Ted, how is this going?
Flags: needinfo?(tclancy)
Tip: Check out Marcos' WIP manifest processor in bug 1079453 We may need to copy some of this logic into Gaia for bug 1134795 because as far as I know there's no API to get an icon for an app which isn't installed.
Ted, is this what you're looking for? http://lxr.mozilla.org/mozilla-central/source/dom/manifest/ManifestProcessor.jsm#219 Looks like it could be hooked up to http://lxr.mozilla.org/mozilla-central/source/dom/apps/AppsUtils.jsm#908 (or copy the code for now, until we figure out how to hook up Marcos' standalone manifest processor to the Apps API)
Assignee: tclancy → bfrancis
Flags: needinfo?(tclancy)
Unassigning myself as it's not clear whether this is still needed.
Assignee: bfrancis → nobody
Product: Core → Core Graveyard
Core Graveyard / DOM: Apps is inactive. Closing all bugs in this component.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.