[webdriver] test_clip_huge_element_to_viewport expects innerWidth, but screenshots clip to the visual viewport

Open Beginner friendly
#65,528 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
html, javascript
Domain
testing

Research direction

Read webdriver/tests/classic/take_element_screenshot/screenshot.py::test_clip_huge_element_to_viewport and compare its expected screenshot width with the visual viewport width when classic scroll bars are present. Check how the test handles devicePixelRatio and the existing visual viewport height expectation; done means the width expectation matches the reported screenshot dimensions for both classic and overlay scroll bars.

Written by the indexing model from the issue text.

Description

webdriver/tests/classic/take_element_screenshot/screenshot.py::test_clip_huge_element_to_viewport expects the screenshot of a 32768 × 32768 px element to be window.innerWidth × window.visualViewport.height, times devicePixelRatio.

Since w3c/webdriver#1951, draw a bounding box from the framebuffer clips to the visual viewport, whose width doesn't include a classic vertical scroll bar. With classic scroll bars, which the huge element gets in both directions, the expected width would be window.visualViewport.width, as the height already is since 5ec7567c1e (Mozilla bug 2013176).

WebKit on macOS with classic scroll bars returns 1566 × 1028 where the test expects 1600 × 1028: its width is visualViewport.width × devicePixelRatio. With overlay scroll bars, the two widths are the same, and the test passes.

Should the test use window.visualViewport.width for the width too? cc @Sameem-baba

Dominant language
HTML
Stars
6.3k
Forks
4.1k
Avg merge
17h 20m
Merged PRs (30d)
841

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web-platform-tests/wpt

All issues in web-platform-tests/wpt

Similar issues

More Testing & QA issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.