Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8654

Show
Ignore:
Timestamp:
01/18/08 04:31:23 (6 months ago)
Author:
andrew
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/CHANGELOG

    r8651 r8654  
    11*SVN* 
     2 
     3* Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot] 
    24 
    35* Fix missing "var" in Element#insert. Closes #10838. [Lantash] 
  • spinoffs/prototype/trunk/src/dom.js

    r8651 r8654  
    375375        while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); 
    376376      } 
    377       if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex);       
     377      if (nextAncestor && nextAncestor.sourceIndex) 
     378       return (e > a && e < nextAncestor.sourceIndex); 
    378379    } 
    379380     
  • spinoffs/prototype/trunk/test/unit/dom.html

    r8580 r8654  
    9292    } 
    9393     
     94    #getStyle_test { 
     95      margin-left: 2em; 
     96      margin-right: 0.1em; 
     97      font-size: 95%; 
     98      height: 13ex; 
     99      width: 50%; 
     100    } 
     101     
    94102    /* for scroll test on really big screens */ 
    95103    body { 
     
    190198<div><div></div> </div><span> </span> 
    191199</div> 
     200 
     201<div id="getStyle_test">Testing getStyle</div> 
    192202 
    193203 
     
    12571267      assertEqual(0, $('op3').getStyle('opacity')); 
    12581268       
    1259       if(navigator.appVersion.match(/MSIE/)) { 
     1269      if(Prototype.Browser.IE) { 
    12601270        assertEqual('alpha(opacity=30)', $('op1').getStyle('filter')); 
    12611271        assertEqual('progid:DXImageTransform.Microsoft.Blur(strength=10)alpha(opacity=30)', $('op2').getStyle('filter')); 
     
    12641274        assertEqual('alpha(opacity=0)', $('op3').getStyle('filter')); 
    12651275        assertEqual(0.3, $('op4-ie').getStyle('opacity')); 
     1276         
     1277        // make sure IE returns px values for non-px units 
     1278        assert($('getStyle_test').getStyle('margin-left').include('px')); 
     1279         
    12661280      } 
    12671281      // verify that value is still found when using camelized 
     
    12751289      // TODO: This test fails on IE because there seems to be no way 
    12761290      // to calculate this properly (clientWidth/Height returns 0) 
    1277       if(!navigator.appVersion.match(/MSIE/)) { 
     1291      if(!Prototype.Browser.IE) { 
    12781292        assertEqual("14px", $('style_test_dimensions').getStyle('width')); 
    12791293        assertEqual("17px", $('style_test_dimensions').getStyle('height'));