Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 3 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-break/table/table-parts-offsets.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="author" title="Andreu Botella" href="mailto:abotella@igalia.com">
<div style="column-width:200px; column-gap: 0; column-fill:auto; height:70px; width:600px; background:yellow;">
<div id="table" style="display:table; border-spacing:7px; border:2px solid; padding:1px;">
<div id="colgroup" style="display:table-column-group;">
<div id="col" style="display:table-column;"></div>
<div id="col2" style="display:table-column;"></div>
</div>
<div id="colgroup2" style="display:table-column-group;">
<div id="col3" style="display:table-column;"></div>
</div>
<div id="rowgroup" style="display:table-row-group;">
<div id="row" style="display:table-row;">
<div id="cell" style="display:table-cell;">
<div id="content" style="width:50px; height:100px; background:blue;"></div>
</div>
<div id="cell2" style="display:table-cell;">
<div id="content2" style="width:50px; height:100px; background:blue;"></div>
</div>
<div id="cell3" style="display:table-cell;">
<div id="content3" style="width:50px; height:100px; background:blue;"></div>
</div>
</div>
<div id="row2" style="display:table-row;">
<div id="cell4" style="display:table-cell;">
<div id="content4" style="width:50px; height: 50px; background: blue;"></div>
</div>
</div>
</div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_equals(table.offsetTop, 8, "offsetTop");
assert_equals(table.offsetLeft, 8, "offsetLeft");
assert_equals(table.offsetWidth, 184, "offsetWidth");
assert_equals(table.offsetHeight, 177, "offsetHeight");
}, "table");
test(() => {
assert_equals(colgroup.offsetTop, 18, "offsetTop");
assert_equals(colgroup.offsetLeft, 18, "offsetLeft");
assert_equals(colgroup.offsetWidth, 107, "offsetWidth");
assert_equals(colgroup.offsetHeight, 157, "offsetHeight");
}, "colgroup");
test(() => {
assert_equals(col.offsetTop, 18, "offsetTop");
assert_equals(col.offsetLeft, 18, "offsetLeft");
assert_equals(col.offsetWidth, 50, "offsetWidth");
assert_equals(col.offsetHeight, 157, "offsetHeight");
}, "col");
test(() => {
assert_equals(col2.offsetTop, 18, "offsetTop");
assert_equals(col2.offsetLeft, 75, "offsetLeft");
assert_equals(col2.offsetWidth, 50, "offsetWidth");
assert_equals(col2.offsetHeight, 157, "offsetHeight");
}, "col2");
test(() => {
assert_equals(colgroup2.offsetTop, 18, "offsetTop");
assert_equals(colgroup2.offsetLeft, 132, "offsetLeft");
assert_equals(colgroup2.offsetWidth, 50, "offsetWidth");
assert_equals(colgroup2.offsetHeight, 157, "offsetHeight");
}, "colgroup2");
test(() => {
assert_equals(col3.offsetTop, 18, "offsetTop");
assert_equals(col3.offsetLeft, 132, "offsetLeft");
assert_equals(col3.offsetWidth, 50, "offsetWidth");
assert_equals(col3.offsetHeight, 157, "offsetHeight");
}, "col3");
test(() => {
assert_equals(rowgroup.offsetTop, 18, "offsetTop");
assert_equals(rowgroup.offsetLeft, 18, "offsetLeft");
assert_equals(rowgroup.offsetWidth, 164, "offsetWidth");
assert_equals(rowgroup.offsetHeight, 157, "offsetHeight");
}, "rowgroup");
test(() => {
assert_equals(row.offsetTop, 18, "offsetTop");
assert_equals(row.offsetLeft, 18, "offsetLeft");
assert_equals(row.offsetWidth, 164, "offsetWidth");
assert_equals(row.offsetHeight, 100, "offsetHeight");
}, "row");
test(() => {
assert_equals(cell.offsetTop, 18, "offsetTop");
assert_equals(cell.offsetLeft, 18, "offsetLeft");
assert_equals(cell.offsetWidth, 50, "offsetWidth");
assert_equals(cell.offsetHeight, 100, "offsetHeight");
}, "cell");
test(() => {
assert_equals(content.offsetTop, 18, "offsetTop");
assert_equals(content.offsetLeft, 18, "offsetLeft");
assert_equals(content.offsetWidth, 50, "offsetWidth");
assert_equals(content.offsetHeight, 100, "offsetHeight");
}, "content");
test(() => {
assert_equals(cell2.offsetTop, 18, "offsetTop");
assert_equals(cell2.offsetLeft, 75, "offsetLeft");
assert_equals(cell2.offsetWidth, 50, "offsetWidth");
assert_equals(cell2.offsetHeight, 100, "offsetHeight");
}, "cell2");
test(() => {
assert_equals(content2.offsetTop, 18, "offsetTop");
assert_equals(content2.offsetLeft, 75, "offsetLeft");
assert_equals(content2.offsetWidth, 50, "offsetWidth");
assert_equals(content2.offsetHeight, 100, "offsetHeight");
}, "content2");
test(() => {
assert_equals(cell3.offsetTop, 18, "offsetTop");
assert_equals(cell3.offsetLeft, 132, "offsetLeft");
assert_equals(cell3.offsetWidth, 50, "offsetWidth");
assert_equals(cell3.offsetHeight, 100, "offsetHeight");
}, "cell3");
test(() => {
assert_equals(content3.offsetTop, 18, "offsetTop");
assert_equals(content3.offsetLeft, 132, "offsetLeft");
assert_equals(content3.offsetWidth, 50, "offsetWidth");
assert_equals(content3.offsetHeight, 100, "offsetHeight");
}, "content3");
test(() => {
assert_equals(row2.offsetTop, 55, "offsetTop");
assert_equals(row2.offsetLeft, 218, "offsetLeft");
assert_equals(row2.offsetWidth, 164, "offsetWidth");
assert_equals(row2.offsetHeight, 50, "offsetHeight");
}, "row2");
test(() => {
assert_equals(cell4.offsetTop, 55, "offsetTop");
assert_equals(cell4.offsetLeft, 218, "offsetLeft");
assert_equals(cell4.offsetWidth, 50, "offsetWidth");
assert_equals(cell4.offsetHeight, 50, "offsetHeight");
}, "cell4");
test(() => {
assert_equals(content4.offsetTop, 55, "offsetTop");
assert_equals(content4.offsetLeft, 218, "offsetLeft");
assert_equals(content4.offsetWidth, 50, "offsetWidth");
assert_equals(content4.offsetHeight, 50, "offsetHeight");
}, "content4");
</script>