tor-browser

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

value-defaultValue-textContent-xhtml.xhtml (950B)


      1 <?xml version="1.0" encoding="utf-8"?>
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <head>
      4 <title>textarea element value/defaultValue/textContent functionality</title>
      5 <link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"/>
      6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-textarea-value"/>
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 </head>
     10 <body>
     11 <script>
     12 "use strict";
     13 
     14 test(() => {
     15 
     16  const textarea = document.createElement("textarea");
     17 
     18  textarea.appendChild(document.createCDATASection("foo bar baz"));
     19  assert_equals(textarea.defaultValue, "foo bar baz", "the defaultValue should reflect the textContent");
     20  assert_equals(textarea.value, "foo bar baz",
     21    "changing the child text content should change the raw value, and subsequently the api value");
     22 
     23 }, "defaultValue and value include CDATASection Text nodes");
     24 </script>
     25 </body>
     26 </html>