Files
sousa-gecko/testing/web-platform/tests/html/syntax/serializing-html-fragments/serializing-cdata-in-html-document.html
T
Fredrik Söderquist cc52bc7b3e Bug 1963399 [wpt PR 52246] - Serialize CDATASections in HTML documents the same as Text,
Automatic update from web-platform-tests
Serialize CDATASections in HTML documents the same as Text

https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments

Fixed: 40791925
Change-Id: I4c46e6143958cb3de9052ee51fc9756c61272cba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6430108
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1453761}

--

wpt-commits: fe92d5e9ea136e2c97e75710af6189178faff5dd
wpt-pr: 52246

Differential Revision: https://phabricator.services.mozilla.com/D248753
2025-05-12 09:16:28 +00:00

13 lines
593 B
HTML

<!DOCTYPE html>
<title>Serializing CDATA in an HTML document</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(t => {
const doc = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg"><![CDATA[<img>]]></svg>', 'application/xml');
const el = document.adoptNode(doc.documentElement);
assert_equals(el.outerHTML, '<svg xmlns="http://www.w3.org/2000/svg">&lt;img&gt;</svg>');
});
</script>