| <!DOCTYPE html> |
| <!-- |
| | This test is based on csp test |
| | blink-contrib/inline-style-allowed-while-cloning-objects.sub.html |
| | Cloning an object should copy its style as well. |
| --> |
| <html> |
| <head> |
| <title>inline-style-allowed-while-cloning-objects</title> |
| <script> |
| if (window.testRunner) { |
| window.testRunner.waitUntilDone(); |
| } |
| |
| window.onload = function() { |
| if (window.testRunner) { |
| window.testRunner.DoNonMeasuredLayout(); |
| } |
| |
| window.nodes = document.getElementById('nodes'); |
| window.node1 = document.getElementById('node1'); |
| window.node1.style.background = "yellow"; |
| window.node1.style.color = "red"; |
| window.node2 = document.getElementById('node1').cloneNode(true); |
| window.node2.id = "node2"; |
| window.node3 = document.getElementById('node3'); |
| window.node3.style.background = "blue"; |
| window.node3.style.color = "green"; |
| window.node4 = document.getElementById('node3').cloneNode(false); |
| window.node4.id = "node4"; |
| window.node4.innerHTML = "Node #4"; |
| nodes.appendChild(node1); |
| nodes.appendChild(node2); |
| nodes.appendChild(node3); |
| nodes.appendChild(node4); |
| |
| if (window.testRunner) { |
| window.testRunner.notifyDone(); |
| } |
| }; |
| </script> |
| </head> |
| |
| <body> |
| <div id="nodes"> |
| <div id="node1"> This is a div. (node 1 or 2)</div> |
| <div id="node3"> This is a div. (node 3 or 4)</div> |
| </div> |
| </body> |
| |
| </html> |