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

Ticket #11474 (new defect)

Opened 3 months ago

Last modified 3 months ago

[PATCH] [TEST] Element#select(element, '#id') fails in IE when is not in the document

Reported by: jdalton Assigned to: sam
Priority: normal Milestone: 2.x
Component: Prototype Version: edge
Severity: normal Keywords:
Cc:

Description

samples are better than long explainations so:

var oParent = new Element("div", { backgroundColor: 'green' }), oTD;
  oParent.update("<table><tr><td id='myTD'></td></tr></table>");
  oTD = oParent.getElementsBySelector('[id=myTD]')[0]; // works fine
  // -> oTD element
  oTD = oParent.getElementsBySelector('TD')[0]; // works fine
  // -> oTD element
  oTD = oParent.getElementsBySelector('#myTD')[0]; // bugs on IE but ok on firefox
  // -> oTD 'undefined'
  $(document.body).appendChild(oParent); // let's append the elements to the doc
  oTD = oParent.getElementsBySelector('#myTD')[0]; // now works
  // -> oTD element

Attachments

testSelectorNotInsertedNodes.diff (0.7 kB) - added by jdalton on 03/31/08 05:04:21.
made by Kangax
select_id_ie_patch_test.diff (1.5 kB) - added by jdalton on 03/31/08 05:04:42.
patch by Kangax
select_id_ie_patch_jd.diff (1.7 kB) - added by jdalton on 03/31/08 05:05:28.
this one keeps the IE branch sep and only brute forces if the element is not attached.

Change History

03/31/08 05:04:21 changed by jdalton

  • attachment testSelectorNotInsertedNodes.diff added.

made by Kangax

03/31/08 05:04:42 changed by jdalton

  • attachment select_id_ie_patch_test.diff added.

patch by Kangax

03/31/08 05:05:28 changed by jdalton

  • attachment select_id_ie_patch_jd.diff added.

this one keeps the IE branch sep and only brute forces if the element is not attached.

03/31/08 05:07:05 changed by jdalton