public
Description: Prototype JavaScript framework
Homepage: http://prototypejs.org/
Clone URL: git://github.com/sstephenson/prototype.git
Ensure Selector.handlers.id finds the proper element even when it's not 
attached to the document. [#198 state:resolved]
Wed Jul 16 11:08:52 -0700 2008
commit  4b2913c79f9d57e96360294d7a134593a8819c91
tree    838ab35060e38ec83507438ffb7c6f187f12a430
parent  5fffac9ded0fc1b41429a876c3f0c62088a00189
...
 
 
1
2
3
...
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
+* Ensure Selector.handlers.id finds the proper element even when it's not attached to the document. [jddalton]
0
+
0
 * Fix Position.within in IE. [jddalton]
0
 
0
 * Fix the deprecated Position.withinIncludingScrollOffsets. [jddalton]
...
467
468
469
470
471
472
473
474
475
476
477
478
479
 
 
480
481
482
...
467
468
469
 
 
 
 
 
 
 
 
 
 
470
471
472
473
474
0
@@ -467,16 +467,8 @@ Object.extend(Selector, {
0
     id: function(nodes, root, id, combinator) {
0
       var targetNode = $(id), h = Selector.handlers;
0
       if (!targetNode) {
0
- var needsToSearch = false;
0
- // IE and Opera don't find elements by ID if they're not attached
0
- // to the document.
0
- if (Prototype.Browser.IE && (root.sourceIndex < 1 ||
0
- root === document)) {
0
- needsToSearch = true;
0
- } else if (Prototype.Browser.Opera &&
0
- (root.compareDocumentPosition(document) & 1) === 1) {
0
- needsToSearch = true;
0
- }
0
+ var needsToSearch = root === document || root.sourceIndex < 1 ||
0
+ !Element.descendantOf(root, document.documentElement);
0
         
0
         if (needsToSearch) {
0
           var nodes = root.getElementsByTagName('*');

Comments

    No one has commented yet.