OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/js-test.js"></script> |
| 3 <script src="../../resources/run-after-layout-and-paint.js"></script> |
| 4 <style> |
| 5 #frag { |
| 6 background-color: #ccc; |
| 7 display: block; |
| 8 height: 100px; |
| 9 position: absolute; |
| 10 top: 150px; |
| 11 width: 100px; |
| 12 } |
| 13 #frag:target { |
| 14 width: 200px; |
| 15 } |
| 16 </style> |
| 17 <p> |
| 18 Tests that a :target pseudo selector is correctly applied, even when history |
| 19 scroll restoration suppresses scrolling to the fragment. |
| 20 </p> |
| 21 <div id="console"></div> |
| 22 <a id="frag" name="frag"></a> |
| 23 <script> |
| 24 |
| 25 jsTestIsAsync = true; |
| 26 if (location.hash == "") { |
| 27 runAfterLayoutAndPaint(function() { |
| 28 location.hash = 'frag'; |
| 29 location.reload(); |
| 30 }); |
| 31 } else { |
| 32 runAfterLayoutAndPaint(function() { |
| 33 shouldBe(String(document.querySelector("#frag").clientWidth), '200'); |
| 34 history.back(); |
| 35 finishJSTest(); |
| 36 }); |
| 37 } |
| 38 |
| 39 </script> |
OLD | NEW |