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

Changeset 8703

Show
Ignore:
Timestamp:
01/23/08 12:17:26 (9 months ago)
Author:
tobie
Message:

prototype: Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983.

Files:

Legend:

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

    r8693 r8703  
    11*SVN* 
     2 
     3* Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983. [/dev/urandom, Tobie Langel] 
    24 
    35* Prevent a potential security issue for cross-site ajax requests. [Alexey Feldgendler, sam, Tobie Langel] 
  • spinoffs/prototype/trunk/src/dom.js

    r8654 r8703  
    800800   
    801801  Element._attributeTranslations.write = { 
    802     names: Object.clone(Element._attributeTranslations.read.names), 
     802    names: Object.extend({ 
     803      cellpadding: 'cellPadding', 
     804      cellspacing: 'cellSpacing' 
     805    }, Element._attributeTranslations.read.names), 
    803806    values: { 
    804807      checked: function(element, value) { 
  • spinoffs/prototype/trunk/test/unit/dom.html

    r8655 r8703  
    282282</form> 
    283283 
    284 <table id="write_attribute_table"
     284<table id="write_attribute_table" cellpadding="6" cellspacing="4"
    285285  <tr><td id="write_attribute_td">A</td><td>B</td></tr> 
    286286  <tr><td>C</td></tr> 
     
    13141314      assertEnumEqual(['1', '2'], elements.invoke('readAttribute', 'foo')); 
    13151315      assertEnumEqual(['2', null], elements.invoke('readAttribute', 'bar')); 
     1316 
     1317      var table = $('write_attribute_table'); 
     1318      assertEqual('4', table.readAttribute('cellspacing')); 
     1319      assertEqual('6', table.readAttribute('cellpadding')); 
    13161320    }}, 
    13171321     
     
    13641368       
    13651369      assert(p.writeAttribute({style: 'width: 5px;'}).readAttribute('style').toLowerCase().include('width'));       
     1370 
     1371      var table = $('write_attribute_table'); 
     1372      table.writeAttribute('cellspacing', '2') 
     1373      table.writeAttribute('cellpadding', '3') 
     1374      assertEqual('2', table.readAttribute('cellspacing')); 
     1375      assertEqual('3', table.readAttribute('cellpadding')); 
    13661376    }}, 
    13671377