mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-03 07:32:00 +00:00
See: - http://wpt.live/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
22 lines
765 B
HTML
22 lines
765 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const testElements = ["td", "th"];
|
|
|
|
for (const elementName of testElements) {
|
|
// Test a <td> / <th> element with no parent.
|
|
{
|
|
const element = document.createElement(elementName);
|
|
println(`lone ${elementName}.cellIndex = ${element.cellIndex}`);
|
|
}
|
|
|
|
// Test a <td> / <th> element with a parent <tr> element>.
|
|
{
|
|
const tr = document.createElement("tr");
|
|
const element = tr.appendChild(document.createElement(elementName));
|
|
println(`parented ${elementName}.cellIndex = ${element.cellIndex}`);
|
|
}
|
|
}
|
|
});
|
|
</script>
|