Closed thiagowfx closed 1 week ago
@thiagowfx One thing WebDriver Classic has that BiDi doesn't (yet), is taking a screenshot of an element, which seems like it might fall into the same category here. If we want to be able to implement classic over bidi, that seems like a use case we need to support.
Side note: Element screenshots is tracked by https://github.com/w3c/webdriver-bidi/issues/229
In classic you will not have the possibility to take a screenshot of a huge iframe which has overflow:auto
set and most of its contents is hidden and only accessible by scroll bars.
I feel this is an important feature to have and as such I think that we should support taking screenshots from iframes and even full screenshots. We should not judge on features based on the fact that some browsers might not have support for it yet. Please note that for some of the features in BiDi we have to write most of the code from scratch given that it doesn't exist at all. And in some cases we know that all possible scenarios cannot be supported immediately.
@whimboo Are you saying that with BiDi, you want to allow for support of huge iframes where most of its content can be hidden?
Consider a fullpage screenshot for just an iframe's content. How would you do that when you can only screenshot from the top-level browsing context?
Considering CDP's implementation, the largest image you can capture of an iframe is the iframe itself. For example, if a document has a 300x500-sized iframe, the largest image you can capture is 300x500.
The reason we want to capture top-level is because capturing the contents of an oversized element in iframe is just not found in practice. If you have an iframe, then it's likely that
If the iframe is cross-origin, then the user can also just open a new page with that iframe (which will now be a top-level context) and capture it.
The Browser Testing and Tools Working Group just discussed BrowsingContext.captureScreenshot: restrict to top-level contexts only
.
@sadym-chromium, reading through the notes from Friday I assume that we can close this issue? As @jgraham pointed out no spec change is necessary. Step 3 of the remote end steps cover that already.
@sadym-chromium, reading through the notes from Friday I assume that we can close this issue? As @jgraham pointed out no spec change is necessary. Step 3 of the remote end steps cover that already.
right. One thing discussed but was not minuted though: we agreed on marking the related WPT test as optional.
For https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot:
Should we make the spec restrict capturing screenshots only in top-level contexts?
Rationale: Basically, CDP does not properly support it (confirmed with @OrKoN and @sadym-chromium), as rendering is a super optimised process.
Filing as per @sadym-chromium's guidance.