Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /quirks/tables-inherit-color-from-body-quirk-006.html - WPT Dashboard Interop Dashboard
<!-- Quirks Mode -->
<title>Quirks Mode: The tables inherit color from body quirk - Table without body, light mode</title>
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
<link rel="help" href="https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk">
<link rel="match" href="tables-inherit-color-from-body-quirk-004-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
html { color-scheme: light; }
body { color: red; height: min-content; margin: 0; }
p { color: initial; }
div { color: red; display: flow-root; margin: 0 8px; }
table { font: 200px/1 Ahem; }
</style>
<script>
// At this point, the <body> has not been created yet.
// And replacing the <html> prevents the creation of the <body>.
let root = document.documentElement;
let div = document.createElement("div");
div.innerHTML = `
<p>Test passes if there is a square filled with initial color and <strong>no red</strong>.</p>
<table cellspacing="0" cellpadding="0">
<tr>
<td>X</td>
</tr>
</table>
`;
root.append(div);
document.documentElement.remove();
document.append(root.cloneNode(true));
</script>