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

Ticket #8481 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] make Element#readAttribute work for cloned elements in IE

Reported by: chem Assigned to: sam
Priority: normal Milestone: 1.x
Component: Prototype Version: edge
Severity: normal Keywords: 1.6 ready discuss
Cc:

Description

Scenario: Use $$ to find all elements with a certain attribute, then clone them. As $$ internally uses readAttribute() (or someone may use it by itself), it touches the attribute being search for: var attribute = element.attributes[name];. Cloned elements are no longer completely separated copies.

A bug in IE, which I've simplified to a test-case: http://home.parse.nl/~michiel/ietest/ietest.html shows that after touching a key in the attributes-collection in IE, results in it becoming a reference when cloned, rather then a copy. Changing the value of the attribute on the original element results in both copies being updated.

I have no solution, other then using getAttribute(..., 2) rather then inspecting the .attributes-collection.

Both IE6 and IE7 suffer from this defect.

Attachments

readAttribute.diff (6.7 kB) - added by Tobie on 07/23/07 04:28:48.

Change History

06/25/07 19:10:31 changed by savetheclocktower

Christ almighty.

07/23/07 04:13:30 changed by Tobie

  • keywords set to 1.6 ready discuss.
  • summary changed from readAttribute triggers a bug in IE, cloned elements touched by it are broken to [PATCH] make Element.readAttribute work for cloned elements in IE.

OK, I think I coded around this issue while maintaining the same set of functionalities.

07/23/07 04:28:48 changed by Tobie

  • attachment readAttribute.diff added.

07/23/07 04:41:25 changed by Tobie

  • summary changed from [PATCH] make Element.readAttribute work for cloned elements in IE to [PATCH] make Element#readAttribute work for cloned elements in IE.

07/24/07 17:31:26 changed by sam

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

(In [7222]) prototype: Make Element#readAttribute work for cloned elements in IE. Closes #8481.