Closed Bug 1106043 Opened 10 years ago Closed 9 years ago

Search icon doesn't show for some open search providers that had an icon on Firefox 33

Categories

(Firefox :: Search, defect)

36 Branch
defect
Not set
normal
Points:
2

Tracking

()

VERIFIED FIXED
Firefox 38
Iteration:
38.1 - 26 Jan
Tracking Status
firefox36 + verified
firefox37 + verified
firefox38 --- verified

People

(Reporter: phlsa, Assigned: florian)

References

(Depends on 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file)

translate.google.com has an open search provider that also provides a logo. However, after adding it to the one-off searches, only the default placeholder icon shows up.

I've had the same issue with dict.cc, though that mysteriously resolved itself after a few reloads.
Same (user-visible) issue with fr.wiktionary.org

It's possible the root cause is not the same for all of these websites, but we should investigate, and maybe file more bugs if there are different problems in our implementation.
The ones I've added to a new profile (search providers don't sync) have all gotten the default magnifying glass icon. Ones I know had icons in the old UI and don't now:
  http://stackoverflow.com
  http://www.wolfram-alpha.com

I was starting to think the feature was simply busted, but I do get the expected icon when I add BMO.
Flags: firefox-backlog+
http://www.wolframalpha.com/searchDescription.xml has no <Image> specified. http://www.wolframalpha.com/'s favicon (used as a fallback) is over our threshold for "too large", so we also reject it (bug 361923).

http://fr.wiktionary.org has an <Image> pointing to http://bits.wikimedia.org/favicon/piece.ico, but that icon is also too large. Similarly, the favicon fallback is also too large.

Both of these behave the same in Firefox 33 and Firefox 34 for me.

I get different behavior for http://stackoverflow.com/ and https://translate.google.com/ in Firefox 33 vs. Firefox 34, though. I think both of them rely on our favicon fallback - http://stackoverflow.com/opensearch.xml and https://translate.google.com/opensearch.xml?hl=en both have relative icon URIs, which I don't think we handle.

The new code and old code both pass "target.getAttribute("src")" as the iconURI to addEngine():

https://hg.mozilla.org/mozilla-central/annotate/44344099d119/browser/components/search/content/search.xml#l544
https://hg.mozilla.org/mozilla-central/annotate/44344099d119/browser/base/content/urlbarBindings.xml#l1228

I think the issue is that for the new code (urlbarBindings.xml), that attribute is not the icon URI.

The old code sets the menuitem's src attribute to the icon URI here, via setIcon:
https://hg.mozilla.org/mozilla-central/annotate/44344099d119/browser/components/search/content/search.xml#l390
and that is inherited to the menuitem icon via xbl inheritance:
https://hg.mozilla.org/mozilla-central/annotate/44344099d119/toolkit/content/widgets/menu.xml#l211

The new code sets the button's "image" attribute directly:
https://hg.mozilla.org/mozilla-central/annotate/44344099d119/browser/base/content/urlbarBindings.xml#l1099

So the fix is probably to just change this line:
https://hg.mozilla.org/mozilla-central/annotate/44344099d119/browser/base/content/urlbarBindings.xml#l1240

to use "getAttribute("image")".

We should add a test!
Points: --- → 2
Hardware: x86 → All
Flags: qe-verify+
I am going to untrack it. It seems it has been scheduled for 37.
We should fix this in 36, given that it's a one-line fix.
There are different issues here:
- some providers don't have an icon in 34 and later, but had one before (http://stackoverflow.com, translate.google.com, ...). I'm rephrasing the bug summary here to cover only this, which is a regression we should fix asap and uplift the fix.
- the threshold to dismiss large icons should likely be increased, covered bybug 361923)
- we should handle relative icon paths; filed bug 1125793 to cover this.
- we need tests for open search handling in the new search UI, covered by bug 1120642.
Depends on: 361923
Summary: Search icon doesn't show for some open search providers → Search icon doesn't show for some open search providers that had an icon on Firefox 33
I verified locally that this works as expected.
Assignee: nobody → florian
Attachment #8554500 - Flags: review?(gavin.sharp)
Depends on: 1125793, 1120642
Keywords: regression
Status: NEW → ASSIGNED
Iteration: --- → 38.1 - 26 Jan
Attachment #8554500 - Flags: review?(gavin.sharp) → review+
https://hg.mozilla.org/mozilla-central/rev/9870579b8ea9
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 38
QA Contact: petruta.rasa
Comment on attachment 8554500 [details] [diff] [review]
Patch as described in comment 3

Approval Request Comment
[Feature/regressing bug #]: regression from bug 1088660
[User impact if declined]: some search providers won't have icons after they are installed
[Describe test coverage new/current, TreeHerder]: will be verified by QA
[Risks and why]: low risk, trivial patch
[String/UUID change made/needed]: none.
Attachment #8554500 - Flags: approval-mozilla-beta?
Attachment #8554500 - Flags: approval-mozilla-aurora?
Attachment #8554500 - Flags: approval-mozilla-beta?
Attachment #8554500 - Flags: approval-mozilla-beta+
Attachment #8554500 - Flags: approval-mozilla-aurora?
Attachment #8554500 - Flags: approval-mozilla-aurora+
Florian, I noticed that adding a search engine without icon in Firefox 35 and then opening Firefox 36 beta 7 (or 37 / 38) with the same profile doesn't update the icon.

Considering this, adding several search engines (that didn't had an icon in 35) in builds where the fix landed, should be enough to verify this bug if the icons are correctly displayed?
(In reply to Petruta Rasa [QA] [:petruta] from comment #12)
> Florian, I noticed that adding a search engine without icon in Firefox 35
> and then opening Firefox 36 beta 7 (or 37 / 38) with the same profile
> doesn't update the icon.

Makes sense, as the icon was lost at install-time, not at display-time.
 
> Considering this, adding several search engines (that didn't had an icon in
> 35) in builds where the fix landed, should be enough to verify this bug if
> the icons are correctly displayed?

Yes.
Thanks! :-)

I've verified using several search engines that the icons are properly added using Firefox 36 beta 7, latest Developer  Edition 37.0a2 and latest Nightly 38.0a1 2015-02-05 under Ubuntu 12.04 LTS 32-bit, Windows 7 64-bit and Mac OS X 10.9.5.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: