Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7553 closed bug (duplicate)

IE7 <object> element .getElementsByTagName behaves as if at document level, with workaround

Reported by: http://psmay.com/ Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

(A workaround can be implemented in jQuery to smooth this bug over, but it is not actually a defect with the library itself.)

At least IE7 has a bug with the combination of an <object/> element and the .getElementsByTagName() method. If one attempts to retrieve object.getElementsByTagName('param') (for example), the result is the list of all of the param elements in the entire document, not just descendants of that object element. This behavior is propagated by jQuery through e.g. $('object[name=...]').find('param') and $('object[name=...]').find('param[name=...]').

http://jsfiddle.net/kqaqh/6/ displays the bug in at least IE7 and works correctly in at least Firefox 3.6. It is really only visible in situations with multiple object elements. Two workarounds are also displayed as assigned to cparams and aparams. aparams is theoretically more complete as a solution, but cparams should cover many realistic cases. The library would have to special-case the find method for <object/> and any other affected elements, if any, to use the alternate approach.

Change History (2)

comment:1 Changed 10 years ago by Rick Waldron

Resolution: duplicate
Status: newclosed

comment:2 Changed 10 years ago by Rick Waldron

Duplicate of #750.

Note: See TracTickets for help on using tickets.