html-integration-point.html (1709B)
1 <!DOCTYPE html> 2 <link rel="help" href="https://html.spec.whatwg.org/multipage/parsing.html#tree-construction:html-integration-point"> 3 <body> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <math><annotation-xml id="point-1" encoding="text/html"><xmp></xmp><img></xmp></annotation-xml></math> 8 <math><annotation-xml id="point-2" encoding="application/xhtml+xml"><style></style><img></style></annotation-xml></math> 9 <svg><foreignObject id="point-3"><iframe></iframe><img></iframe></foreignObject></svg> 10 <svg><desc id="point-4"><noembed></noembed><img></noembed></desc></svg> 11 <svg><title id="point-5"><noframes></noframes><img></noframes></title></svg> 12 13 <script> 14 function generate_test(id) { 15 return () => { 16 let point = document.querySelector('#' + id); 17 assert_not_equals(point.namespaceURI, 'http://www.w3.org/1999/xhtml'); 18 let rawTextElement = point.firstChild; 19 assert_equals(rawTextElement.namespaceURI, 'http://www.w3.org/1999/xhtml'); 20 assert_equals(rawTextElement.textContent.substr(0, 4), '<', 21 'Entity references should not be decoded.'); 22 }; 23 } 24 25 test(generate_test('point-1'), 'MathML annotation-xml with encoding=text/html should be an HTML integration point'); 26 test(generate_test('point-2'), 'MathML annotation-xml with encoding=application/xhtml+xml should be an HTML integration point'); 27 test(generate_test('point-3'), 'SVG foreignObject should be an HTML integration point'); 28 test(generate_test('point-4'), 'SVG desc should be an HTML integration point'); 29 test(generate_test('point-5'), 'SVG title should be an HTML integration point'); 30 </script> 31 </body>