Use viewport instead of initial viewport in screenshot algorithms#1951
Open
Sameem-baba wants to merge 1 commit intow3c:masterfrom
Open
Use viewport instead of initial viewport in screenshot algorithms#1951Sameem-baba wants to merge 1 commit intow3c:masterfrom
Sameem-baba wants to merge 1 commit intow3c:masterfrom
Conversation
whimboo
requested changes
Mar 5, 2026
Contributor
whimboo
left a comment
There was a problem hiding this comment.
I think we can ignore the IPR for this PR so don't worry about it for now.
index.html
Outdated
| <p>Screenshots are a mechanism for providing | ||
| additional visual diagnostic information. | ||
| They work by dumping a snapshot of the <a>initial viewport</a>'s | ||
| They work by dumping a snapshot of the <a>viewport</a>'s |
Contributor
There was a problem hiding this comment.
In WebDriver BiDi we explicitly use the visual viewport, see this line in the get the origin rectangle algorithm. We should do the same for classic including the addition of the reference to the cssom-view specification.
I think that should apply to all the entries in this file.
Author
There was a problem hiding this comment.
I have changed it to visual viewport
The screenshot algorithms reference the initial viewport when computing framebuffer bounds. If the browser window is resized after the document loads, this can lead to incorrect clipping. Update the algorithms to reference the visual viewport instead. Fixes w3c#1947
5f12ad9 to
0007dd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The screenshot algorithms currently reference the initial viewport.
If the browser window is resized after the document loads,
this can lead to incorrect clipping calculations.
This change updates the algorithms to reference the viewport instead.
Fixes #1947
Preview | Diff