OLD | NEW |
---|---|
(Empty) | |
1 <!doctype html> | |
2 <html> | |
3 <head> | |
4 <title>Test for first-letter that is added by DOM scripting</title> | |
5 <style type="text/css"> | |
6 p:first-letter {text-decoration: underline; color: #CB000F;} | |
7 </style> | |
8 <script type="text/javascript"> | |
9 if (window.testRunner) | |
10 testRunner.waitUntilDone(); | |
11 | |
12 setTimeout(function() {addTextNode()}, 0); | |
esprehn
2013/09/27 18:30:15
This doesn't need to use setTimeout, just do:
onl
| |
13 | |
14 function addTextNode() { | |
15 var textNode = document.createTextNode('I am adding a new text. '); | |
16 var para = document.getElementById('test'); | |
17 para.insertBefore(textNode, para.firstChild); | |
18 if (window.testRunner) | |
19 testRunner.notifyDone(); | |
20 } | |
21 </script> | |
22 </head> | |
23 <body> | |
24 <p id="test"> | |
25 This is a test paragraph. You can insert extra text at its start; | |
26 the :first-letter styles should be updated to accomodate this new text. | |
27 </p> | |
28 </body> | |
29 </html> | |
OLD | NEW |