* Fix a bug in the IE-specific Element#descendantOf logic. [Nicholas, Andrew Dupont]
This commit is contained in:
parent
6e080aa186
commit
26b8033295
@ -1,3 +1,5 @@
|
||||
* Fix a bug in the IE-specific Element#descendantOf logic. [Nicholas, Andrew Dupont]
|
||||
|
||||
* Make Ajax.Updater clone its options hash before modifying it. Prevents memory leaks in Ajax.PeriodicalUpdater. Closes #10049 [Mislav Marohnić, Tobie Langel].
|
||||
|
||||
* Remove useless variable in Selector.handlers.child. Closes #10006 [kuriyama]
|
||||
|
@ -359,6 +359,7 @@ Element.Methods = {
|
||||
|
||||
descendantOf: function(element, ancestor) {
|
||||
element = $(element), ancestor = $(ancestor);
|
||||
var originalAncestor = ancestor;
|
||||
|
||||
if (element.compareDocumentPosition)
|
||||
return (element.compareDocumentPosition(ancestor) & 8) === 8;
|
||||
@ -374,7 +375,7 @@ Element.Methods = {
|
||||
}
|
||||
|
||||
while (element = element.parentNode)
|
||||
if (element == ancestor) return true;
|
||||
if (element == originalAncestor) return true;
|
||||
return false;
|
||||
},
|
||||
|
||||
|
@ -1031,6 +1031,8 @@
|
||||
assert(!$('sibling').descendantOf('child'), 'sibling < child');
|
||||
assert(!$('great-grand-child').descendantOf('not-in-the-family'), 'great-grand-child < not-in-the-family');
|
||||
assert(!$('child').descendantOf('not-in-the-family'), 'child < not-in-the-family');
|
||||
|
||||
assert(!$(document.body).descendantOf('great-grand-child'));
|
||||
}},
|
||||
|
||||
testChildOf: function() {with(this) {
|
||||
|
Loading…
Reference in New Issue
Block a user