OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 body | 5 body |
6 { | 6 { |
7 counter-reset: i 0; | 7 counter-reset: i 0; |
8 } | 8 } |
9 | 9 |
10 div:before | 10 div:before |
11 { | 11 { |
12 content: "-" counter(i); | 12 content: "-" counter(i); |
13 counter-increment: i; | 13 counter-increment: i; |
14 } | 14 } |
15 div { | 15 div { |
16 display:inline; | 16 display:inline; |
17 } | 17 } |
18 </style> | 18 </style> |
19 <script> | 19 <script> |
20 if (window.testRunner) { | 20 if (window.testRunner) { |
21 testRunner.dumpAsText(); | 21 testRunner.dumpAsText(); |
22 testRunner.waitUntilDone(); | 22 testRunner.waitUntilDone(); |
23 } | 23 } |
24 | 24 |
25 function insertAuto(i) { | 25 function insertAuto(i) { |
26 // We need to use the selection or we cannot reproduce this bug! | 26 // We need to use the selection or we cannot reproduce this bug! |
27 var selection = window.getSelection(); | 27 var selection = window.getSelection(); |
28 var container = document.getElementById("container"); | 28 var container = document.getElementById("container"); |
29 selection.collapse(container, 0); | 29 selection.collapse(container.firstChild, 0); |
30 if (selection.rangeCount > 0) { | 30 if (selection.rangeCount > 0) { |
31 var newElement = document.createElement('div'); | 31 var newElement = document.createElement('div'); |
32 newElement.id = 'div' + i; | 32 newElement.id = 'div' + i; |
33 //newElement.innerHTML = '<span"> - i:' + (6 - i) + '</span>'; | 33 //newElement.innerHTML = '<span"> - i:' + (6 - i) + '</span>'; |
34 var node = selection.getRangeAt(0).startContainer.parentNode.par
entNode; | 34 var node = selection.getRangeAt(0).startContainer.parentNode.par
entNode; |
35 node.parentNode.insertBefore(newElement, node.nextSibling); | 35 node.parentNode.insertBefore(newElement, node.nextSibling); |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 function dumpCounters() | 39 function dumpCounters() |
(...skipping 21 matching lines...) Expand all Loading... |
61 window.addEventListener("load", test, false); | 61 window.addEventListener("load", test, false); |
62 </script> | 62 </script> |
63 </head> | 63 </head> |
64 <body> | 64 <body> |
65 <p>Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=38291">38291</a> - C
SS counters in :before pseudo-elements do not always update</p> | 65 <p>Bug <a href="https://bugs.webkit.org/show_bug.cgi?id=38291">38291</a> - C
SS counters in :before pseudo-elements do not always update</p> |
66 <p>The following two lines should be the same:</p> | 66 <p>The following two lines should be the same:</p> |
67 <p>-1--2-3-4-5-6</p> | 67 <p>-1--2-3-4-5-6</p> |
68 <div id="container"><span>-</span></div> | 68 <div id="container"><span>-</span></div> |
69 </body> | 69 </body> |
70 </html> | 70 </html> |
OLD | NEW |