File: html-integration-point.html

package info (click to toggle)
firefox-esr 115.14.0esr-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,659,200 kB
  • sloc: cpp: 6,676,648; javascript: 5,690,850; ansic: 3,328,545; python: 1,120,605; asm: 397,163; xml: 180,531; java: 178,838; sh: 68,930; makefile: 20,999; perl: 12,595; objc: 12,561; yacc: 4,583; cs: 3,846; pascal: 2,840; lex: 1,720; ruby: 1,079; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (31 lines) | stat: -rw-r--r-- 1,709 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#tree-construction:html-integration-point">
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<math><annotation-xml id="point-1" encoding="text/html"><xmp>&lt;/xmp&gt;&lt;img></xmp></annotation-xml></math>
<math><annotation-xml id="point-2" encoding="application/xhtml+xml"><style>&lt;/style&gt;&lt;img></style></annotation-xml></math>
<svg><foreignObject id="point-3"><iframe>&lt;/iframe&gt;&lt;img></iframe></foreignObject></svg>
<svg><desc id="point-4"><noembed>&lt;/noembed&gt;&lt;img></noembed></desc></svg>
<svg><title id="point-5"><noframes>&lt;/noframes&gt;&lt;img></noframes></title></svg>

<script>
function generate_test(id) {
  return () => {
    let point = document.querySelector('#' + id);
    assert_not_equals(point.namespaceURI, 'http://www.w3.org/1999/xhtml');
    let rawTextElement = point.firstChild;
    assert_equals(rawTextElement.namespaceURI, 'http://www.w3.org/1999/xhtml');
    assert_equals(rawTextElement.textContent.substr(0, 4), '&lt;',
                  'Entity references should not be decoded.');
  };
}

test(generate_test('point-1'), 'MathML annotation-xml with encoding=text/html should be an HTML integration point');
test(generate_test('point-2'), 'MathML annotation-xml with encoding=application/xhtml+xml should be an HTML integration point');
test(generate_test('point-3'), 'SVG foreignObject should be an HTML integration point');
test(generate_test('point-4'), 'SVG desc should be an HTML integration point');
test(generate_test('point-5'), 'SVG title should be an HTML integration point');
</script>
</body>