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

Changeset 8800

Show
Ignore:
Timestamp:
02/04/08 23:22:18 (7 months ago)
Author:
tobie
Message:

prototype: Avoid breaking Element.prototype in browsers which support it. Closes #11004.

Files:

Legend:

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

    r8799 r8800  
     1* Avoid breaking Element.prototype in browsers which support it. Closes #11004. [cfis, Tobie Langel] 
     2 
    13* Prevent Element#cumulativeOffset, Element#getOffsetParent, Element#positionedOffset, Element#viewportOffset and Element#clonePosition from throwing an error in IE when called on a parent-less element. Closes #9416, #10192, #10248. [ronstoney, psiborg, kangax] 
    24 
  • spinoffs/prototype/trunk/src/dom.js

    r8799 r8800  
    5858  }; 
    5959  Object.extend(this.Element, element || { }); 
     60  if (element) this.Element.prototype = element.prototype; 
    6061}).call(window); 
    6162 
  • spinoffs/prototype/trunk/test/unit/dom.html

    r8799 r8800  
    55  <title>Prototype Unit test file</title> 
    66  <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
     7  <script type="text/javascript" charset="utf-8"> 
     8    var originalElement = Element; 
     9  </script> 
    710  <script src="../../dist/prototype.js" type="text/javascript"></script> 
    811  <script src="../lib/unittest.js" type="text/javascript"></script> 
     
    14441447      if (Prototype.Browser.IE) 
    14451448        assertMatch(/name=["']?my_input_field["']?/, $('my_input_field').outerHTML); 
     1449       
     1450      if (originalElement && Prototype.BrowserFeatures.ElementExtensions) { 
     1451        Element.prototype.fooBar = Prototype.emptyFunction 
     1452        assertRespondsTo('fooBar', new Element('div')); 
     1453      } 
    14461454    }}, 
    14471455