Reviewers: ihab.awad,

Description:
Domita doesn't support TR.sectionRowIndex.
This change fixes that.

Please review this at http://codereview.appspot.com/88116

Affected files:
  M     src/com/google/caja/plugin/domita.js
  M     tests/com/google/caja/plugin/domita_test_untrusted.html


Index: tests/com/google/caja/plugin/domita_test_untrusted.html
===================================================================
--- tests/com/google/caja/plugin/domita_test_untrusted.html     (revision 3549)
+++ tests/com/google/caja/plugin/domita_test_untrusted.html     (working copy)
@@ -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 id="test-table-elements-td-b11">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>

@@ -2241,6 +2261,13 @@
   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',
                function testDocumentBodyAppendChild() {
   var notWhitespaceRe = new RegExp('\\S');
Index: src/com/google/caja/plugin/domita.js
===================================================================
--- src/com/google/caja/plugin/domita.js        (revision 3549)
+++ src/com/google/caja/plugin/domita.js        (working copy)
@@ -2583,7 +2583,7 @@
       classUtils.exportFields(
           this,
           ['colSpan','cells','rowSpan','rows','rowIndex','align',
-           'vAlign','nowrap']);
+           'vAlign','nowrap','sectionRowIndex']);
     }
     classUtils.extend(TameTableCompElement, TameElement);
     TameTableCompElement.prototype.getColSpan = function () {
@@ -2612,6 +2612,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;
     };


Reply via email to