tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

html-table-section-element.js (796B)


      1 // https://html.spec.whatwg.org/multipage/#dom-tbody-rows
      2 function testRowsAttribute(localName) {
      3  var elem = document.createElement(localName);
      4  assert_equals(elem.rows.length, 0);
      5 
      6  // Child <p> should *not* count as a row
      7  elem.appendChild(document.createElement("p"));
      8  assert_equals(elem.rows.length, 0);
      9 
     10  // Child <tr> should count as a row
     11  var childTr = document.createElement("tr");
     12  elem.appendChild(childTr);
     13  assert_equals(elem.rows.length, 1);
     14 
     15  // Nested table with child <tr> should *not* count as a row
     16  var nested = document.createElement(localName);
     17  nested.appendChild(document.createElement("tr"));
     18  var nestedTable = document.createElement("table");
     19  nestedTable.appendChild(nested);
     20  childTr.appendChild(nestedTable);
     21  assert_equals(elem.rows.length, 1);
     22 }