tor-browser

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

test_bug595429.html (1525B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=595429
      5 -->
      6 <head>
      7  <title>Test for Bug 595429</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=595429">Mozilla Bug 595429</a>
     13 <p id="display"></p>
     14 <pre id="test">
     15 <script type="application/javascript">
     16 
     17 /** Test for Bug 595429 */
     18 
     19 var fieldset = document.createElement("fieldset");
     20 
     21 ok("name" in fieldset, "<fieldset> should have a name IDL attribute");
     22 
     23 var testData = [
     24  "",
     25  " ",
     26  "foo",
     27  "foo bar",
     28 ];
     29 
     30 is(fieldset.getAttribute("name"), null,
     31   "By default, name content attribute should be null");
     32 is(fieldset.name, "",
     33   "By default, name IDL attribute should be the empty string");
     34 
     35 for (var data of testData) {
     36  fieldset.setAttribute("name", data);
     37  is(fieldset.getAttribute("name"), data,
     38     "name content attribute should be " + data);
     39  is(fieldset.name, data, "name IDL attribute should be " + data);
     40 
     41  fieldset.setAttribute("name", "");
     42  fieldset.name = data;
     43  is(fieldset.getAttribute("name"), data,
     44     "name content attribute should be " + data);
     45  is(fieldset.name, data, "name IDL attribute should be " + data);
     46 }
     47 
     48 fieldset.removeAttribute("name");
     49 is(fieldset.getAttribute("name"), null,
     50   "name content attribute should be null");
     51 is(fieldset.name, "", "name IDL attribute should be the empty string");
     52 
     53 </script>
     54 </pre>
     55 </body>
     56 </html>