mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibWeb: Implement HTMLTableCellElement.cellIndex
See: - http://wpt.live/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
This commit is contained in:
committed by
Tim Ledbetter
parent
a58704296c
commit
fa5800ebc5
Notes:
github-actions[bot]
2024-08-06 23:54:34 +00:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/fa5800ebc52 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/996 Reviewed-by: https://github.com/tcl3 ✅
@@ -0,0 +1,22 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user