1 // We check that when the anchor changes and is output of the displayed content,
2 // the page is scrolled to it.
3 goto: file://|DOC_PATH|/src/link_to_definition/lib.rs.html
5 // We reduce the window size to make it easier to make an element "out of the page".
7 // We check that the scroll is at the top first.
8 assert-property: ("html", {"scrollTop": "0"})
10 click: '//a[text() = "barbar"]'
11 assert-property: ("html", {"scrollTop": "125"})
12 click: '//a[text() = "bar"]'
13 assert-property: ("html", {"scrollTop": "166"})
14 click: '//a[text() = "sub_fn"]'
15 assert-property: ("html", {"scrollTop": "53"})
17 // We now check that clicking on lines doesn't change the scroll
18 // Extra information: the "sub_fn" function header is on line 1.
20 assert-property: ("html", {"scrollTop": "53"})