| OLD | NEW |
| 1 <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3
.org/1999/xlink"> | 1 <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3
.org/1999/xlink"> |
| 2 <style> | 2 <style> |
| 3 :link { fill: red } | 3 :link { fill: red } |
| 4 :visited { fill: green } | 4 :visited { fill: green } |
| 5 </style> | 5 </style> |
| 6 <a xlink:href="http://notvisited" name="x"> | 6 <a xlink:href="http://notvisited" name="x"> |
| 7 <text x="20" y="40">This text should be green</text> | 7 <text x="20" y="40">This text should be green</text> |
| 8 </a> | 8 </a> |
| 9 <text x="20" y="60" id="result1">Not run (requires window.internals).</text> | 9 <text x="20" y="60" id="result1">Not run (requires window.internals).</text> |
| 10 <script> | 10 <script> |
| 11 if (window.testRunner) { | 11 if (window.testRunner) { |
| 12 testRunner.dumpAsText(); | 12 testRunner.dumpAsText(); |
| 13 testRunner.waitUntilDone(); | 13 testRunner.waitUntilDone(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 window.location.hash = "#x"; | 16 window.location.hash = "#x"; |
| 17 | 17 |
| 18 requestAnimationFrame(function(){ | 18 requestAnimationFrame(function(){ |
| 19 | 19 |
| 20 // Change href from non-visited to visited link. | 20 // Change href from non-visited to visited link. |
| 21 getComputedStyle(document.documentElement); | 21 getComputedStyle(document.documentElement); |
| 22 document.querySelector("a").setAttribute("xlink:href", "#x"); | 22 document.querySelector("a").setAttribute("xlink:href", "#x"); |
| 23 | 23 |
| 24 if (window.internals) { | 24 if (window.internals) { |
| 25 var resultText = document.getElementById("result1").firstChild; | 25 var resultText = document.getElementById("result1").firstChild; |
| 26 var elementCount = internals.updateStyleAndReturnAffectedElement
Count(); | 26 var elementCount = internals.updateStyleAndLayoutAndReturnAffect
edElementCount(); |
| 27 | 27 |
| 28 // The elementCount should have been 2, but visited links are | 28 // The elementCount should have been 2, but visited links are |
| 29 // not recognized in content_shell, thus the text color doesn't | 29 // not recognized in content_shell, thus the text color doesn't |
| 30 // change and an inheritance propagation to text element is not | 30 // change and an inheritance propagation to text element is not |
| 31 // necessary. Running this test in Chrome will cause a 2-element | 31 // necessary. Running this test in Chrome will cause a 2-element |
| 32 // recalc and green text as expected. | 32 // recalc and green text as expected. |
| 33 if (elementCount == 1) | 33 if (elementCount == 1) |
| 34 resultText.data = "PASS"; | 34 resultText.data = "PASS"; |
| 35 else | 35 else |
| 36 resultText.data = "FAIL: " + elementCount; | 36 resultText.data = "FAIL: " + elementCount; |
| 37 } | 37 } |
| 38 | 38 |
| 39 if (window.testRunner) | 39 if (window.testRunner) |
| 40 testRunner.notifyDone(); | 40 testRunner.notifyDone(); |
| 41 }); | 41 }); |
| 42 </script> | 42 </script> |
| 43 </svg> | 43 </svg> |
| OLD | NEW |