def test_absolute_next_page(assert_pixels):
    # TODO: currently, the layout of absolute boxes forces to render a box,
    # even when it doesn’t fit in the page. This workaround avoids placeholders
    # with no box. Instead, we should remove these placeholders, or avoid
    # crashes when they’re rendered.
    assert_pixels('''
        RRRRRRRRRR______
        RRRRRRRRRR______
        RRRRRRRRRR______
        RRRRRRRRRR______
        BBBBBBRRRR______
        BBBBBBRRRR______
        BBBBBB__________
        ________________
    ''', '''
        <style>
            @page {
                size: 16px 4px;
            }
            body {
                color: red;
                font-family: weasyprint;
                font-size: 2px;
                line-height: 1;
            }
            div.split {
                color: blue;
                position: absolute;
                font-size: 3px;
            }
        </style>
        aaaaa aaaaa
        <div class="split">bb</div>
        aaaaa
    ''')
,
tests/draw/test_absolute.py