Author: felix8a
Date: Wed Jul 8 02:53:42 2009
New Revision: 3558
Modified:
trunk/src/com/google/caja/plugin/domita.js
trunk/tests/com/google/caja/plugin/domita_test_untrusted.html
Log:
Support TR.sectionRowIndex
http://codereview.appspot.com/88116
Domita doesn't support TR.sectionRowIndex.
This change fixes that.
[email protected]
Modified: trunk/src/com/google/caja/plugin/domita.js
==============================================================================
--- trunk/src/com/google/caja/plugin/domita.js (original)
+++ trunk/src/com/google/caja/plugin/domita.js Wed Jul 8 02:53:42 2009
@@ -2505,7 +2505,7 @@
classUtils.exportFields(
this,
['colSpan','cells','rowSpan','rows','rowIndex','align',
- 'vAlign','nowrap']);
+ 'vAlign','nowrap','sectionRowIndex']);
}
___.extend(TameTableCompElement, TameElement);
TameTableCompElement.prototype.getColSpan = function () {
@@ -2533,6 +2533,9 @@
};
TameTableCompElement.prototype.getRowIndex = function () {
return this.node___.rowIndex;
+ };
+ TameTableCompElement.prototype.getSectionRowIndex = function () {
+ return this.node___.sectionRowIndex;
};
TameTableCompElement.prototype.getAlign = function () {
return this.node___.align;
Modified: trunk/tests/com/google/caja/plugin/domita_test_untrusted.html
==============================================================================
--- trunk/tests/com/google/caja/plugin/domita_test_untrusted.html
(original)
+++ trunk/tests/com/google/caja/plugin/domita_test_untrusted.html Wed Jul
8 02:53:42 2009
@@ -291,6 +291,26 @@
Test anchor computed styles don't leak history
</p>
+<div class="testcontainer" id="test-table-elements">
+ <table>
+ <thead>
+ <tr>
+ <td>h00</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>b00</td>
+ <td>b01</td>
+ </tr>
+ <tr id="test-table-elements-tr-b1">
+ <td>b10</td>
+ <td>b11</td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
<p class="testcontainer" id="test-document-body-appendChild"
>I should be the last element until something is appended to
document.body</p>
@@ -2239,6 +2259,13 @@
window.getComputedStyle(p1, null).getPropertyValue('padding-left'));
pass('test-anchor-computed-styles-dont-leak-history');
+});
+
+jsunitRegister('testTableElements',
+ function testTableElements() {
+ var tr_b1 = document.getElementById('test-table-elements-tr-b1');
+ assertEquals(1, tr_b1.sectionRowIndex);
+ assertEquals(2, tr_b1.rowIndex);
});
jsunitRegister('testDocumentBodyAppendChild',