Fix issue where Safari improperly reports an element as a descendant of itself.
This commit is contained in:
parent
a3f7b712c3
commit
d13a93882c
|
@ -1,3 +1,5 @@
|
|||
* Fix issue where Safari improperly reports an element as a descendant of itself.
|
||||
|
||||
* Greatly simplify IE's implementation of Element#descendantOf.
|
||||
|
||||
* Prevent exception when using Selector to search for an attribute that is not present. [gryn, Andrew Dupont]
|
||||
|
|
|
@ -368,7 +368,7 @@ Element.Methods = {
|
|||
return (element.compareDocumentPosition(ancestor) & 8) === 8;
|
||||
|
||||
if (ancestor.contains)
|
||||
return ancestor.contains(element);
|
||||
return ancestor.contains(element) && ancestor !== element;
|
||||
|
||||
while (element = element.parentNode)
|
||||
if (element == ancestor) return true;
|
||||
|
|
Loading…
Reference in New Issue