HTMLElement-offsetFoo-in-table-cell.html 619 B

1234567891011121314151617181920212223242526
  1. <style>
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. }
  6. table {
  7. position: relative;
  8. top: 100px;
  9. left: 50px;
  10. }
  11. </style><table><tr><td><canvas id="c"></canvas></td></tr></table>
  12. <script src="../include.js"></script>
  13. <script>
  14. test(() => {
  15. const c = document.getElementById("c");
  16. println("");
  17. for (let n = c; n; n = n.offsetParent) {
  18. println("nodeName: " + n.nodeName);
  19. println("offsetTop: " + n.offsetTop);
  20. println("offsetLeft: " + n.offsetLeft);
  21. println("offsetParent: " + n.offsetParent);
  22. println("");
  23. }
  24. });
  25. </script>