Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot]

This commit is contained in:
Andrew Dupont 2008-01-18 04:31:23 +00:00
parent 7052c5a60c
commit 89cbe08e1c
3 changed files with 20 additions and 3 deletions

View File

@ -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]

View File

@ -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)

View File

@ -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 @@
<div><div></div> </div><span> </span>
</div>
<div id="getStyle_test">Testing getStyle</div>
<div id="nav_tests_isolator">
<div id="nav_test_first_sibling"></div>
@ -1256,13 +1266,17 @@
$('op3').setStyle({opacity: 0});
assertEqual(0, $('op3').getStyle('opacity'));
if(navigator.appVersion.match(/MSIE/)) {
if(Prototype.Browser.IE) {
assertEqual('alpha(opacity=30)', $('op1').getStyle('filter'));
assertEqual('progid:DXImageTransform.Microsoft.Blur(strength=10)alpha(opacity=30)', $('op2').getStyle('filter'));
$('op2').setStyle({opacity:''});
assertEqual('progid:DXImageTransform.Microsoft.Blur(strength=10)', $('op2').getStyle('filter'));
assertEqual('alpha(opacity=0)', $('op3').getStyle('filter'));
assertEqual(0.3, $('op4-ie').getStyle('opacity'));
// make sure IE returns px values for non-px units
assert($('getStyle_test').getStyle('margin-left').include('px'));
}
// verify that value is still found when using camelized
// strings (function previously used getPropertyValue()
@ -1274,7 +1288,7 @@
// margin, padding, or borders
// TODO: This test fails on IE because there seems to be no way
// to calculate this properly (clientWidth/Height returns 0)
if(!navigator.appVersion.match(/MSIE/)) {
if(!Prototype.Browser.IE) {
assertEqual("14px", $('style_test_dimensions').getStyle('width'));
assertEqual("17px", $('style_test_dimensions').getStyle('height'));
}