diff --git a/CHANGELOG b/CHANGELOG index 8a035e8..60aeb23 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot] + * Fix missing "var" in Element#insert. Closes #10838. [Lantash] * Add Test.Unit.MessageTemplate class. Add flunk, buildMessage and assertBlock methods to Test.Unit.Assertions. Refactor accordingly. [Tobie Langel] diff --git a/src/dom.js b/src/dom.js index 9296bc7..3db2992 100644 --- a/src/dom.js +++ b/src/dom.js @@ -374,7 +374,8 @@ Element.Methods = { do { ancestor = ancestor.parentNode; } while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); } - if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); + if (nextAncestor && nextAncestor.sourceIndex) + return (e > a && e < nextAncestor.sourceIndex); } while (element = element.parentNode) diff --git a/test/unit/dom.html b/test/unit/dom.html index 0828ad5..3ebcabf 100644 --- a/test/unit/dom.html +++ b/test/unit/dom.html @@ -91,6 +91,14 @@ background: #000; } + #getStyle_test { + margin-left: 2em; + margin-right: 0.1em; + font-size: 95%; + height: 13ex; + width: 50%; + } + /* for scroll test on really big screens */ body { height: 40000px; @@ -190,6 +198,8 @@