8000 HTML: tentative test for serializing <> in attribute values · web-platform-tests/wpt@44709aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 44709aa

Browse files
committed
HTML: tentative test for serializing <> in attribute values
See whatwg/html#6362
1 parent ea49709 commit 44709aa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<title>Escape "&lt;" and ">" in attribute values when serializing</title>
3+
<script src="/resources/testharness.js"></script>
4+
<script src="/resources/testharnessreport.js"></script>
5+
<div id="log"></div>
6+
7+
<span id="test"><a b="<>"></a></span>
8+
9+
<script>
10+
const test_el = document.getElementById("test");
11+
12+
test(() => {
13+
assert_equals(test_el.innerHTML, "<a b=\"&lt;&gt;\"></a>");
14+
}, "innerHTML");
15+
16+
test(() => {
17+
assert_equals(test_el.outerHTML, "<span id=\"test\"><a b=\"&lt;&gt;\"></a></span>");
18+
}, "outerHTML");
19+
</script>

0 commit comments

Comments
 (0)
0