layout/tables/reftests/1220621-1d.html
author Marco Zehe <mzehe@mozilla.com>
Fri, 19 Oct 2018 08:18:04 +0000
changeset 442128 295644de04d2b1abbccd102473cbf3023dfce21a
parent 273022 50c1b2cb6ad1141a2bd53ed8b8c1738b42cf3a45
permissions -rw-r--r--
Bug 1492393 - Make our table index methods aware of cells spanning multiple columns, r=surkov Sometimes, when cells have display:block, and a different cell in the same row has a column span, our index methods did not take these into account. Also, when regular tables encounter such a cell, index calculation failed. Differential Revision: https://phabricator.services.mozilla.com/D7867

<!DOCTYPE html>
<style>
  table {
    table-layout: fixed;
    border: 1px solid black;
    width: 300px;
  }
  td {
    background: yellow;
    border: 1px solid purple;
  }
</style>
<table>
  <colgroup>
    <col>
  </colgroup>
  <colgroup>
    <col>
    <col>
    <col>
  </colgroup>
  <tbody>
    <td>One</td>
    <td>Two</td>
    <td>Three</td>
  </tbody>
</table>
<script>
  var t = document.querySelector("table");
  // Flush layout
  var width = t.offsetWidth;
  // Remove the first colgroup
  document.querySelector("colgroup").remove();
</script>