JS Test Harness: Insert the stylesheet dynamically
[WebKit-https.git] / LayoutTests / fast / dom / HTMLElement / iscontenteditable-designmodeon-ancestor.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></p>
9 <div id="result"></div>
10 <div id="parent_of_div" contentEditable="false">
11     <div id="div"></div>
12 </div>
13 <div id="parent_of_div2">
14     <div id="div2"></div>
15 </div>
16 <div id="parent_of_p" contentEditable="true">
17     <p id="p"></p>
18 </div>
19 <div id="parent_of_p2">
20     <p id="p2"></p>
21 </div>
22 <script>
23 description('isContentEditable should not change if its ancestor\'s contentEditable is set, no matter whether document.designMode is enabled or not.')
24
25 document.getElementById("parent_of_div2").contentEditable = false;
26 document.getElementById("parent_of_p2").contentEditable = true;
27
28 evalAndLog('document.designMode = "on"');
29
30 shouldBe('document.getElementById("div").contentEditable', '"inherit"');
31 shouldBe('document.getElementById("div").isContentEditable', 'false');
32 shouldBe('window.getComputedStyle(div, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
33
34 shouldBe('document.getElementById("div2").contentEditable', '"inherit"');
35 shouldBe('document.getElementById("div2").isContentEditable', 'false');
36 shouldBe('window.getComputedStyle(div2, "").getPropertyValue("-webkit-user-modify")', '"read-only"');
37
38 shouldBe('document.getElementById("p").contentEditable', '"inherit"');
39 shouldBe('document.getElementById("p").isContentEditable', 'true');
40 shouldBe('window.getComputedStyle(p, "").getPropertyValue("-webkit-user-modify")', '"read-write"');
41
42 shouldBe('document.getElementById("p2").contentEditable', '"inherit"');
43 shouldBe('document.getElementById("p2").isContentEditable', 'true');
44 shouldBe('window.getComputedStyle(p2, "").getPropertyValue("-webkit-user-modify")', '"read-write"');
45
46 document.getElementById("parent_of_div").style.display= 'none';
47 document.getElementById("parent_of_div2").style.display= 'none';
48 document.getElementById("parent_of_p").style.display= 'none';
49 document.getElementById("parent_of_p2").style.display= 'none';
50
51 window.successfullyParsed = true;
52 </script>
53 <script src="../../js/resources/js-test-post.js"></script>
54 </body>
55 </html>