tor-browser

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

test_bug629801.html (1556B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=629801
      5 -->
      6 <head>
      7  <title>Test for Bug 629801</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script type="application/javascript" src="reflect.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=629801">Mozilla Bug 629801</a>
     14 <p id="display"></p>
     15 <div id="content" style="display: none">
     16 
     17 <div itemscope>
     18 This tests itemValue on time elements, first with no datetime attribute, then with no text content,
     19 then with both.
     20 <time id="t1" itemprop="a">May 10th 2009</time>
     21 <time id="t2" itemprop="b" datetime="2009-05-10"></time>
     22 <time id="t3" itemprop="c" datetime="2009-05-10">May 10th 2009</time>
     23 </div>
     24 
     25 </div>
     26 <pre id="test">
     27 <script type="application/javascript">
     28 
     29 /** Test for Bug 629801 */
     30 
     31 var t1 = document.getElementById("t1"),
     32    t2 = document.getElementById("t2"),
     33    t3 = document.getElementById("t3"),
     34    t4 = document.createElement("time");
     35 
     36 // .dateTime IDL
     37 is(t1.dateTime, "", "dateTime is properly set to empty string if datetime attributeis absent");
     38 is(t2.dateTime, "2009-05-10", "dateTime is properly set to datetime attribute with datetime and no text content");
     39 is(t3.dateTime, "2009-05-10", "dateTime is properly set to datetime attribute with datetime and text content");
     40 
     41 // dateTime reflects datetime attribute
     42 reflectString({
     43  element: t4,
     44  attribute: "dateTime"
     45 });
     46 
     47 </script>
     48 </pre>
     49 </body>
     50 </html>