Support WebDriver takeScreenshot command.

This adds support for compositing to a PNG without actually quiting
the browser.
This commit is contained in:
James Graham 2015-04-24 15:37:15 +01:00
parent 59cb1b0396
commit 5311d9ab59
13 changed files with 186 additions and 65 deletions

View file

@ -32,6 +32,9 @@ git = "https://github.com/servo/rust-core-foundation"
[dependencies.io_surface]
git = "https://github.com/servo/rust-io-surface"
[dependencies.png]
git = "https://github.com/servo/rust-png"
[dependencies]
url = "0.2.16"
bitflags = "*"

View file

@ -11,6 +11,7 @@ use geom::scale_factor::ScaleFactor;
use hyper::header::Headers;
use hyper::method::Method;
use layers::geometry::DevicePixel;
use png;
use util::cursor::Cursor;
use util::geometry::{PagePx, ViewportPx};
use std::sync::mpsc::{channel, Sender, Receiver};
@ -233,10 +234,12 @@ pub enum Msg {
Focus(PipelineId),
/// Requests that the constellation retrieve the current contents of the clipboard
GetClipboardContents(Sender<String>),
// Dispatch a webdriver command
/// Dispatch a webdriver command
WebDriverCommand(PipelineId, WebDriverScriptCommand),
/// Notifies the constellation that the viewport has been constrained in some manner
ViewportConstrained(PipelineId, ViewportConstraints),
/// Create a PNG of the window contents
CompositePng(Sender<Option<png::Image>>)
}
#[derive(Clone, Eq, PartialEq)]

View file

@ -7,6 +7,7 @@ extern crate azure;
extern crate geom;
extern crate hyper;
extern crate layers;
extern crate png;
extern crate util;
extern crate url;
extern crate style;