mirror of
https://github.com/servo/servo.git
synced 2025-09-27 15:20:09 +01:00
webdriver: Elegantly handle "element screenshot" when bounding box has area zero (#39499)
It is possible that the bounding rectangle of an element has area 0. This PR avoids panic in this case. It is worth to mention that the panic itself won't kill the entire program for interaction, but only the webdriver thread. Testing: Manually tested on the case of #39495 Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
4c25039d35
commit
2e8fac9395
3 changed files with 28 additions and 10 deletions
|
@ -144,7 +144,7 @@ pub enum WebDriverCommandMsg {
|
|||
TakeScreenshot(
|
||||
WebViewId,
|
||||
Option<Rect<f32, CSSPixel>>,
|
||||
IpcSender<Option<RasterImage>>,
|
||||
IpcSender<Result<Option<RasterImage>, ()>>,
|
||||
),
|
||||
/// Create a new webview that loads about:blank. The embedder will use
|
||||
/// the provided channels to return the top level browsing context id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue