#977 ✓invalid
dami

Element.addMethods('SPAN', ...) fails on WebKit

Reported by dami | January 2nd, 2010 @ 02:23 AM

Fatal error on WebKit when calling Element.addMethods on a SPAN element (prototype.js v1.6.1, Windows XP).

Element.addMethods('SPAN', {foo: function(){}});

Tested on both Safari 4.0.4 and Google Chrome 3.0.195.38 : both complain that
TypeError: Result of expression 'destination' [undefined] is not an object, prototype.js:2999

It seems that the specific DOM class for 'SPAN' has no 'prototype' property.

No such problem under MSIE8 or Firefox.

As a temporary fix I changed line 3040 from

if (Object.isUndefined(klass)) continue;

to

if (Object.isUndefined(klass) || Object.isUndefined(klass.prototype)) continue;

which apparently gets rid of the problem, but I have no idea if this is the proper way to solve it.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages