Closed Bug 1055185 Opened 11 years ago Closed 11 years ago

Menu not displayed by old JavaScript script

Categories

(Web Compatibility :: Site Reports, defect)

Firefox 21
x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: epinal99-bugzilla2, Unassigned)

References

Details

Attachments

(1 obsolete file)

Attached file HdV-PlanInfos.htm (testcase) (obsolete) —
I'm not sure if it's a valid bug, but a user posted a message about his website broken with Firefox (but not with IE, Chrome or Opera). Link: http://haras.du.verseau.free.fr/HdV-A/HdV-PlanInfos.htm You should see the menu on the left to browse the website. The code source is very old and dirty (written with Microsoft FrontPage 5.0), and the JS script used to display the menu is from 2001... :D Anyway, I found a regression range, so maybe the bug is in Firefox. good=2013-01-23 bad=2013-01-24 http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2876e73c9b6f&tochange=98ea4d294369
Attachment #8474709 - Attachment is obsolete: true
Just use the URL of the website to test: http://haras.du.verseau.free.fr/HdV-A/HdV-PlanInfos.htm
Web Console & Error Console both display this error: > TypeError: this[i] is undefined for line 372 of the page, which is the last line here: > function preLoadBackgrounds(){ > for(i=0;i<arguments.length;i++){ > this[i]=new Image() > this[i].src=arguments[i] I'll bet that throws an exception, which the author doesn't bother to catch, and so the rest of the JavaScript never executes (including the script that builds that menu). At that line, "this" is the page's Window object. So, looks like this broke (expectedly) as a result of: > 059c7e8541e2 Boris Zbarsky — Bug 828787. Stop allowing indexed expandos on windows. r=peterv See also bug 879807, which had similar breakage. In particular, see this comment from bz: (bug 879807 comment #3) > The new behavior is following the spec, so unless this is happening on a > site that can't get changed and is widely used I think the right solution is > to fix the site to follow the spec too... and this comment from :kohei: (bug 879807 comment #8) > This change has been described in the compatibility document. > https://developer.mozilla.org/en-US/docs/Site_Compatibility_for_Firefox_21 > > You cannot the "this" keyword in the preLoadBackgrounds() because it's the > window object. You can use another variable name instead: > > > function preLoadBackgrounds(){ > > var img > > for(i=0;i<arguments.length;i++){ > > img[i]=new Image() > > img[i].src=arguments[i] > > } > > return img > > }
Blocks: 828787
Component: Layout → Desktop
Product: Core → Tech Evangelism
Version: 21 Branch → Firefox 21
bug 879807 comment #10 indicates that the reporter was able to fix his site with kohei's suggested replacement-script. loic, could you point the site author towards that comment? Sounds like that should fix it.
Flags: needinfo?(epinal99-bugzilla)
Thanks for the fast reply, I tried locally and it fixes the old code. I replied to the website author to explain him the fix. I'll close the bug when it's fixed, thanks.
Flags: needinfo?(epinal99-bugzilla)
Site fixed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: