<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,5 @@
+* Ensure Selector.handlers.id finds the proper element even when it's not attached to the document. [jddalton]
+
 * Fix Position.within in IE. [jddalton]
 
 * Fix the deprecated Position.withinIncludingScrollOffsets. [jddalton]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -467,16 +467,8 @@ Object.extend(Selector, {
     id: function(nodes, root, id, combinator) {
       var targetNode = $(id), h = Selector.handlers;
       if (!targetNode) {
-        var needsToSearch = false;
-        // IE and Opera don't find elements by ID if they're not attached
-        // to the document.
-        if (Prototype.Browser.IE &amp;&amp; (root.sourceIndex &lt; 1 ||
-         root === document)) {
-          needsToSearch = true;        
-        } else if (Prototype.Browser.Opera &amp;&amp;
-         (root.compareDocumentPosition(document) &amp; 1) === 1) {
-          needsToSearch = true;   
-        }
+        var needsToSearch = root === document || root.sourceIndex &lt; 1 ||
+          !Element.descendantOf(root, document.documentElement);
         
         if (needsToSearch) {
           var nodes = root.getElementsByTagName('*');</diff>
      <filename>src/selector.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5fffac9ded0fc1b41429a876c3f0c62088a00189</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Dupont</name>
    <email>prototype@andrewdupont.net</email>
  </author>
  <url>http://github.com/sstephenson/prototype/commit/4b2913c79f9d57e96360294d7a134593a8819c91</url>
  <id>4b2913c79f9d57e96360294d7a134593a8819c91</id>
  <committed-date>2008-07-16T11:08:52-07:00</committed-date>
  <authored-date>2008-07-16T11:08:52-07:00</authored-date>
  <message>Ensure Selector.handlers.id finds the proper element even when it's not attached to the document. [#198 state:resolved]</message>
  <tree>838ab35060e38ec83507438ffb7c6f187f12a430</tree>
  <committer>
    <name>Andrew Dupont</name>
    <email>prototype@andrewdupont.net</email>
  </committer>
</commit>
