tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

innerhtml-03.xhtml (2257B)


      1 <?xml version="1.0" encoding="UTF-8" ?>
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <head>
      4 <title>innerHTML in XHTML</title>
      5 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/>
      6 <link rel="help" href="http://html5.org/specs/dom-parsing.html#dom-innerhtml"/>
      7 <link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/>
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 </head>
     11 <body>
     12 <div id="log"></div>
     13 <script><![CDATA[
     14 test(function() {
     15  var el = document.createElement("div");
     16  el.appendChild(document.createElement("xmp"))
     17    .appendChild(document.createElement("span"))
     18    .appendChild(document.createTextNode("<"));
     19  assert_equals(el.innerHTML, "<xmp xmlns=\"http://www.w3.org/1999/xhtml\"><span>&lt;<\/span><\/xmp>");
     20 })
     21 test(function() {
     22  var el = document.createElement("xmp");
     23  el.appendChild(document.createElement("span"))
     24    .appendChild(document.createTextNode("<"));
     25  assert_equals(el.innerHTML, "<span xmlns=\"http://www.w3.org/1999/xhtml\">&lt;<\/span>");
     26 })
     27 test(function() {
     28  var el = document.createElement("xmp");
     29  el.appendChild(document.createTextNode("<"));
     30  assert_equals(el.innerHTML, "&lt;");
     31 })
     32 test(function() {
     33  var el = document.createElement("div");
     34  el.appendChild(document.createElement("br"));
     35  assert_equals(el.innerHTML, "<br xmlns=\"http://www.w3.org/1999/xhtml\" />");
     36 })
     37 test(function() {
     38  var el = document.createElement("div");
     39  el.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "html:br"));
     40  assert_equals(el.innerHTML, "<html:br xmlns:html=\"http://www.w3.org/1999/xhtml\" />");
     41 })
     42 test(function() {
     43  var el = document.createElement("div");
     44  el.appendChild(document.createTextNode("<>\"'&"));
     45  assert_equals(el.innerHTML, "&lt;&gt;\"'&amp;");
     46 })
     47 test(function() {
     48  var el = document.createElement("div");
     49  el.appendChild(document.createTextNode("&lt;&gt;&quot;&apos;&amp;"));
     50  assert_equals(el.innerHTML, "&amp;lt;&amp;gt;&amp;quot;&amp;apos;&amp;amp;");
     51 })
     52 test(function() {
     53  var el = document.createElement("div");
     54  el.appendChild(document.createTextNode("àו…\u00A0"));
     55  assert_equals(el.innerHTML, "àו…\u00A0");
     56 })
     57 ]]></script>
     58 </body>
     59 </html>