tor-browser

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

inheritance-of-content-editable-001.html (2003B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>Shadow DOM Test: Inheritance of contentEditable attribute</title>
      5 <link rel="author" title="Moto Ishizawa" href="mailto:summerwind.jp@gmail.com">
      6 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#editing">
      7 <meta name="assert" content="User Interaction: Shadow trees must not be propagated contentEditable attribute from shadow host">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="../../../../html/resources/common.js"></script>
     11 <script src="../../../resources/shadow-dom-utils.js"></script>
     12 </head>
     13 <body>
     14 <div id="log"></div>
     15 <script>
     16 test(unit(function (ctx) {
     17    var d = newRenderedHTMLDocument(ctx);
     18 
     19    var host = d.createElement('div');
     20    host.contentEditable = "true";
     21    d.body.appendChild(host);
     22 
     23    var s = host.attachShadow({mode: 'open'});
     24 
     25    assert_equals(host.contentEditable, "true");
     26    assert_equals(s.contentEditable, undefined);
     27 }), 'contentEditable of shadow trees must be undefined when contentEditable attribute of shadow host is "true"');
     28 
     29 test(unit(function (ctx) {
     30    var d = newRenderedHTMLDocument(ctx);
     31 
     32    var host = d.createElement('div');
     33    host.contentEditable = "false";
     34    d.body.appendChild(host);
     35 
     36    var s = host.attachShadow({mode: 'open'});
     37 
     38    assert_equals(host.contentEditable, 'false');
     39    assert_equals(s.contentEditable, undefined);
     40 }), 'contentEditable of shadow trees must be undefined when contentEditable of shadow host is "false"');
     41 
     42 test(unit(function (ctx) {
     43    var d = newRenderedHTMLDocument(ctx);
     44 
     45    var host = d.createElement('div');
     46    d.body.appendChild(host);
     47    d.body.contentEditable = "true";
     48 
     49    var s = host.attachShadow({mode: 'open'});
     50 
     51    assert_equals(host.contentEditable, 'inherit');
     52    assert_equals(s.contentEditable, undefined);
     53 }), 'contentEditable of shadow trees must be undefined when contentEditable attribute of shadow host is "inherit"');
     54 </script>
     55 </body>
     56 </html>