Provide a single function for obtaining icon URLs from search engines
Categories
(Firefox :: Search, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(4 files)
Currently we have several different properties/methods for accessing the icons on a search engine:
SearchEngine.iconURI
- A getter which returns annsIURI
of the "preferred" icon.SearchEngine.getIconURLBySize(width, height)
- Returns the URL as a string. The width and height must be an exact match to an icon defined by the search engine.SearchEngine.getIcons()
- Returns an array of objects containing the icon width, height and url (nsIURI
) for the icons. Only used in tests.
I want to simplify this down so that we only have a single function. Ideally the single function should be able to take a preferred width and return the icon closest to that width (e.g. bug 1655070).
However, the work to get us to the ideal state is more than I want to take on at the moment (because we also need to improve this function for search-config-v2), so I'm splitting this up. In this bug, I'm concentrating on implementing a single function, and updating all consumers to use that. We might need to iterate more on it for future patches, but this gets us to a more consistent state.
Hence, getIcons
is being removed, as that isn't needed, and can be tested in other ways. iconURI
and getIconURLBySize
are being merged into one function, getIconURL
, which will return a string - most of the consumers deal with strings, so I think that's the better option.
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
test_multipleIcons.js is basically testing OpenSearch icons, so we should make that clear.
Assignee | ||
Comment 3•2 years ago
|
||
The tests are able to use getting the icon by size for their own checks.
Depends on D196731
Assignee | ||
Comment 4•2 years ago
|
||
This also renames the function, in preparation for iconURI being merged into it.
Depends on D196732
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D196733
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/60d1748d9829
https://hg.mozilla.org/mozilla-central/rev/9d2863f2a18b
https://hg.mozilla.org/mozilla-central/rev/f687e03e530f
https://hg.mozilla.org/mozilla-central/rev/8dd343dfcd66
Comment 9•2 years ago
|
||
Was https://hg.mozilla.org/mozilla-central/rev/8dd343dfcd66d9d424d3b859742c762d8762644d#l5.14 and the one below supposed to be getIconURL()?
Assignee | ||
Comment 10•2 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #9)
Was https://hg.mozilla.org/mozilla-central/rev/8dd343dfcd66d9d424d3b859742c762d8762644d#l5.14 and the one below supposed to be getIconURL()?
No, the preferences page has a confusing system of cloning parts of the engine objects and using that as a "store" for the display. The store is what is containing iconURL
- as demonstrated in the second change on that file.
Description
•