Files
sousa-gecko/testing/web-platform/tests/html/rendering/cdata-002.xhtml
T
Martin Robinson 1a24c64a40 Bug 2038029 [wpt PR 59736] - script: Properly render CDATA sections, a=testonly
Automatic update from web-platform-tests
script: Properly render CDATA sections

This change makes it so that CDATA sections are rendered properly during
layout and also that damage is applied to them like it is applied to
text nodes.

Signed-off-by: Martin Robinson <mrobinson@abandonedwig.info>

--

wpt-commits: b2706760129adcd2b753d51d9f8a42bfa985c58b
wpt-pr: 59736
2026-05-12 08:48:18 +00:00

34 lines
1.3 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
<head>
<title>Rendering of dynamically modified CDATA section</title>
<script src="/common/reftest-wait.js"></script>
<link rel="stylesheet" href="/fonts/ahem.css" />
<link rel="author" title="Martin Robinson" href="mailto:martin@abandonedwig.info" />
<link rel="match" href="/css/reference/ref-filled-green-100px-square.xht" />
<meta name="assert" content="CDATA content should be rendered properly when dynamically modified" />
<style>
#container {
font: 100px/1 Ahem;
width: 100px;
height: 100px;
color: green;
background: red;
}
</style>
</head>
<body>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="container"></div>
<script>
const container = document.getElementById("container");
container.appendChild(document.createCDATASection(""));
document.fonts.ready.then(() => {
container.childNodes[0].data = "X";
takeScreenshot();
});
</script>
</body>
</html>