Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Side by Side Diff: LayoutTests/fast/css/counters/counter-before-content-not-incremented.html

Issue 225303002: Let Selection.collapse remember a raw Position instead of a canonicalized one. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix setSelectedRange arguments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698