summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/printing/script-tests/pageNumerForElementById.js
blob: 1d0e4594fc943be4faf831d235021d5b7b8a6d72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
description("Test for internals.pageNumber()");

function test()
{
    // Assuming that one page has about 20 lines.
    createBlockWithNumberOfLines("firstPage", 20);
    createBlockWithNumberOfLines("secondPage", 20);

    createBlockWithNumberOfLines("thirdPage", 5);
    createBlockWithNumberOfLines("thirdPage2", 5);

    pageNumberForElementShouldBe('firstPage', 0);
    pageNumberForElementShouldBe('secondPage', 1);
    pageNumberForElementShouldBe('thirdPage', 2);
    pageNumberForElementShouldBe('thirdPage2', 2);

    document.body.removeChild(document.getElementById("sandbox"));
}

var successfullyParsed = true;