Change Get Screenshot to return viewport in content context

RESOLVED WORKSFORME

Status

defect
RESOLVED WORKSFORME
4 years ago
a year ago

People

(Reporter: automatedtester, Unassigned)

Tracking

(Blocks 1 bug, {pi-marionette-server, pi-marionette-spec})

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

4 years ago
We need to return the viewport only.

I think we need to keep the full screen ability at least for Mozilla use for a while before we only return the viewport
So can't we distinguish that between usage of content and chrome scope? While staying in content we return the viewport, but in chrome we screenshot the whole window.
(In reply to Henrik Skupin (:whimboo) from comment #1)
> So can't we distinguish that between usage of content and chrome scope?

We can.  The specification does not go into details regarding extensions to the protocol.  We can define the behaviour of Get Screenshot in chrome context ourselves.

> While staying in content we return the viewport, but in chrome we screenshot
> the whole window.

That’s probably what makes sense.
Summary: Update screenshot to match the spec → Change Get Screenshot to return viewport in content context
I may be wrong, but I think when David says "full screen" in comment 0 he is referring to a full canvas screenshot when in the content context, rather than the full window screenshot currently provided when in chrome context. By this I understand that when in content context you could either get the visible viewport or the full canvas (including content that a user would need to scroll to see). It would be good to get clarification here, or a link to where this is covered in the spec.
The relevant spec prose can be found here: https://w3c.github.io/webdriver/webdriver-spec.html#screen-capture

(In reply to Dave Hunt (:davehunt) from comment #3)
> By this I understand that when in content context you could either get the
> visible viewport or the full canvas (including content that a user would
> need to scroll to see). It would be good to get clarification here, or a
> link to where this is covered in the spec.

To be more specific, the current behaviour for content context is to take a screenshot of the bounding box of the document.  We should keep this functionality through some sort of parameter or extension command which we can define ourselves.
Reporter

Comment 5

4 years ago
(In reply to Henrik Skupin (:whimboo) from comment #1)
> So can't we distinguish that between usage of content and chrome scope?
> While staying in content we return the viewport, but in chrome we screenshot
> the whole window.

Not sure how the browser can be bigger than the viewport? The browser isnt' going to be bigger than the viewport, for fullscreen and similar we just make the content window bigger and diminish the chrome window.
We now return only the viewport.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.