Skip to content

Absolute positioned elements not taken into account for screenshot dimension #1443

Open
@whimboo

Description

@whimboo

With the issue for geckodriver filed by @juangj already 2 years ago we still have the problem in how to determine the correct screenshot dimension when elements have an absolute position, which means that they can be located outside of the documentElement's bounds.

In chapter 17. Screen capture, section 17.1 Take Screenshot:

Let root rect be the current top-level browsing context’s document element’s rectangle

Given the spec we never would be able to get those elements drawn as part of the screenshot. And in some cases the root element can have a zero height, which means the result is a empty screenshot with only some pixels in height.

The example as given on the other issue is:

<div style="position: absolute; width: 200px; height: 200px; background-color: blue;"></div>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions