Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10413 (closed defect: fixed)

Opened 9 months ago

Last modified 7 months ago

[PATCH] Prototype 1.6 : IE6/7 Bug : Elements created via Element#insert (or any other way by javscript) always report true when used as ancestor in Element#descendantOf, also Element#descendantOf may behave improperly if there are dynamically generated elements in DOM tree

Reported by: martymix Assigned to: savetheclocktower
Priority: high Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords: 1.6.1
Cc:

Description

<p id="foo">Blah</p>

<div id="bar"><p>...</p></div>

$('foo').descendantOf('bar') returns false in all browsers, correctly.

<p id="foo">Blah</p>

$(document.body).insert('<div id="bar"></div>')

incorrectly returns true in IE6/7

It has to do with the element.sourceIndex if statement, as this worked fine in prototype 1.5.1.1

Attachments

descendantOf.patch (0.9 kB) - added by kamil.szot on 12/09/07 07:05:49.
patch for correct determining if element is descendantOf another element even if element is generated dynamically, or ancestor following tested ancestor is generated dynamically so they don't have sourceIndex set

Change History

12/09/07 07:05:49 changed by kamil.szot

  • attachment descendantOf.patch added.

patch for correct determining if element is descendantOf another element even if element is generated dynamically, or ancestor following tested ancestor is generated dynamically so they don't have sourceIndex set

12/09/07 07:10:02 changed by kamil.szot

  • priority changed from normal to high.

12/09/07 07:12:32 changed by kamil.szot

  • summary changed from Prototype 1.6 : IE6/7 Bug : Elements created via Element#insert always report true when used as ancestor in Element#descendantOf to Prototype 1.6 : IE6/7 Bug : Elements created via Element#insert (or any other way by javscript) always report true when used as ancestor in Element#descendantOf, also Element#descendantOf may behave improperly if there are dynamically generated elements in DOM tree.

12/10/07 06:04:47 changed by kangax

  • summary changed from Prototype 1.6 : IE6/7 Bug : Elements created via Element#insert (or any other way by javscript) always report true when used as ancestor in Element#descendantOf, also Element#descendantOf may behave improperly if there are dynamically generated elements in DOM tree to [PATCH] Prototype 1.6 : IE6/7 Bug : Elements created via Element#insert (or any other way by javscript) always report true when used as ancestor in Element#descendantOf, also Element#descendantOf may behave improperly if there are dynamically generated elements in DOM tree.

12/17/07 07:08:22 changed by savetheclocktower

  • owner changed from sam to savetheclocktower.
  • status changed from new to assigned.

12/17/07 16:58:47 changed by savetheclocktower

  • keywords set to 1.6.1.

01/18/08 04:31:32 changed by andrew

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [8654]) Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot]