OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> | 4 <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> |
5 <script src="../../../js-test-resources/js-test-pre.js"></script> | 5 <script src="../../../js-test-resources/js-test-pre.js"></script> |
6 <script> | 6 <script> |
7 function runTest() { | 7 function runTest() { |
8 description('Tests that loading a frame with a URL that contains a fragmen
t pointed at a named anchor actually scrolls to that anchor.'); | 8 description('Tests that loading a frame with a URL that contains a fragmen
t pointed at a named anchor actually scrolls to that anchor.'); |
9 | 9 |
10 // Check scroll position in a timeout to make sure that the anchor has | 10 // Check scroll position in a timeout to make sure that the anchor has |
11 // been scrolled to. | 11 // been scrolled to. |
12 setTimeout(function() { | 12 setTimeout(function() { |
13 // Make sure that the body is taller than the viewport (i.e. scrolling
is | 13 // Make sure that the body is taller than the viewport (i.e. scrolling
is |
14 // required). | 14 // required). |
15 shouldBeTrue('document.body.offsetHeight > document.documentElement.cl
ientHeight'); | 15 shouldBeTrue('document.body.offsetHeight > document.documentElement.cl
ientHeight'); |
16 | 16 |
17 // We should be scrolled at least a little bit | 17 // We should be scrolled at least a little bit |
18 shouldBeTrue('document.body.scrollTop > 0'); | 18 shouldBeTrue('document.documentElement.scrollTop > 0'); |
19 | 19 |
20 // And the bottom of the viewable area should be at least 2000 pixels
from the top, due to the spacer element above. | 20 // And the bottom of the viewable area should be at least 2000 pixels
from the top, due to the spacer element above. |
21 shouldBeTrue('document.body.scrollTop + document.documentElement.clien
tHeight > 2000'); | 21 shouldBeTrue('document.documentElement.scrollTop + document.documentEl
ement.clientHeight > 2000'); |
22 | 22 |
23 finishJSTest(); | 23 finishJSTest(); |
24 }, 0); | 24 }, 0); |
25 } | 25 } |
26 | 26 |
27 var jsTestIsAsync = true; | 27 var jsTestIsAsync = true; |
28 </script> | 28 </script> |
29 </head> | 29 </head> |
30 <body onload="runTest()"> | 30 <body onload="runTest()"> |
31 <p id="description"></p> | 31 <p id="description"></p> |
32 <div id="console"></div> | 32 <div id="console"></div> |
33 | 33 |
34 <div style="height: 2000px"> | 34 <div style="height: 2000px"> |
35 <!-- Spacer to make sure that the named anchor below requires scrolling --> | 35 <!-- Spacer to make sure that the named anchor below requires scrolling --> |
36 </div> | 36 </div> |
37 | 37 |
38 <a name="塯">This is an anchor point named as the Unicode equivalent of the
GBK sequence %a9g (test trailing low byte)</a>. | 38 <a name="塯">This is an anchor point named as the Unicode equivalent of the
GBK sequence %a9g (test trailing low byte)</a>. |
39 <script src="../../../js-test-resources/js-test-post.js"></script> | 39 <script src="../../../js-test-resources/js-test-post.js"></script> |
40 </body> | 40 </body> |
41 </html> | 41 </html> |
OLD | NEW |