OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 | 7 |
8 <p>This test checks that content-editable is not propagated from shadow host to
a shadow subtree.</p> | 8 <p>This test checks that content-editable is not propagated from shadow host to
a shadow subtree.</p> |
9 | 9 |
10 <p>This p is required to produce the issue.</p> | 10 <p>This p is required to produce the issue.</p> |
11 <div contenteditable> | 11 <div contenteditable> |
12 <div>This div and parent div are required to produce the issue.</div> | 12 <div>This div and parent div are required to produce the issue.</div> |
13 <div id="host1" contenteditable>shadow host 1</div> | 13 <div id="host1" contenteditable>shadow host 1</div> |
14 </div> | 14 </div> |
15 <pre id="console"></pre> | 15 <pre id="console"></pre> |
16 <script> | 16 <script> |
17 if (window.testRunner) | 17 if (window.testRunner) |
18 testRunner.dumpAsText(); | 18 testRunner.dumpAsText(); |
19 | 19 |
20 function computedStyle(element, style) { | |
21 var cs = window.getComputedStyle(element); | |
22 if (!cs) | |
23 return '(NA)'; | |
24 if (cs.getPropertyCSSValue(style)) | |
25 return cs.getPropertyCSSValue(style).cssText; | |
26 return undefined; | |
27 } | |
28 | |
29 function prepareNodeInShadowRoot(host) { | 20 function prepareNodeInShadowRoot(host) { |
30 var shadowRoot = host.createShadowRoot(); | 21 var shadowRoot = host.createShadowRoot(); |
31 var nodeInShadow = document.createElement('div'); | 22 var nodeInShadow = document.createElement('div'); |
32 nodeInShadow.setAttribute('id', 'node-in-shadow-root'); | 23 nodeInShadow.setAttribute('id', 'node-in-shadow-root'); |
33 nodeInShadow.appendChild(document.createTextNode('In Shadow')); | 24 nodeInShadow.appendChild(document.createTextNode('In Shadow')); |
34 shadowRoot.appendChild(nodeInShadow); | 25 shadowRoot.appendChild(nodeInShadow); |
35 return nodeInShadow; | 26 return nodeInShadow; |
36 } | 27 } |
37 | 28 |
38 document.body.offsetLeft; | 29 document.body.offsetLeft; |
39 | 30 |
40 var nodeInShadowRoot1 = prepareNodeInShadowRoot(document.getElementById('host1')
); | 31 var nodeInShadowRoot1 = prepareNodeInShadowRoot(document.getElementById('host1')
); |
41 var userModifyPropertyName = '-webkit-user-modify'; | 32 shouldBeEqualToString('getComputedStyle(nodeInShadowRoot1).webkitUserModify', 'r
ead-only'); |
42 shouldBeEqualToString('computedStyle(nodeInShadowRoot1, userModifyPropertyName)'
, 'read-only'); | |
43 | 33 |
44 var successfullyParsed = true; | 34 var successfullyParsed = true; |
45 </script> | 35 </script> |
46 | 36 |
47 </body> | 37 </body> |
48 </html> | 38 </html> |
OLD | NEW |