Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REGRESSION]: elem screenshot (sticky elements outside elem are overlapping) #5725

Closed
hampsterx opened this issue Mar 5, 2021 · 3 comments
Closed
Assignees

Comments

@hampsterx
Copy link

Context:

Was working prior in 1.7. Now not working in 1.9.1

Operating System: Linux, python playwright

Describe the bug

<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
    <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body>

    <div class="m-5 p-5 bg-red-400" style="display:block; position:sticky; top:25px;">
        sticky header
    </div>
    <div id="content" class="m-5 p-5 bg-green-400">
        <p>test</p>
        <p>test</p>
        <p>test</p>
        <p>test</p>
        <p>test</p>
    </div>
</body>
</html>

screenshot_playwrite_test

pip freeze | grep play
playwright==0.171.1

    page.goto("http://localhost:8000/test.html")

    elem = page.querySelector("#content")
    elem.screenshot(path="test_171.png")

test_171

Now with

pip freeze | grep play
playwright==1.9.1

    page.goto("http://localhost:8000/test.html")

    elem = page.query_selector("#content")
    elem.screenshot(path="test.png")

test_191

Obviously I am only wanting to clip the element, not anything positioned over it.

@dgozman
Copy link
Contributor

dgozman commented Mar 5, 2021

I bisected this down to #5434. Most likely upstream Chromium CL https://chromium-review.googlesource.com/c/chromium/src/+/2643792 is a culprit.

More details: to capture this particular element, we set viewport override to the element's bounding box, and new Chromium behavior is to reposition sticky header according to the new viewport. That seems like a logical move in Chromium, but produces unexpected result for this screenshot.

@pavelfeldman
Copy link
Member

Why was this issue closed?

We are prioritizing the bugs based on the upvotes, recency and our ability to act. It looks like this issue only has a handful of upvotes, has not been touched recently and/or we lack sufficient feedback to act on it. We are closing issues like this one to keep our bug database maintainable. Please feel free to open a new issue and link this one to it if you think this is a mistake.

@djanowski
Copy link

Has this been resolved? We're still dealing with these screenshot issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants