Closed Bug 805325 Opened 10 years ago Closed 10 years ago

On about:home, searchEngineLogo alt-text is the string "undefined"


(Firefox :: General, defect)

Not set



Firefox 19
Tracking Status
firefox17 --- unaffected
firefox18 + fixed


(Reporter: dholbert, Assigned: dholbert)



(Keywords: regression, Whiteboard: [about-home])


(1 file, 2 obsolete files)

When I visit about:home, the Google logo to the left of the search-box sometimes doesn't render right away, and we show the alt text.

The alt text is "undefined".  This text is a bit unsettling to see on your home-page.

You can also see this if you visit about:home, right-click the google logo, pick "Inspect Element", and click the "markup" button to show the underlying HTML version of the DOM tree.  It looks like this:
<img xmlns="" id="searchEngineLogo" src="data:image/png;base64,[snipping out the giant data URI]" alt="undefined" />
The place where we set logoElt.alt is here:

> 141     let logoElt = document.getElementById("searchEngineLogo");
> 142     logoElt.src = searchEngineInfo.image;
> [...]
> 147     logoElt.alt =; is probably undefined.
Yeah, it's defined at the top of this file:

>  7 const SEARCH_ENGINES = {
>  8   "Google": {
>  9     image: "[data URI]",
> 71   , params: "source=hp&channel=np"
> 72   }

No "name" field there, hence is undefined.
I think we just want to use "searchEngineName" (the index that we use into SEARCH_ENGINES -- "Google" as defined on line 8, quoted in comment 2).
(Looks like this was a regression from bug 749477, which added this use of ".name" on an entry from SEARCH_ENGINES:
whereas previously we were using ".name" on something else)
Blocks: 749477
Assignee: nobody → dholbert
Attached patch fix (obsolete) — Splinter Review
Attachment #674967 - Flags: review?(mak77)
(Confirmed locally that this fixes the alt text, w/ Inspect Element, and also by clearing image cache, reloading, and watching the alt text flash before the image loads.)
Attached patch fix w/ test (obsolete) — Splinter Review
Here's the fix again, with a testcase added to browser_aboutHome.js.

Verified locally that the testcase's final check[1] fails without the fix, and passes after I apply the fix.

[1] isnot(altText, "undefined", ...)
Attachment #674967 - Attachment is obsolete: true
Attachment #674967 - Flags: review?(mak77)
Attachment #674984 - Flags: review?(mak77)
Verified that Firefox 17 is unaffected. (using Inspect Element on about:home)

So, this is a new bug in Firefox 18, which is currently in Aurora channel. Once this lands on trunk, I think we should take this on Aurora as well -- it's a low-risk fix, and we might as well avoid shipping this bug to our Beta & Release users.
Comment on attachment 674984 [details] [diff] [review]
fix w/ test

Review of attachment 674984 [details] [diff] [review]:

OOps, thank you!

::: browser/base/content/test/browser_aboutHome.js
@@ +78,5 @@
> +
> +    let searchEngineLogoElt = doc.getElementById("searchEngineLogo");
> +    ok(searchEngineLogoElt, "Found search engine logo");
> +
> +    var altText = searchEngineLogoElt.alt;

nit: let
Attachment #674984 - Flags: review?(mak77) → review+
Keywords: regression
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: [about-home]
Fixed that & landed:

I'll request Aurora approval once this has cycled on tbpl.
Attachment #674984 - Attachment is obsolete: true
Attachment #675110 - Flags: review+
Flags: in-testsuite+
Attachment #675110 - Attachment description: fix w/ test & review-comment addressed → fix w/ test & review-comment addressed [r=mak]
Comment on attachment 675110 [details] [diff] [review]
fix w/ test & review-comment addressed [r=mak]

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 749477

User impact if declined: Incorrect/broken alt text ("undefined") on search-engine logo <img> element, on about:home 

Testing completed (on m-c, etc.): Verified the fix locally, landed on m-c (and patch includes automated test to verify that it's fixed there)

Risk to taking this patch (and alternatives if risky):  Negligible.

String or UUID changes made by this patch: None.
Attachment #675110 - Flags: approval-mozilla-aurora?
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Attachment #675110 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified fixed for FF 18.b4 Windows 7 x63 and Ubuntu x86, using Inspect Element on about:home.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0(20121212073002)
Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0(20121212073002)
You need to log in before you can comment on or make changes to this bug.