This commit is contained in:
r0e 2015-05-21 16:40:28 -07:00
commit 8f91027311
156 changed files with 2821 additions and 1953 deletions

View file

@ -13,17 +13,24 @@ git = "https://github.com/servo/rust-azure"
[dependencies.geom] [dependencies.geom]
git = "https://github.com/servo/rust-geom" git = "https://github.com/servo/rust-geom"
[dependencies.layers]
git = "https://github.com/servo/rust-layers"
[dependencies.gleam] [dependencies.gleam]
git = "https://github.com/servo/gleam" git = "https://github.com/servo/gleam"
[dependencies.canvas_traits]
path = "../canvas_traits"
[dependencies.util] [dependencies.util]
path = "../util" path = "../util"
[dependencies.gfx] [dependencies.gfx_traits]
path = "../gfx" path = "../gfx_traits"
[dependencies.offscreen_gl_context] [dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context" git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
features = ["texture_surface"]
[dependencies] [dependencies]
cssparser = "0.3.1" cssparser = "0.3.1"

View file

@ -1,83 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas_paint_task::{FillOrStrokeStyle, LineCapStyle, LineJoinStyle, CompositionOrBlending};
use geom::matrix2d::Matrix2D;
use geom::point::Point2D;
use geom::rect::Rect;
use geom::size::Size2D;
use std::sync::mpsc::{Sender};
#[derive(Clone)]
pub enum CanvasMsg {
Canvas2d(Canvas2dMsg),
Common(CanvasCommonMsg),
WebGL(CanvasWebGLMsg),
}
#[derive(Clone)]
pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool),
ArcTo(Point2D<f32>, Point2D<f32>, f32),
DrawImage(Vec<u8>, Size2D<f64>, Rect<f64>, Rect<f64>, bool),
DrawImageSelf(Size2D<f64>, Rect<f64>, Rect<f64>, bool),
BeginPath,
BezierCurveTo(Point2D<f32>, Point2D<f32>, Point2D<f32>),
ClearRect(Rect<f32>),
Clip,
ClosePath,
Fill,
FillRect(Rect<f32>),
GetImageData(Rect<f64>, Size2D<f64>, Sender<Vec<u8>>),
LineTo(Point2D<f32>),
MoveTo(Point2D<f32>),
PutImageData(Vec<u8>, Rect<f64>, Option<Rect<f64>>),
QuadraticCurveTo(Point2D<f32>, Point2D<f32>),
Rect(Rect<f32>),
RestoreContext,
SaveContext,
StrokeRect(Rect<f32>),
Stroke,
SetFillStyle(FillOrStrokeStyle),
SetStrokeStyle(FillOrStrokeStyle),
SetLineWidth(f32),
SetLineCap(LineCapStyle),
SetLineJoin(LineJoinStyle),
SetMiterLimit(f32),
SetGlobalAlpha(f32),
SetGlobalComposition(CompositionOrBlending),
SetTransform(Matrix2D<f32>),
}
#[derive(Clone)]
pub enum CanvasWebGLMsg {
AttachShader(u32, u32),
BindBuffer(u32, u32),
BufferData(u32, Vec<f32>, u32),
Clear(u32),
ClearColor(f32, f32, f32, f32),
CompileShader(u32),
CreateBuffer(Sender<u32>),
CreateProgram(Sender<u32>),
CreateShader(u32, Sender<u32>),
DrawArrays(u32, i32, i32),
EnableVertexAttribArray(u32),
GetAttribLocation(u32, String, Sender<i32>),
GetShaderInfoLog(u32, Sender<String>),
GetShaderParameter(u32, u32, Sender<i32>),
GetUniformLocation(u32, String, Sender<u32>),
LinkProgram(u32),
ShaderSource(u32, Vec<String>),
Uniform4fv(u32, Vec<f32>),
UseProgram(u32),
VertexAttribPointer2f(u32, i32, bool, i32, i64),
Viewport(i32, i32, i32, i32),
}
#[derive(Clone)]
pub enum CanvasCommonMsg {
Close,
Recreate(Size2D<i32>),
SendPixelContents(Sender<Vec<u8>>),
}

View file

@ -5,19 +5,18 @@
use azure::azure::AzFloat; use azure::azure::AzFloat;
use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions, Pattern}; use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions, Pattern};
use azure::azure_hl::{ColorPattern, PathBuilder, DrawSurfaceOptions, Filter}; use azure::azure_hl::{ColorPattern, PathBuilder, DrawSurfaceOptions, Filter};
use azure::azure_hl::{GradientStop, LinearGradientPattern, RadialGradientPattern, ExtendMode}; use azure::azure_hl::{JoinStyle, CapStyle};
use azure::azure_hl::{JoinStyle, CapStyle, CompositionOp}; use canvas_traits::*;
use canvas_msg::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg};
use geom::matrix2d::Matrix2D; use geom::matrix2d::Matrix2D;
use geom::point::Point2D; use geom::point::Point2D;
use geom::rect::Rect; use geom::rect::Rect;
use geom::size::Size2D; use geom::size::Size2D;
use gfx::color; use layers::platform::surface::NativeSurface;
use gfx_traits::color;
use num::ToPrimitive; use num::ToPrimitive;
use util::task::spawn_named; use util::task::spawn_named;
use util::vec::byte_swap; use util::vec::byte_swap;
use cssparser::RGBA;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::mem; use std::mem;
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::{channel, Sender};
@ -257,6 +256,8 @@ impl<'a> CanvasPaintTask<'a> {
CanvasCommonMsg::Recreate(size) => painter.recreate(size), CanvasCommonMsg::Recreate(size) => painter.recreate(size),
CanvasCommonMsg::SendPixelContents(chan) => CanvasCommonMsg::SendPixelContents(chan) =>
painter.send_pixel_contents(chan), painter.send_pixel_contents(chan),
CanvasCommonMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
} }
}, },
CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D task"), CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D task"),
@ -497,6 +498,14 @@ impl<'a> CanvasPaintTask<'a> {
}) })
} }
fn send_native_surface(&self, chan: Sender<NativeSurface>) {
let mut native_surface: NativeSurface =
NativeSurface::from_draw_target_backing(self.drawtarget.backing.clone());
native_surface.mark_wont_leak();
chan.send(native_surface).unwrap();
}
fn get_image_data(&self, mut dest_rect: Rect<f64>, canvas_size: Size2D<f64>, chan: Sender<Vec<u8>>) { fn get_image_data(&self, mut dest_rect: Rect<f64>, canvas_size: Size2D<f64>, chan: Sender<Vec<u8>>) {
if dest_rect.size.width < 0.0 { if dest_rect.size.width < 0.0 {
dest_rect.size.width = -dest_rect.size.width; dest_rect.size.width = -dest_rect.size.width;
@ -566,340 +575,6 @@ impl<'a> CanvasPaintTask<'a> {
} }
} }
#[derive(Clone)]
pub struct CanvasGradientStop {
pub offset: f64,
pub color: RGBA,
}
#[derive(Clone)]
pub struct LinearGradientStyle {
pub x0: f64,
pub y0: f64,
pub x1: f64,
pub y1: f64,
pub stops: Vec<CanvasGradientStop>
}
impl LinearGradientStyle {
pub fn new(x0: f64, y0: f64, x1: f64, y1: f64, stops: Vec<CanvasGradientStop>)
-> LinearGradientStyle {
LinearGradientStyle {
x0: x0,
y0: y0,
x1: x1,
y1: y1,
stops: stops,
}
}
}
#[derive(Clone)]
pub struct RadialGradientStyle {
pub x0: f64,
pub y0: f64,
pub r0: f64,
pub x1: f64,
pub y1: f64,
pub r1: f64,
pub stops: Vec<CanvasGradientStop>
}
impl RadialGradientStyle {
pub fn new(x0: f64, y0: f64, r0: f64, x1: f64, y1: f64, r1: f64, stops: Vec<CanvasGradientStop>)
-> RadialGradientStyle {
RadialGradientStyle {
x0: x0,
y0: y0,
r0: r0,
x1: x1,
y1: y1,
r1: r1,
stops: stops,
}
}
}
#[derive(Clone)]
pub enum FillOrStrokeStyle {
Color(RGBA),
LinearGradient(LinearGradientStyle),
RadialGradient(RadialGradientStyle),
}
impl FillOrStrokeStyle {
fn to_azure_pattern(&self, drawtarget: &DrawTarget) -> Pattern {
match *self {
FillOrStrokeStyle::Color(ref color) => {
Pattern::Color(ColorPattern::new(color::new(color.red,
color.green,
color.blue,
color.alpha)))
},
FillOrStrokeStyle::LinearGradient(ref linear_gradient_style) => {
let gradient_stops: Vec<GradientStop> = linear_gradient_style.stops.iter().map(|s| {
GradientStop {
offset: s.offset as AzFloat,
color: color::new(s.color.red, s.color.green, s.color.blue, s.color.alpha)
}
}).collect();
Pattern::LinearGradient(LinearGradientPattern::new(
&Point2D(linear_gradient_style.x0 as AzFloat, linear_gradient_style.y0 as AzFloat),
&Point2D(linear_gradient_style.x1 as AzFloat, linear_gradient_style.y1 as AzFloat),
drawtarget.create_gradient_stops(&gradient_stops, ExtendMode::Clamp),
&Matrix2D::identity()))
},
FillOrStrokeStyle::RadialGradient(ref radial_gradient_style) => {
let gradient_stops: Vec<GradientStop> = radial_gradient_style.stops.iter().map(|s| {
GradientStop {
offset: s.offset as AzFloat,
color: color::new(s.color.red, s.color.green, s.color.blue, s.color.alpha)
}
}).collect();
Pattern::RadialGradient(RadialGradientPattern::new(
&Point2D(radial_gradient_style.x0 as AzFloat, radial_gradient_style.y0 as AzFloat),
&Point2D(radial_gradient_style.x1 as AzFloat, radial_gradient_style.y1 as AzFloat),
radial_gradient_style.r0 as AzFloat, radial_gradient_style.r1 as AzFloat,
drawtarget.create_gradient_stops(&gradient_stops, ExtendMode::Clamp),
&Matrix2D::identity()))
}
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum LineCapStyle {
Butt = 0,
Round = 1,
Square = 2,
}
impl LineCapStyle {
fn to_azure_style(&self) -> CapStyle {
match *self {
LineCapStyle::Butt => CapStyle::Butt,
LineCapStyle::Round => CapStyle::Round,
LineCapStyle::Square => CapStyle::Square,
}
}
pub fn from_str(string: &str) -> Option<LineCapStyle> {
match string {
"butt" => Some(LineCapStyle::Butt),
"round" => Some(LineCapStyle::Round),
"square" => Some(LineCapStyle::Square),
_ => None
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum LineJoinStyle {
Round = 0,
Bevel = 1,
Miter = 2,
}
impl LineJoinStyle {
fn to_azure_style(&self) -> JoinStyle {
match *self {
LineJoinStyle::Round => JoinStyle::Round,
LineJoinStyle::Bevel => JoinStyle::Bevel,
LineJoinStyle::Miter => JoinStyle::Miter,
}
}
pub fn from_str(string: &str) -> Option<LineJoinStyle> {
match string {
"round" => Some(LineJoinStyle::Round),
"bevel" => Some(LineJoinStyle::Bevel),
"miter" => Some(LineJoinStyle::Miter),
_ => None
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum CompositionStyle {
SrcIn,
SrcOut,
SrcOver,
SrcAtop,
DestIn,
DestOut,
DestOver,
DestAtop,
Copy,
Lighter,
Xor,
}
impl CompositionStyle {
fn to_azure_style(&self) -> CompositionOp {
match *self {
CompositionStyle::SrcIn => CompositionOp::In,
CompositionStyle::SrcOut => CompositionOp::Out,
CompositionStyle::SrcOver => CompositionOp::Over,
CompositionStyle::SrcAtop => CompositionOp::Atop,
CompositionStyle::DestIn => CompositionOp::DestIn,
CompositionStyle::DestOut => CompositionOp::DestOut,
CompositionStyle::DestOver => CompositionOp::DestOver,
CompositionStyle::DestAtop => CompositionOp::DestAtop,
CompositionStyle::Copy => CompositionOp::Source,
CompositionStyle::Lighter => CompositionOp::Add,
CompositionStyle::Xor => CompositionOp::Xor,
}
}
pub fn from_str(string: &str) -> Option<CompositionStyle> {
match string {
"source-in" => Some(CompositionStyle::SrcIn),
"source-out" => Some(CompositionStyle::SrcOut),
"source-over" => Some(CompositionStyle::SrcOver),
"source-atop" => Some(CompositionStyle::SrcAtop),
"destination-in" => Some(CompositionStyle::DestIn),
"destination-out" => Some(CompositionStyle::DestOut),
"destination-over" => Some(CompositionStyle::DestOver),
"destination-atop" => Some(CompositionStyle::DestAtop),
"copy" => Some(CompositionStyle::Copy),
"lighter" => Some(CompositionStyle::Lighter),
"xor" => Some(CompositionStyle::Xor),
_ => None
}
}
pub fn to_str(&self) -> &str {
match *self {
CompositionStyle::SrcIn => "source-in",
CompositionStyle::SrcOut => "source-out",
CompositionStyle::SrcOver => "source-over",
CompositionStyle::SrcAtop => "source-atop",
CompositionStyle::DestIn => "destination-in",
CompositionStyle::DestOut => "destination-out",
CompositionStyle::DestOver => "destination-over",
CompositionStyle::DestAtop => "destination-atop",
CompositionStyle::Copy => "copy",
CompositionStyle::Lighter => "lighter",
CompositionStyle::Xor => "xor",
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum BlendingStyle {
Multiply,
Screen,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
}
impl BlendingStyle {
fn to_azure_style(&self) -> CompositionOp {
match *self {
BlendingStyle::Multiply => CompositionOp::Multiply,
BlendingStyle::Screen => CompositionOp::Screen,
BlendingStyle::Overlay => CompositionOp::Overlay,
BlendingStyle::Darken => CompositionOp::Darken,
BlendingStyle::Lighten => CompositionOp::Lighten,
BlendingStyle::ColorDodge => CompositionOp::ColorDodge,
BlendingStyle::ColorBurn => CompositionOp::ColorBurn,
BlendingStyle::HardLight => CompositionOp::HardLight,
BlendingStyle::SoftLight => CompositionOp::SoftLight,
BlendingStyle::Difference => CompositionOp::Difference,
BlendingStyle::Exclusion => CompositionOp::Exclusion,
BlendingStyle::Hue => CompositionOp::Hue,
BlendingStyle::Saturation => CompositionOp::Saturation,
BlendingStyle::Color => CompositionOp::Color,
BlendingStyle::Luminosity => CompositionOp::Luminosity,
}
}
pub fn from_str(string: &str) -> Option<BlendingStyle> {
match string {
"multiply" => Some(BlendingStyle::Multiply),
"screen" => Some(BlendingStyle::Screen),
"overlay" => Some(BlendingStyle::Overlay),
"darken" => Some(BlendingStyle::Darken),
"lighten" => Some(BlendingStyle::Lighten),
"color-dodge" => Some(BlendingStyle::ColorDodge),
"color-burn" => Some(BlendingStyle::ColorBurn),
"hard-light" => Some(BlendingStyle::HardLight),
"soft-light" => Some(BlendingStyle::SoftLight),
"difference" => Some(BlendingStyle::Difference),
"exclusion" => Some(BlendingStyle::Exclusion),
"hue" => Some(BlendingStyle::Hue),
"saturation" => Some(BlendingStyle::Saturation),
"color" => Some(BlendingStyle::Color),
"luminosity" => Some(BlendingStyle::Luminosity),
_ => None
}
}
pub fn to_str(&self) -> &str {
match *self {
BlendingStyle::Multiply => "multiply",
BlendingStyle::Screen => "screen",
BlendingStyle::Overlay => "overlay",
BlendingStyle::Darken => "darken",
BlendingStyle::Lighten => "lighten",
BlendingStyle::ColorDodge => "color-dodge",
BlendingStyle::ColorBurn => "color-burn",
BlendingStyle::HardLight => "hard-light",
BlendingStyle::SoftLight => "soft-light",
BlendingStyle::Difference => "difference",
BlendingStyle::Exclusion => "exclusion",
BlendingStyle::Hue => "hue",
BlendingStyle::Saturation => "saturation",
BlendingStyle::Color => "color",
BlendingStyle::Luminosity => "luminosity",
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum CompositionOrBlending {
Composition(CompositionStyle),
Blending(BlendingStyle),
}
impl CompositionOrBlending {
fn to_azure_style(&self) -> CompositionOp {
match *self {
CompositionOrBlending::Composition(op) => op.to_azure_style(),
CompositionOrBlending::Blending(op) => op.to_azure_style(),
}
}
pub fn default() -> CompositionOrBlending {
CompositionOrBlending::Composition(CompositionStyle::SrcOver)
}
pub fn from_str(string: &str) -> Option<CompositionOrBlending> {
if let Some(op) = CompositionStyle::from_str(string) {
return Some(CompositionOrBlending::Composition(op));
}
if let Some(op) = BlendingStyle::from_str(string) {
return Some(CompositionOrBlending::Blending(op));
}
None
}
}
/// Used by drawImage to get rid of the extra pixels of the image data that /// Used by drawImage to get rid of the extra pixels of the image data that
/// won't be copied to the canvas /// won't be copied to the canvas
/// image_data: Color pixel data of the image /// image_data: Color pixel data of the image

View file

@ -6,13 +6,15 @@
#![feature(collections)] #![feature(collections)]
#![feature(rustc_private)] #![feature(rustc_private)]
extern crate canvas_traits;
extern crate azure; extern crate azure;
extern crate cssparser; extern crate cssparser;
extern crate geom; extern crate geom;
extern crate gfx; extern crate gfx_traits;
extern crate util; extern crate util;
extern crate gleam; extern crate gleam;
extern crate num; extern crate num;
extern crate layers;
extern crate offscreen_gl_context; extern crate offscreen_gl_context;
#[macro_use] #[macro_use]
@ -20,4 +22,3 @@ extern crate log;
pub mod canvas_paint_task; pub mod canvas_paint_task;
pub mod webgl_paint_task; pub mod webgl_paint_task;
pub mod canvas_msg;

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas_msg::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg};
use geom::size::Size2D; use geom::size::Size2D;
use gleam::gl; use gleam::gl;
@ -14,7 +14,8 @@ use std::borrow::ToOwned;
use std::slice::bytes::copy_memory; use std::slice::bytes::copy_memory;
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::{channel, Sender};
use util::vec::byte_swap; use util::vec::byte_swap;
use offscreen_gl_context::{GLContext, GLContextAttributes}; use layers::platform::surface::NativeSurface;
use offscreen_gl_context::{GLContext, GLContextAttributes, ColorAttachmentType};
pub struct WebGLPaintTask { pub struct WebGLPaintTask {
size: Size2D<i32>, size: Size2D<i32>,
@ -29,7 +30,9 @@ unsafe impl Send for WebGLPaintTask {}
impl WebGLPaintTask { impl WebGLPaintTask {
fn new(size: Size2D<i32>) -> Result<WebGLPaintTask, &'static str> { fn new(size: Size2D<i32>) -> Result<WebGLPaintTask, &'static str> {
// TODO(ecoal95): Get the GLContextAttributes from the `GetContext` call // TODO(ecoal95): Get the GLContextAttributes from the `GetContext` call
let context = try!(GLContext::create_offscreen(size, GLContextAttributes::default())); let context = try!(GLContext::create_offscreen_with_color_attachment(size,
GLContextAttributes::default(),
ColorAttachmentType::TextureWithSurface));
Ok(WebGLPaintTask { Ok(WebGLPaintTask {
size: size, size: size,
original_context_size: size, original_context_size: size,
@ -76,7 +79,10 @@ impl WebGLPaintTask {
CanvasMsg::Common(message) => { CanvasMsg::Common(message) => {
match message { match message {
CanvasCommonMsg::Close => break, CanvasCommonMsg::Close => break,
CanvasCommonMsg::SendPixelContents(chan) => painter.send_pixel_contents(chan), CanvasCommonMsg::SendPixelContents(chan) =>
painter.send_pixel_contents(chan),
CanvasCommonMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
// TODO(ecoal95): handle error nicely // TODO(ecoal95): handle error nicely
CanvasCommonMsg::Recreate(size) => painter.recreate(size).unwrap(), CanvasCommonMsg::Recreate(size) => painter.recreate(size).unwrap(),
} }
@ -184,6 +190,12 @@ impl WebGLPaintTask {
chan.send(pixels).unwrap(); chan.send(pixels).unwrap();
} }
fn send_native_surface(&self, _: Sender<NativeSurface>) {
// FIXME(ecoal95): We need to make a clone of the surface in order to
// implement this
unimplemented!()
}
fn shader_source(&self, shader_id: u32, source_lines: Vec<String>) { fn shader_source(&self, shader_id: u32, source_lines: Vec<String>) {
let mut lines: Vec<&[u8]> = source_lines.iter().map(|line| line.as_bytes()).collect(); let mut lines: Vec<&[u8]> = source_lines.iter().map(|line| line.as_bytes()).collect();
gl::shader_source(shader_id, &mut lines); gl::shader_source(shader_id, &mut lines);

View file

@ -0,0 +1,23 @@
[package]
name = "canvas_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
[lib]
name = "canvas_traits"
path = "lib.rs"
[dependencies.gfx_traits]
path = "../gfx_traits"
[dependencies.geom]
git = "https://github.com/servo/rust-geom"
[dependencies.azure]
git = "https://github.com/servo/rust-azure"
[dependencies.layers]
git = "https://github.com/servo/rust-layers"
[dependencies]
cssparser = "0.3.1"

View file

@ -0,0 +1,433 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![crate_name = "canvas_traits"]
#![crate_type = "rlib"]
extern crate azure;
extern crate geom;
extern crate cssparser;
extern crate gfx_traits;
extern crate layers;
use azure::azure::AzFloat;
use azure::azure_hl::{DrawTarget, Pattern, ColorPattern};
use azure::azure_hl::{GradientStop, LinearGradientPattern, RadialGradientPattern, ExtendMode};
use azure::azure_hl::{JoinStyle, CapStyle, CompositionOp};
use cssparser::RGBA;
use geom::matrix2d::Matrix2D;
use geom::point::Point2D;
use geom::rect::Rect;
use geom::size::Size2D;
use gfx_traits::color;
use std::sync::mpsc::{Sender};
use layers::platform::surface::NativeSurface;
#[derive(Clone)]
pub enum CanvasMsg {
Canvas2d(Canvas2dMsg),
Common(CanvasCommonMsg),
WebGL(CanvasWebGLMsg),
}
#[derive(Clone)]
pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool),
ArcTo(Point2D<f32>, Point2D<f32>, f32),
DrawImage(Vec<u8>, Size2D<f64>, Rect<f64>, Rect<f64>, bool),
DrawImageSelf(Size2D<f64>, Rect<f64>, Rect<f64>, bool),
BeginPath,
BezierCurveTo(Point2D<f32>, Point2D<f32>, Point2D<f32>),
ClearRect(Rect<f32>),
Clip,
ClosePath,
Fill,
FillRect(Rect<f32>),
GetImageData(Rect<f64>, Size2D<f64>, Sender<Vec<u8>>),
LineTo(Point2D<f32>),
MoveTo(Point2D<f32>),
PutImageData(Vec<u8>, Rect<f64>, Option<Rect<f64>>),
QuadraticCurveTo(Point2D<f32>, Point2D<f32>),
Rect(Rect<f32>),
RestoreContext,
SaveContext,
StrokeRect(Rect<f32>),
Stroke,
SetFillStyle(FillOrStrokeStyle),
SetStrokeStyle(FillOrStrokeStyle),
SetLineWidth(f32),
SetLineCap(LineCapStyle),
SetLineJoin(LineJoinStyle),
SetMiterLimit(f32),
SetGlobalAlpha(f32),
SetGlobalComposition(CompositionOrBlending),
SetTransform(Matrix2D<f32>),
}
#[derive(Clone)]
pub enum CanvasWebGLMsg {
AttachShader(u32, u32),
BindBuffer(u32, u32),
BufferData(u32, Vec<f32>, u32),
Clear(u32),
ClearColor(f32, f32, f32, f32),
CompileShader(u32),
CreateBuffer(Sender<u32>),
CreateProgram(Sender<u32>),
CreateShader(u32, Sender<u32>),
DrawArrays(u32, i32, i32),
EnableVertexAttribArray(u32),
GetAttribLocation(u32, String, Sender<i32>),
GetShaderInfoLog(u32, Sender<String>),
GetShaderParameter(u32, u32, Sender<i32>),
GetUniformLocation(u32, String, Sender<u32>),
LinkProgram(u32),
ShaderSource(u32, Vec<String>),
Uniform4fv(u32, Vec<f32>),
UseProgram(u32),
VertexAttribPointer2f(u32, i32, bool, i32, i64),
Viewport(i32, i32, i32, i32),
}
#[derive(Clone)]
pub enum CanvasCommonMsg {
Close,
Recreate(Size2D<i32>),
SendPixelContents(Sender<Vec<u8>>),
SendNativeSurface(Sender<NativeSurface>),
}
#[derive(Clone)]
pub struct CanvasGradientStop {
pub offset: f64,
pub color: RGBA,
}
#[derive(Clone)]
pub struct LinearGradientStyle {
pub x0: f64,
pub y0: f64,
pub x1: f64,
pub y1: f64,
pub stops: Vec<CanvasGradientStop>
}
impl LinearGradientStyle {
pub fn new(x0: f64, y0: f64, x1: f64, y1: f64, stops: Vec<CanvasGradientStop>)
-> LinearGradientStyle {
LinearGradientStyle {
x0: x0,
y0: y0,
x1: x1,
y1: y1,
stops: stops,
}
}
}
#[derive(Clone)]
pub struct RadialGradientStyle {
pub x0: f64,
pub y0: f64,
pub r0: f64,
pub x1: f64,
pub y1: f64,
pub r1: f64,
pub stops: Vec<CanvasGradientStop>
}
impl RadialGradientStyle {
pub fn new(x0: f64, y0: f64, r0: f64, x1: f64, y1: f64, r1: f64, stops: Vec<CanvasGradientStop>)
-> RadialGradientStyle {
RadialGradientStyle {
x0: x0,
y0: y0,
r0: r0,
x1: x1,
y1: y1,
r1: r1,
stops: stops,
}
}
}
#[derive(Clone)]
pub enum FillOrStrokeStyle {
Color(RGBA),
LinearGradient(LinearGradientStyle),
RadialGradient(RadialGradientStyle),
}
impl FillOrStrokeStyle {
pub fn to_azure_pattern(&self, drawtarget: &DrawTarget) -> Pattern {
match *self {
FillOrStrokeStyle::Color(ref color) => {
Pattern::Color(ColorPattern::new(color::new(color.red,
color.green,
color.blue,
color.alpha)))
},
FillOrStrokeStyle::LinearGradient(ref linear_gradient_style) => {
let gradient_stops: Vec<GradientStop> = linear_gradient_style.stops.iter().map(|s| {
GradientStop {
offset: s.offset as AzFloat,
color: color::new(s.color.red, s.color.green, s.color.blue, s.color.alpha)
}
}).collect();
Pattern::LinearGradient(LinearGradientPattern::new(
&Point2D(linear_gradient_style.x0 as AzFloat, linear_gradient_style.y0 as AzFloat),
&Point2D(linear_gradient_style.x1 as AzFloat, linear_gradient_style.y1 as AzFloat),
drawtarget.create_gradient_stops(&gradient_stops, ExtendMode::Clamp),
&Matrix2D::identity()))
},
FillOrStrokeStyle::RadialGradient(ref radial_gradient_style) => {
let gradient_stops: Vec<GradientStop> = radial_gradient_style.stops.iter().map(|s| {
GradientStop {
offset: s.offset as AzFloat,
color: color::new(s.color.red, s.color.green, s.color.blue, s.color.alpha)
}
}).collect();
Pattern::RadialGradient(RadialGradientPattern::new(
&Point2D(radial_gradient_style.x0 as AzFloat, radial_gradient_style.y0 as AzFloat),
&Point2D(radial_gradient_style.x1 as AzFloat, radial_gradient_style.y1 as AzFloat),
radial_gradient_style.r0 as AzFloat, radial_gradient_style.r1 as AzFloat,
drawtarget.create_gradient_stops(&gradient_stops, ExtendMode::Clamp),
&Matrix2D::identity()))
}
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum LineCapStyle {
Butt = 0,
Round = 1,
Square = 2,
}
impl LineCapStyle {
pub fn to_azure_style(&self) -> CapStyle {
match *self {
LineCapStyle::Butt => CapStyle::Butt,
LineCapStyle::Round => CapStyle::Round,
LineCapStyle::Square => CapStyle::Square,
}
}
pub fn from_str(string: &str) -> Option<LineCapStyle> {
match string {
"butt" => Some(LineCapStyle::Butt),
"round" => Some(LineCapStyle::Round),
"square" => Some(LineCapStyle::Square),
_ => None
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum LineJoinStyle {
Round = 0,
Bevel = 1,
Miter = 2,
}
impl LineJoinStyle {
pub fn to_azure_style(&self) -> JoinStyle {
match *self {
LineJoinStyle::Round => JoinStyle::Round,
LineJoinStyle::Bevel => JoinStyle::Bevel,
LineJoinStyle::Miter => JoinStyle::Miter,
}
}
pub fn from_str(string: &str) -> Option<LineJoinStyle> {
match string {
"round" => Some(LineJoinStyle::Round),
"bevel" => Some(LineJoinStyle::Bevel),
"miter" => Some(LineJoinStyle::Miter),
_ => None
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum CompositionStyle {
SrcIn,
SrcOut,
SrcOver,
SrcAtop,
DestIn,
DestOut,
DestOver,
DestAtop,
Copy,
Lighter,
Xor,
}
impl CompositionStyle {
pub fn to_azure_style(&self) -> CompositionOp {
match *self {
CompositionStyle::SrcIn => CompositionOp::In,
CompositionStyle::SrcOut => CompositionOp::Out,
CompositionStyle::SrcOver => CompositionOp::Over,
CompositionStyle::SrcAtop => CompositionOp::Atop,
CompositionStyle::DestIn => CompositionOp::DestIn,
CompositionStyle::DestOut => CompositionOp::DestOut,
CompositionStyle::DestOver => CompositionOp::DestOver,
CompositionStyle::DestAtop => CompositionOp::DestAtop,
CompositionStyle::Copy => CompositionOp::Source,
CompositionStyle::Lighter => CompositionOp::Add,
CompositionStyle::Xor => CompositionOp::Xor,
}
}
pub fn from_str(string: &str) -> Option<CompositionStyle> {
match string {
"source-in" => Some(CompositionStyle::SrcIn),
"source-out" => Some(CompositionStyle::SrcOut),
"source-over" => Some(CompositionStyle::SrcOver),
"source-atop" => Some(CompositionStyle::SrcAtop),
"destination-in" => Some(CompositionStyle::DestIn),
"destination-out" => Some(CompositionStyle::DestOut),
"destination-over" => Some(CompositionStyle::DestOver),
"destination-atop" => Some(CompositionStyle::DestAtop),
"copy" => Some(CompositionStyle::Copy),
"lighter" => Some(CompositionStyle::Lighter),
"xor" => Some(CompositionStyle::Xor),
_ => None
}
}
pub fn to_str(&self) -> &str {
match *self {
CompositionStyle::SrcIn => "source-in",
CompositionStyle::SrcOut => "source-out",
CompositionStyle::SrcOver => "source-over",
CompositionStyle::SrcAtop => "source-atop",
CompositionStyle::DestIn => "destination-in",
CompositionStyle::DestOut => "destination-out",
CompositionStyle::DestOver => "destination-over",
CompositionStyle::DestAtop => "destination-atop",
CompositionStyle::Copy => "copy",
CompositionStyle::Lighter => "lighter",
CompositionStyle::Xor => "xor",
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum BlendingStyle {
Multiply,
Screen,
Overlay,
Darken,
Lighten,
ColorDodge,
ColorBurn,
HardLight,
SoftLight,
Difference,
Exclusion,
Hue,
Saturation,
Color,
Luminosity,
}
impl BlendingStyle {
pub fn to_azure_style(&self) -> CompositionOp {
match *self {
BlendingStyle::Multiply => CompositionOp::Multiply,
BlendingStyle::Screen => CompositionOp::Screen,
BlendingStyle::Overlay => CompositionOp::Overlay,
BlendingStyle::Darken => CompositionOp::Darken,
BlendingStyle::Lighten => CompositionOp::Lighten,
BlendingStyle::ColorDodge => CompositionOp::ColorDodge,
BlendingStyle::ColorBurn => CompositionOp::ColorBurn,
BlendingStyle::HardLight => CompositionOp::HardLight,
BlendingStyle::SoftLight => CompositionOp::SoftLight,
BlendingStyle::Difference => CompositionOp::Difference,
BlendingStyle::Exclusion => CompositionOp::Exclusion,
BlendingStyle::Hue => CompositionOp::Hue,
BlendingStyle::Saturation => CompositionOp::Saturation,
BlendingStyle::Color => CompositionOp::Color,
BlendingStyle::Luminosity => CompositionOp::Luminosity,
}
}
pub fn from_str(string: &str) -> Option<BlendingStyle> {
match string {
"multiply" => Some(BlendingStyle::Multiply),
"screen" => Some(BlendingStyle::Screen),
"overlay" => Some(BlendingStyle::Overlay),
"darken" => Some(BlendingStyle::Darken),
"lighten" => Some(BlendingStyle::Lighten),
"color-dodge" => Some(BlendingStyle::ColorDodge),
"color-burn" => Some(BlendingStyle::ColorBurn),
"hard-light" => Some(BlendingStyle::HardLight),
"soft-light" => Some(BlendingStyle::SoftLight),
"difference" => Some(BlendingStyle::Difference),
"exclusion" => Some(BlendingStyle::Exclusion),
"hue" => Some(BlendingStyle::Hue),
"saturation" => Some(BlendingStyle::Saturation),
"color" => Some(BlendingStyle::Color),
"luminosity" => Some(BlendingStyle::Luminosity),
_ => None
}
}
pub fn to_str(&self) -> &str {
match *self {
BlendingStyle::Multiply => "multiply",
BlendingStyle::Screen => "screen",
BlendingStyle::Overlay => "overlay",
BlendingStyle::Darken => "darken",
BlendingStyle::Lighten => "lighten",
BlendingStyle::ColorDodge => "color-dodge",
BlendingStyle::ColorBurn => "color-burn",
BlendingStyle::HardLight => "hard-light",
BlendingStyle::SoftLight => "soft-light",
BlendingStyle::Difference => "difference",
BlendingStyle::Exclusion => "exclusion",
BlendingStyle::Hue => "hue",
BlendingStyle::Saturation => "saturation",
BlendingStyle::Color => "color",
BlendingStyle::Luminosity => "luminosity",
}
}
}
#[derive(Copy, Clone, PartialEq)]
pub enum CompositionOrBlending {
Composition(CompositionStyle),
Blending(BlendingStyle),
}
impl CompositionOrBlending {
pub fn to_azure_style(&self) -> CompositionOp {
match *self {
CompositionOrBlending::Composition(op) => op.to_azure_style(),
CompositionOrBlending::Blending(op) => op.to_azure_style(),
}
}
pub fn default() -> CompositionOrBlending {
CompositionOrBlending::Composition(CompositionStyle::SrcOver)
}
pub fn from_str(string: &str) -> Option<CompositionOrBlending> {
if let Some(op) = CompositionStyle::from_str(string) {
return Some(CompositionOrBlending::Composition(op));
}
if let Some(op) = BlendingStyle::from_str(string) {
return Some(CompositionOrBlending::Blending(op));
}
None
}
}

View file

@ -10,6 +10,9 @@ path = "lib.rs"
[dependencies.gfx] [dependencies.gfx]
path = "../gfx" path = "../gfx"
[dependencies.gfx_traits]
path = "../gfx_traits"
[dependencies.layout_traits] [dependencies.layout_traits]
path = "../layout_traits" path = "../layout_traits"

View file

@ -14,8 +14,8 @@ use windowing::{MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}
use geom::point::{Point2D, TypedPoint2D}; use geom::point::{Point2D, TypedPoint2D};
use geom::rect::{Rect, TypedRect}; use geom::rect::{Rect, TypedRect};
use geom::scale_factor::ScaleFactor; use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D; use geom::size::{Size2D, TypedSize2D};
use gfx::color; use gfx_traits::color;
use gfx::paint_task::Msg as PaintMsg; use gfx::paint_task::Msg as PaintMsg;
use gfx::paint_task::PaintRequest; use gfx::paint_task::PaintRequest;
use gleam::gl::types::{GLint, GLsizei}; use gleam::gl::types::{GLint, GLsizei};
@ -25,6 +25,7 @@ use layers::layers::{BufferRequest, Layer, LayerBuffer, LayerBufferSet};
use layers::rendergl::RenderContext; use layers::rendergl::RenderContext;
use layers::rendergl; use layers::rendergl;
use layers::scene::Scene; use layers::scene::Scene;
use layout_traits::{LayoutControlChan, LayoutControlMsg};
use msg::compositor_msg::{Epoch, FrameTreeId, LayerId}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId};
use msg::compositor_msg::{LayerProperties, ScrollPolicy}; use msg::compositor_msg::{LayerProperties, ScrollPolicy};
use msg::constellation_msg::AnimationState; use msg::constellation_msg::AnimationState;
@ -45,7 +46,7 @@ use std::sync::mpsc::Sender;
use style::viewport::ViewportConstraints; use style::viewport::ViewportConstraints;
use time::{precise_time_ns, precise_time_s}; use time::{precise_time_ns, precise_time_s};
use url::Url; use url::Url;
use util::geometry::{PagePx, ScreenPx, ViewportPx}; use util::geometry::{Au, PagePx, ScreenPx, ViewportPx};
use util::opts; use util::opts;
/// Holds the state when running reftests that determines when it is /// Holds the state when running reftests that determines when it is
@ -434,7 +435,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
self.remove_pipeline_root_layer(pipeline_id); self.remove_pipeline_root_layer(pipeline_id);
} }
(Msg::ViewportConstrained(pipeline_id, constraints), ShutdownState::NotShuttingDown) => { (Msg::ViewportConstrained(pipeline_id, constraints),
ShutdownState::NotShuttingDown) => {
self.constrain_viewport(pipeline_id, constraints); self.constrain_viewport(pipeline_id, constraints);
} }
@ -701,7 +703,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
panic!("Compositor: Tried to scroll to fragment with unknown layer."); panic!("Compositor: Tried to scroll to fragment with unknown layer.");
} }
self.start_scrolling_timer_if_necessary(); self.perform_updates_after_scroll();
} }
} }
@ -937,9 +939,57 @@ impl<Window: WindowMethods> IOCompositor<Window> {
} }
} }
/// Computes new display ports for each layer, taking the scroll position into account, and
/// sends them to layout as necessary. This ultimately triggers a rerender of the content.
fn send_updated_display_ports_to_layout(&mut self) {
fn process_layer(layer: &Layer<CompositorData>,
window_size: &TypedSize2D<LayerPixel, f32>,
new_display_ports: &mut HashMap<PipelineId, Vec<(LayerId, Rect<Au>)>>) {
let visible_rect =
Rect(Point2D::zero(), *window_size).translate(&-*layer.content_offset.borrow())
.intersection(&*layer.bounds.borrow())
.unwrap_or(Rect::zero())
.to_untyped();
let visible_rect = Rect(Point2D(Au::from_f32_px(visible_rect.origin.x),
Au::from_f32_px(visible_rect.origin.y)),
Size2D(Au::from_f32_px(visible_rect.size.width),
Au::from_f32_px(visible_rect.size.height)));
let extra_layer_data = layer.extra_data.borrow();
if !new_display_ports.contains_key(&extra_layer_data.pipeline_id) {
new_display_ports.insert(extra_layer_data.pipeline_id, Vec::new());
}
new_display_ports.get_mut(&extra_layer_data.pipeline_id)
.unwrap()
.push((extra_layer_data.id, visible_rect));
for kid in layer.children.borrow().iter() {
process_layer(&*kid, window_size, new_display_ports)
}
}
let dppx = self.page_zoom * self.device_pixels_per_screen_px();
let window_size = self.window_size.as_f32() / dppx * ScaleFactor::new(1.0);
let mut new_visible_rects = HashMap::new();
if let Some(ref layer) = self.scene.root {
process_layer(&**layer, &window_size, &mut new_visible_rects)
}
for (pipeline_id, new_visible_rects) in new_visible_rects.iter() {
if let Some(pipeline_details) = self.pipeline_details.get(&pipeline_id) {
if let Some(ref pipeline) = pipeline_details.pipeline {
let LayoutControlChan(ref sender) = pipeline.layout_chan;
sender.send(LayoutControlMsg::SetVisibleRects((*new_visible_rects).clone()))
.unwrap()
}
}
}
}
/// Performs buffer requests and starts the scrolling timer or schedules a recomposite as /// Performs buffer requests and starts the scrolling timer or schedules a recomposite as
/// necessary. /// necessary.
fn perform_updates_after_scroll(&mut self) { fn perform_updates_after_scroll(&mut self) {
self.send_updated_display_ports_to_layout();
if self.send_buffer_requests_for_all_layers() { if self.send_buffer_requests_for_all_layers() {
self.start_scrolling_timer_if_necessary(); self.start_scrolling_timer_if_necessary();
} else { } else {
@ -953,7 +1003,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
if pipeline_details.animations_running || if pipeline_details.animations_running ||
pipeline_details.animation_callbacks_running { pipeline_details.animation_callbacks_running {
self.constellation_chan.0.send(ConstellationMsg::TickAnimation(*pipeline_id)).unwrap(); self.constellation_chan.0.send(ConstellationMsg::TickAnimation(*pipeline_id))
.unwrap();
} }
} }
} }
@ -1014,7 +1065,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
if let Some(min_zoom) = self.min_viewport_zoom.as_ref() { if let Some(min_zoom) = self.min_viewport_zoom.as_ref() {
viewport_zoom = min_zoom.get().max(viewport_zoom) viewport_zoom = min_zoom.get().max(viewport_zoom)
} }
let viewport_zoom = self.max_viewport_zoom.as_ref().map_or(1., |z| z.get()).min(viewport_zoom); let viewport_zoom = self.max_viewport_zoom
.as_ref()
.map_or(1., |z| z.get())
.min(viewport_zoom);
let viewport_zoom = ScaleFactor::new(viewport_zoom); let viewport_zoom = ScaleFactor::new(viewport_zoom);
self.viewport_zoom = viewport_zoom; self.viewport_zoom = viewport_zoom;
@ -1305,7 +1359,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
rv rv
} }
fn draw_png(&self, framebuffer_ids: Vec<gl::GLuint>, texture_ids: Vec<gl::GLuint>, width: usize, height: usize) -> png::Image { fn draw_png(&self,
framebuffer_ids: Vec<gl::GLuint>,
texture_ids: Vec<gl::GLuint>,
width: usize,
height: usize)
-> png::Image {
let mut pixels = gl::read_pixels(0, 0, let mut pixels = gl::read_pixels(0, 0,
width as gl::GLsizei, width as gl::GLsizei,
height as gl::GLsizei, height as gl::GLsizei,
@ -1439,7 +1498,7 @@ fn find_layer_with_pipeline_and_layer_id_for_layer(layer: Rc<Layer<CompositorDat
} }
impl<Window> CompositorEventListener for IOCompositor<Window> where Window: WindowMethods { impl<Window> CompositorEventListener for IOCompositor<Window> where Window: WindowMethods {
fn handle_event(&mut self, msg: WindowEvent) -> bool { fn handle_events(&mut self, messages: Vec<WindowEvent>) -> bool {
// Check for new messages coming from the other tasks in the system. // Check for new messages coming from the other tasks in the system.
loop { loop {
match self.port.try_recv_compositor_msg() { match self.port.try_recv_compositor_msg() {
@ -1459,8 +1518,10 @@ impl<Window> CompositorEventListener for IOCompositor<Window> where Window: Wind
return false; return false;
} }
// Handle the message coming from the windowing system. // Handle any messages coming from the windowing system.
self.handle_window_message(msg); for message in messages.into_iter() {
self.handle_window_message(message);
}
// If a pinch-zoom happened recently, ask for tiles at the new resolution // If a pinch-zoom happened recently, ask for tiles at the new resolution
if self.zoom_action && precise_time_s() - self.zoom_time > 0.3 { if self.zoom_action && precise_time_s() - self.zoom_time > 0.3 {

View file

@ -87,7 +87,8 @@ pub trait CompositorLayer {
/// Destroys tiles for this layer and all descendent layers, sending the buffers back to the /// Destroys tiles for this layer and all descendent layers, sending the buffers back to the
/// painter to be destroyed or reused. /// painter to be destroyed or reused.
fn clear_all_tiles<Window>(&self, compositor: &IOCompositor<Window>) where Window: WindowMethods; fn clear_all_tiles<Window>(&self, compositor: &IOCompositor<Window>)
where Window: WindowMethods;
/// Removes the root layer (and any children) for a given pipeline from the /// Removes the root layer (and any children) for a given pipeline from the
/// compositor. Buffers that the compositor is holding are returned to the /// compositor. Buffers that the compositor is holding are returned to the

View file

@ -94,7 +94,13 @@ impl PaintListener for Box<CompositorProxy+'static+Send> {
fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata> { fn get_graphics_metadata(&mut self) -> Option<NativeGraphicsMetadata> {
let (chan, port) = channel(); let (chan, port) = channel();
self.send(Msg::GetGraphicsMetadata(chan)); self.send(Msg::GetGraphicsMetadata(chan));
port.recv().unwrap() // If the compositor is shutting down when a paint task
// is being created, the compositor won't respond to
// this message, resulting in an eventual panic. Instead,
// just return None in this case, since the paint task
// will exit shortly and never actually be requested
// to paint buffers by the compositor.
port.recv().unwrap_or(None)
} }
fn assign_painted_buffers(&mut self, fn assign_painted_buffers(&mut self,
@ -248,7 +254,7 @@ impl CompositorTask {
} }
pub trait CompositorEventListener { pub trait CompositorEventListener {
fn handle_event(&mut self, event: WindowEvent) -> bool; fn handle_events(&mut self, events: Vec<WindowEvent>) -> bool;
fn repaint_synchronously(&mut self); fn repaint_synchronously(&mut self);
fn shutdown(&mut self); fn shutdown(&mut self);
fn pinch_zoom_level(&self) -> f32; fn pinch_zoom_level(&self) -> f32;

View file

@ -66,7 +66,7 @@ impl NullCompositor {
} }
impl CompositorEventListener for NullCompositor { impl CompositorEventListener for NullCompositor {
fn handle_event(&mut self, _: WindowEvent) -> bool { fn handle_events(&mut self, _: Vec<WindowEvent>) -> bool {
match self.port.recv_compositor_msg() { match self.port.recv_compositor_msg() {
Msg::Exit(chan) => { Msg::Exit(chan) => {
debug!("shutting down the constellation"); debug!("shutting down the constellation");

View file

@ -23,6 +23,7 @@ extern crate net;
extern crate num; extern crate num;
extern crate profile_traits; extern crate profile_traits;
extern crate net_traits; extern crate net_traits;
extern crate gfx_traits;
extern crate style; extern crate style;
#[macro_use] #[macro_use]
extern crate util; extern crate util;
@ -45,12 +46,11 @@ pub use constellation::Constellation;
pub mod compositor_task; pub mod compositor_task;
mod compositor_layer; mod compositor_layer;
mod scrolling;
mod compositor; mod compositor;
mod headless; mod headless;
mod scrolling;
pub mod pipeline; pub mod pipeline;
pub mod constellation; pub mod constellation;
pub mod windowing; pub mod windowing;

View file

@ -52,6 +52,7 @@ pub struct Pipeline {
pub struct CompositionPipeline { pub struct CompositionPipeline {
pub id: PipelineId, pub id: PipelineId,
pub script_chan: ScriptControlChan, pub script_chan: ScriptControlChan,
pub layout_chan: LayoutControlChan,
pub paint_chan: PaintChan, pub paint_chan: PaintChan,
} }
@ -245,6 +246,7 @@ impl Pipeline {
CompositionPipeline { CompositionPipeline {
id: self.id.clone(), id: self.id.clone(),
script_chan: self.script_chan.clone(), script_chan: self.script_chan.clone(),
layout_chan: self.layout_chan.clone(),
paint_chan: self.paint_chan.clone(), paint_chan: self.paint_chan.clone(),
} }
} }

View file

@ -11,9 +11,15 @@ path = "lib.rs"
[dependencies.plugins] [dependencies.plugins]
path = "../plugins" path = "../plugins"
[dependencies.gfx_traits]
path = "../gfx_traits"
[dependencies.net_traits] [dependencies.net_traits]
path = "../net_traits" path = "../net_traits"
[dependencies.canvas_traits]
path = "../canvas_traits"
[dependencies.util] [dependencies.util]
path = "../util" path = "../util"

View file

@ -38,6 +38,9 @@ extern crate skia;
extern crate time; extern crate time;
extern crate url; extern crate url;
extern crate gfx_traits;
extern crate canvas_traits;
// Eventually we would like the shaper to be pluggable, as many operating systems have their own // Eventually we would like the shaper to be pluggable, as many operating systems have their own
// shapers. For now, however, this is a hard dependency. // shapers. For now, however, this is a hard dependency.
extern crate harfbuzz; extern crate harfbuzz;
@ -59,8 +62,6 @@ pub use paint_context::PaintContext;
// Private painting modules // Private painting modules
mod paint_context; mod paint_context;
// Painting
pub mod color;
#[path="display_list/mod.rs"] #[path="display_list/mod.rs"]
pub mod display_list; pub mod display_list;
pub mod paint_task; pub mod paint_task;

View file

@ -4,7 +4,7 @@
//! Painting of display lists using Moz2D/Azure. //! Painting of display lists using Moz2D/Azure.
use color; use gfx_traits::color;
use display_list::TextOrientation::{SidewaysLeft, SidewaysRight, Upright}; use display_list::TextOrientation::{SidewaysLeft, SidewaysRight, Upright};
use display_list::{BLUR_INFLATION_FACTOR, BorderRadii, BoxShadowClipMode, ClippingRegion}; use display_list::{BLUR_INFLATION_FACTOR, BorderRadii, BoxShadowClipMode, ClippingRegion};
use display_list::{TextDisplayItem}; use display_list::{TextDisplayItem};

View file

@ -20,6 +20,7 @@ use layers::platform::surface::{NativeGraphicsMetadata, NativePaintingGraphicsCo
use layers::platform::surface::NativeSurface; use layers::platform::surface::NativeSurface;
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
use layers; use layers;
use canvas_traits::CanvasMsg;
use msg::compositor_msg::{Epoch, FrameTreeId, LayerId}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId};
use msg::compositor_msg::{LayerProperties, PaintListener, ScrollPolicy}; use msg::compositor_msg::{LayerProperties, PaintListener, ScrollPolicy};
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
@ -30,8 +31,9 @@ use rand::{self, Rng};
use skia::SkiaGrGLNativeContextRef; use skia::SkiaGrGLNativeContextRef;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::mem; use std::mem;
use std::sync::Arc; use std::sync::{Arc, Mutex};
use std::sync::mpsc::{Receiver, Sender, channel}; use std::sync::mpsc::{Receiver, Sender, channel};
use std::collections::HashMap;
use util::geometry::{Au, ZERO_POINT}; use util::geometry::{Au, ZERO_POINT};
use util::opts; use util::opts;
use util::task::spawn_named_with_send_on_failure; use util::task::spawn_named_with_send_on_failure;
@ -69,6 +71,7 @@ pub struct PaintRequest {
pub enum Msg { pub enum Msg {
PaintInit(Epoch, Arc<StackingContext>), PaintInit(Epoch, Arc<StackingContext>),
CanvasLayer(LayerId, Arc<Mutex<Sender<CanvasMsg>>>),
Paint(Vec<PaintRequest>, FrameTreeId), Paint(Vec<PaintRequest>, FrameTreeId),
UnusedBuffer(Vec<Box<LayerBuffer>>), UnusedBuffer(Vec<Box<LayerBuffer>>),
PaintPermissionGranted, PaintPermissionGranted,
@ -125,6 +128,9 @@ pub struct PaintTask<C> {
/// Tracks the number of buffers that the compositor currently owns. The /// Tracks the number of buffers that the compositor currently owns. The
/// PaintTask waits to exit until all buffers are returned. /// PaintTask waits to exit until all buffers are returned.
used_buffer_count: usize, used_buffer_count: usize,
/// A map to track the canvas specific layers
canvas_map: HashMap<LayerId, Arc<Mutex<Sender<CanvasMsg>>>>,
} }
// If we implement this as a function, we get borrowck errors from borrowing // If we implement this as a function, we get borrowck errors from borrowing
@ -145,7 +151,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
time_profiler_chan: time::ProfilerChan, time_profiler_chan: time::ProfilerChan,
shutdown_chan: Sender<()>) { shutdown_chan: Sender<()>) {
let ConstellationChan(c) = constellation_chan.clone(); let ConstellationChan(c) = constellation_chan.clone();
spawn_named_with_send_on_failure("PaintTask", task_state::PAINT, move || { spawn_named_with_send_on_failure(format!("PaintTask {:?}", id), task_state::PAINT, move || {
{ {
// Ensures that the paint task and graphics context are destroyed before the // Ensures that the paint task and graphics context are destroyed before the
// shutdown message. // shutdown message.
@ -170,6 +176,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
buffer_map: BufferMap::new(10000000), buffer_map: BufferMap::new(10000000),
worker_threads: worker_threads, worker_threads: worker_threads,
used_buffer_count: 0, used_buffer_count: 0,
canvas_map: HashMap::new()
}; };
paint_task.start(); paint_task.start();
@ -216,6 +223,11 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
self.initialize_layers(); self.initialize_layers();
} }
// Inserts a new canvas renderer to the layer map
Msg::CanvasLayer(layer_id, canvas_renderer) => {
debug!("Renderer received for canvas with layer {:?}", layer_id);
self.canvas_map.insert(layer_id, canvas_renderer);
}
Msg::Paint(requests, frame_tree_id) => { Msg::Paint(requests, frame_tree_id) => {
if !self.paint_permission { if !self.paint_permission {
debug!("PaintTask: paint ready msg"); debug!("PaintTask: paint ready msg");
@ -245,7 +257,10 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
} }
debug!("PaintTask: returning surfaces"); debug!("PaintTask: returning surfaces");
self.compositor.assign_painted_buffers(self.id, self.current_epoch.unwrap(), replies, frame_tree_id); self.compositor.assign_painted_buffers(self.id,
self.current_epoch.unwrap(),
replies,
frame_tree_id);
} }
Msg::UnusedBuffer(unused_buffers) => { Msg::UnusedBuffer(unused_buffers) => {
debug!("PaintTask {:?}: Received {} unused buffers", self.id, unused_buffers.len()); debug!("PaintTask {:?}: Received {} unused buffers", self.id, unused_buffers.len());
@ -293,7 +308,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send + 'static {
// If we own buffers in the compositor and we are not exiting completely, wait // If we own buffers in the compositor and we are not exiting completely, wait
// for the compositor to return buffers, so that we can release them properly. // for the compositor to return buffers, so that we can release them properly.
// When doing a complete exit, the compositor lets all buffers leak. // When doing a complete exit, the compositor lets all buffers leak.
println!("PaintTask {:?}: Saw ExitMsg, {} buffers in use", self.id, self.used_buffer_count); debug!("PaintTask {:?}: Saw ExitMsg, {} buffers in use", self.id, self.used_buffer_count);
waiting_for_compositor_buffers_to_exit = true; waiting_for_compositor_buffers_to_exit = true;
exit_response_channel = response_channel; exit_response_channel = response_channel;
} }

View file

@ -31,6 +31,7 @@ use std::ptr;
static FC_FAMILY: &'static [u8] = b"family\0"; static FC_FAMILY: &'static [u8] = b"family\0";
static FC_FILE: &'static [u8] = b"file\0"; static FC_FILE: &'static [u8] = b"file\0";
static FC_INDEX: &'static [u8] = b"index\0"; static FC_INDEX: &'static [u8] = b"index\0";
static FC_FONTFORMAT: &'static [u8] = b"fontformat\0";
pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) { pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) {
unsafe { unsafe {
@ -39,7 +40,20 @@ pub fn get_available_families<F>(mut callback: F) where F: FnMut(String) {
for i in 0..((*fontSet).nfont as isize) { for i in 0..((*fontSet).nfont as isize) {
let font = (*fontSet).fonts.offset(i); let font = (*fontSet).fonts.offset(i);
let mut family: *mut FcChar8 = ptr::null_mut(); let mut family: *mut FcChar8 = ptr::null_mut();
let mut format: *mut FcChar8 = ptr::null_mut();
let mut v: c_int = 0; let mut v: c_int = 0;
if FcPatternGetString(*font, FC_FONTFORMAT.as_ptr() as *mut c_char, v, &mut format) != FcResultMatch {
continue;
}
// Skip bitmap fonts. They aren't supported by FreeType.
let fontformat = c_str_to_string(format as *const c_char);
if fontformat != "TrueType" &&
fontformat != "CFF" &&
fontformat != "Type 1" {
continue;
}
while FcPatternGetString(*font, FC_FAMILY.as_ptr() as *mut c_char, v, &mut family) == FcResultMatch { while FcPatternGetString(*font, FC_FAMILY.as_ptr() as *mut c_char, v, &mut family) == FcResultMatch {
let family_name = c_str_to_string(family as *const c_char); let family_name = c_str_to_string(family as *const c_char);
callback(family_name); callback(family_name);

View file

@ -0,0 +1,11 @@
[package]
name = "gfx_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
[lib]
name = "gfx_traits"
path = "lib.rs"
[dependencies.azure]
git = "https://github.com/servo/rust-azure"

View file

@ -0,0 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![crate_name = "gfx_traits"]
#![crate_type = "rlib"]
extern crate azure;
pub mod color;

View file

@ -13,9 +13,15 @@ git = "https://github.com/servo/rust-azure"
[dependencies.canvas] [dependencies.canvas]
path = "../canvas" path = "../canvas"
[dependencies.canvas_traits]
path = "../canvas_traits"
[dependencies.gfx] [dependencies.gfx]
path = "../gfx" path = "../gfx"
[dependencies.gfx_traits]
path = "../gfx_traits"
[dependencies.msg] [dependencies.msg]
path = "../msg" path = "../msg"

View file

@ -43,6 +43,7 @@ use flow::{CLEARS_LEFT, CLEARS_RIGHT};
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo}; use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, SpecificFragmentInfo};
use incremental::{REFLOW, REFLOW_OUT_OF_FLOW}; use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
use layout_debug; use layout_debug;
use layout_task::DISPLAY_PORT_SIZE_FACTOR;
use model::{IntrinsicISizes, MarginCollapseInfo}; use model::{IntrinsicISizes, MarginCollapseInfo};
use model::{MaybeAuto, CollapsibleMargins, specified, specified_or_none}; use model::{MaybeAuto, CollapsibleMargins, specified, specified_or_none};
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
@ -59,7 +60,7 @@ use style::computed_values::{position, text_align};
use style::properties::ComputedValues; use style::properties::ComputedValues;
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto}; use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
use style::values::computed::{LengthOrPercentageOrNone}; use style::values::computed::{LengthOrPercentageOrNone};
use util::geometry::{Au, MAX_AU}; use util::geometry::{Au, MAX_AU, MAX_RECT};
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
use util::opts; use util::opts;
@ -377,7 +378,9 @@ impl Iterator for CandidateBSizeIterator {
Some(max_block_size) if self.candidate_value > max_block_size => { Some(max_block_size) if self.candidate_value > max_block_size => {
CandidateBSizeIteratorStatus::TryingMax CandidateBSizeIteratorStatus::TryingMax
} }
_ if self.candidate_value < self.min_block_size => CandidateBSizeIteratorStatus::TryingMin, _ if self.candidate_value < self.min_block_size => {
CandidateBSizeIteratorStatus::TryingMin
}
_ => CandidateBSizeIteratorStatus::Found, _ => CandidateBSizeIteratorStatus::Found,
} }
} }
@ -718,8 +721,11 @@ impl BlockFlow {
return return
} }
let (block_start_margin_value, block_end_margin_value) = match self.base.collapsible_margins { let (block_start_margin_value, block_end_margin_value) =
CollapsibleMargins::CollapseThrough(_) => panic!("Margins unexpectedly collapsed through root flow."), match self.base.collapsible_margins {
CollapsibleMargins::CollapseThrough(_) => {
panic!("Margins unexpectedly collapsed through root flow.")
}
CollapsibleMargins::Collapse(block_start_margin, block_end_margin) => { CollapsibleMargins::Collapse(block_start_margin, block_end_margin) => {
(block_start_margin.collapse(), block_end_margin.collapse()) (block_start_margin.collapse(), block_end_margin.collapse())
} }
@ -757,7 +763,8 @@ impl BlockFlow {
pub fn assign_block_size_block_base<'a>(&mut self, pub fn assign_block_size_block_base<'a>(&mut self,
layout_context: &'a LayoutContext<'a>, layout_context: &'a LayoutContext<'a>,
margins_may_collapse: MarginsMayCollapseFlag) { margins_may_collapse: MarginsMayCollapseFlag) {
let _scope = layout_debug_scope!("assign_block_size_block_base {:x}", self.base.debug_id()); let _scope = layout_debug_scope!("assign_block_size_block_base {:x}",
self.base.debug_id());
if self.base.restyle_damage.contains(REFLOW) { if self.base.restyle_damage.contains(REFLOW) {
// Our current border-box position. // Our current border-box position.
@ -1661,13 +1668,14 @@ impl Flow for BlockFlow {
} }
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
// FIXME (mbrubeck): Get the real container size, taking the container writing mode into // FIXME (mbrubeck): Get the real container size, taking the container writing mode into
// account. Must handle vertical writing modes. // account. Must handle vertical writing modes.
let container_size = Size2D(self.base.block_container_inline_size, Au(0)); let container_size = Size2D(self.base.block_container_inline_size, Au(0));
if self.is_root() { if self.is_root() {
self.base.clip = ClippingRegion::max() self.base.clip = ClippingRegion::max();
self.base.stacking_relative_position_of_display_port = MAX_RECT;
} }
if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) { if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) {
@ -1761,7 +1769,8 @@ impl Flow for BlockFlow {
let relative_offset = relative_offset.to_physical(self.base.writing_mode); let relative_offset = relative_offset.to_physical(self.base.writing_mode);
let origin_for_children; let origin_for_children;
let clip_in_child_coordinate_system; let clip_in_child_coordinate_system;
if self.fragment.establishes_stacking_context() { let is_stacking_context = self.fragment.establishes_stacking_context();
if is_stacking_context {
// We establish a stacking context, so the position of our children is vertically // We establish a stacking context, so the position of our children is vertically
// correct, but has to be adjusted to accommodate horizontal margins. (Note the // correct, but has to be adjusted to accommodate horizontal margins. (Note the
// calculation involving `position` below and recall that inline-direction flow // calculation involving `position` below and recall that inline-direction flow
@ -1771,11 +1780,31 @@ impl Flow for BlockFlow {
let margin = self.fragment.margin.to_physical(self.base.writing_mode); let margin = self.fragment.margin.to_physical(self.base.writing_mode);
origin_for_children = Point2D(-margin.left, Au(0)) + relative_offset; origin_for_children = Point2D(-margin.left, Au(0)) + relative_offset;
clip_in_child_coordinate_system = clip_in_child_coordinate_system =
self.base.clip.translate(&-self.base.stacking_relative_position) self.base.clip.translate(&-self.base.stacking_relative_position);
} else { } else {
origin_for_children = self.base.stacking_relative_position + relative_offset; origin_for_children = self.base.stacking_relative_position + relative_offset;
clip_in_child_coordinate_system = self.base.clip.clone() clip_in_child_coordinate_system = self.base.clip.clone();
} }
let stacking_relative_position_of_display_port_for_children =
if (is_stacking_context && self.will_get_layer()) || self.is_root() {
let visible_rect =
match layout_context.shared.visible_rects.get(&self.layer_id(0)) {
Some(visible_rect) => *visible_rect,
None => Rect(Point2D::zero(), layout_context.shared.screen_size),
};
let screen_size = layout_context.shared.screen_size;
visible_rect.inflate(screen_size.width * DISPLAY_PORT_SIZE_FACTOR,
screen_size.height * DISPLAY_PORT_SIZE_FACTOR)
} else if is_stacking_context {
self.base
.stacking_relative_position_of_display_port
.translate(&-self.base.stacking_relative_position)
} else {
self.base.stacking_relative_position_of_display_port
};
let stacking_relative_border_box = let stacking_relative_border_box =
self.fragment self.fragment
.stacking_relative_border_box(&self.base.stacking_relative_position, .stacking_relative_border_box(&self.base.stacking_relative_position,
@ -1820,7 +1849,9 @@ impl Flow for BlockFlow {
} }
flow::mut_base(kid).absolute_position_info = absolute_position_info_for_children; flow::mut_base(kid).absolute_position_info = absolute_position_info_for_children;
flow::mut_base(kid).clip = clip.clone() flow::mut_base(kid).clip = clip.clone();
flow::mut_base(kid).stacking_relative_position_of_display_port =
stacking_relative_position_of_display_port_for_children;
} }
} }

View file

@ -49,17 +49,17 @@ use script::dom::element::ElementTypeId;
use script::dom::htmlelement::HTMLElementTypeId; use script::dom::htmlelement::HTMLElementTypeId;
use script::dom::htmlobjectelement::is_image_data; use script::dom::htmlobjectelement::is_image_data;
use script::dom::node::NodeTypeId; use script::dom::node::NodeTypeId;
use util::opts;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::collections::LinkedList; use std::collections::LinkedList;
use std::mem; use std::mem;
use std::sync::Arc;
use std::sync::atomic::Ordering; use std::sync::atomic::Ordering;
use style::computed_values::content::ContentItem; use style::computed_values::content::ContentItem;
use style::computed_values::{caption_side, display, empty_cells, float, list_style_position}; use style::computed_values::{caption_side, display, empty_cells, float, list_style_position};
use style::computed_values::{position}; use style::computed_values::{position};
use style::properties::{self, ComputedValues}; use style::properties::{self, ComputedValues};
use std::sync::Arc;
use url::Url; use url::Url;
use util::opts;
/// The results of flow construction for a DOM node. /// The results of flow construction for a DOM node.
#[derive(Clone)] #[derive(Clone)]
@ -1250,22 +1250,28 @@ impl<'a> FlowConstructor<'a> {
return false return false
} }
match node.swap_out_construction_result() { let mut layout_data_ref = node.mutate_layout_data();
ConstructionResult::None => true, let layout_data = layout_data_ref.as_mut().expect("no layout data");
ConstructionResult::Flow(mut flow, _) => { let style = (*node.get_style(&layout_data)).clone();
let damage = layout_data.data.restyle_damage;
match node.get_construction_result(layout_data) {
&mut ConstructionResult::None => true,
&mut ConstructionResult::Flow(ref mut flow, _) => {
// The node's flow is of the same type and has the same set of children and can // The node's flow is of the same type and has the same set of children and can
// therefore be repaired by simply propagating damage and style to the flow. // therefore be repaired by simply propagating damage and style to the flow.
flow::mut_base(&mut *flow).restyle_damage.insert(node.restyle_damage()); if !flow.is_block_flow() {
flow.repair_style_and_bubble_inline_sizes(node.style()); return false
}
flow::mut_base(&mut **flow).restyle_damage.insert(damage);
flow.repair_style_and_bubble_inline_sizes(&style);
true true
} }
ConstructionResult::ConstructionItem(ConstructionItem::InlineFragments( &mut ConstructionResult::ConstructionItem(ConstructionItem::InlineFragments(
mut inline_fragments_construction_result)) => { ref mut inline_fragments_construction_result)) => {
if !inline_fragments_construction_result.splits.is_empty() { if !inline_fragments_construction_result.splits.is_empty() {
return false return false
} }
let damage = node.restyle_damage();
for fragment in inline_fragments_construction_result.fragments for fragment in inline_fragments_construction_result.fragments
.fragments .fragments
.iter_mut() { .iter_mut() {
@ -1274,17 +1280,34 @@ impl<'a> FlowConstructor<'a> {
flow::mut_base(&mut *inline_block_fragment.flow_ref).restyle_damage flow::mut_base(&mut *inline_block_fragment.flow_ref).restyle_damage
.insert(damage); .insert(damage);
// FIXME(pcwalton): Fragment restyle damage too? // FIXME(pcwalton): Fragment restyle damage too?
inline_block_fragment.flow_ref.repair_style_and_bubble_inline_sizes( inline_block_fragment.flow_ref
node.style()); .repair_style_and_bubble_inline_sizes(&style);
}
SpecificFragmentInfo::InlineAbsoluteHypothetical(
ref mut inline_absolute_hypothetical_fragment) => {
flow::mut_base(&mut *inline_absolute_hypothetical_fragment.flow_ref)
.restyle_damage.insert(damage);
// FIXME(pcwalton): Fragment restyle damage too?
inline_absolute_hypothetical_fragment
.flow_ref
.repair_style_and_bubble_inline_sizes(&style);
}
SpecificFragmentInfo::InlineAbsolute(ref mut inline_absolute_fragment) => {
flow::mut_base(&mut *inline_absolute_fragment.flow_ref).restyle_damage
.insert(damage);
// FIXME(pcwalton): Fragment restyle damage too?
inline_absolute_fragment.flow_ref
.repair_style_and_bubble_inline_sizes(&style);
} }
_ => { _ => {
return false fragment.repair_style(&style);
return true
} }
} }
} }
true true
} }
ConstructionResult::ConstructionItem(_) => { &mut ConstructionResult::ConstructionItem(_) => {
false false
} }
} }
@ -1450,7 +1473,8 @@ trait NodeUtils {
/// Returns true if this node doesn't render its kids and false otherwise. /// Returns true if this node doesn't render its kids and false otherwise.
fn is_replaced_content(&self) -> bool; fn is_replaced_content(&self) -> bool;
fn get_construction_result<'a>(self, layout_data: &'a mut LayoutDataWrapper) -> &'a mut ConstructionResult; fn get_construction_result<'a>(self, layout_data: &'a mut LayoutDataWrapper)
-> &'a mut ConstructionResult;
/// Sets the construction result of a flow. /// Sets the construction result of a flow.
fn set_flow_construction_result(self, result: ConstructionResult); fn set_flow_construction_result(self, result: ConstructionResult);

View file

@ -8,21 +8,27 @@
use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use css::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
use canvas_traits::CanvasMsg;
use msg::compositor_msg::LayerId;
use geom::{Rect, Size2D}; use geom::{Rect, Size2D};
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
use gfx::font_cache_task::FontCacheTask; use gfx::font_cache_task::FontCacheTask;
use gfx::font_context::FontContext; use gfx::font_context::FontContext;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageState}; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState};
use net_traits::image_cache_task::{UsePlaceholder};
use script::layout_interface::{Animation, LayoutChan, ReflowGoal}; use script::layout_interface::{Animation, LayoutChan, ReflowGoal};
use std::boxed; use std::boxed;
use std::cell::Cell; use std::cell::Cell;
use std::collections::HashMap;
use std::collections::hash_state::DefaultState;
use std::ptr; use std::ptr;
use std::sync::Arc; use std::sync::{Arc, Mutex};
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::{channel, Sender};
use style::selector_matching::Stylist; use style::selector_matching::Stylist;
use url::Url; use url::Url;
use util::fnv::FnvHasher;
use util::geometry::Au; use util::geometry::Au;
use util::opts; use util::opts;
@ -99,6 +105,12 @@ pub struct SharedLayoutContext {
/// sent. /// sent.
pub new_animations_sender: Sender<Animation>, pub new_animations_sender: Sender<Animation>,
/// A channel to send canvas renderers to paint task, in order to correctly paint the layers
pub canvas_layers_sender: Sender<(LayerId, Option<Arc<Mutex<Sender<CanvasMsg>>>>)>,
/// The visible rects for each layer, as reported to us by the compositor.
pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,
/// Why is this reflow occurring /// Why is this reflow occurring
pub goal: ReflowGoal, pub goal: ReflowGoal,
} }
@ -147,9 +159,11 @@ impl<'a> LayoutContext<'a> {
} }
} }
pub fn get_or_request_image(&self, url: Url) -> Option<Arc<Image>> { pub fn get_or_request_image(&self, url: Url, use_placeholder: UsePlaceholder)
-> Option<Arc<Image>> {
// See if the image is already available // See if the image is already available
let result = self.shared.image_cache_task.get_image_if_available(url.clone()); let result = self.shared.image_cache_task.get_image_if_available(url.clone(),
use_placeholder);
match result { match result {
Ok(image) => Some(image), Ok(image) => Some(image),
@ -167,7 +181,11 @@ impl<'a> LayoutContext<'a> {
self.shared.image_cache_task.request_image(url, self.shared.image_cache_task.request_image(url,
ImageCacheChan(sync_tx), ImageCacheChan(sync_tx),
None); None);
sync_rx.recv().unwrap().image match sync_rx.recv().unwrap().image_response {
ImageResponse::Loaded(image) |
ImageResponse::PlaceholderLoaded(image) => Some(image),
ImageResponse::None => None,
}
} }
// Not yet requested, async mode - request image from the cache // Not yet requested, async mode - request image from the cache
(ImageState::NotRequested, false) => { (ImageState::NotRequested, false) => {

View file

@ -4,6 +4,7 @@
//! Style retrieval from DOM elements. //! Style retrieval from DOM elements.
use data::LayoutDataWrapper;
use wrapper::{PseudoElementType, ThreadSafeLayoutNode}; use wrapper::{PseudoElementType, ThreadSafeLayoutNode};
use std::mem; use std::mem;
@ -12,6 +13,7 @@ use std::sync::Arc;
/// Node mixin providing `style` method that returns a `NodeStyle` /// Node mixin providing `style` method that returns a `NodeStyle`
pub trait StyledNode { pub trait StyledNode {
fn get_style<'a>(&'a self, layout_data_ref: &'a LayoutDataWrapper) -> &'a Arc<ComputedValues>;
/// Returns the style results for the given node. If CSS selector matching has not yet been /// Returns the style results for the given node. If CSS selector matching has not yet been
/// performed, fails. /// performed, fails.
fn style<'a>(&'a self) -> &'a Arc<ComputedValues>; fn style<'a>(&'a self) -> &'a Arc<ComputedValues>;
@ -22,37 +24,23 @@ pub trait StyledNode {
} }
impl<'ln> StyledNode for ThreadSafeLayoutNode<'ln> { impl<'ln> StyledNode for ThreadSafeLayoutNode<'ln> {
#[inline]
fn get_style<'a>(&self, layout_data_ref: &'a LayoutDataWrapper) -> &'a Arc<ComputedValues> {
match self.get_pseudo_element_type() {
PseudoElementType::Before(_) => layout_data_ref.data.before_style.as_ref().unwrap(),
PseudoElementType::After(_) => layout_data_ref.data.after_style.as_ref().unwrap(),
PseudoElementType::Normal => layout_data_ref.shared_data.style.as_ref().unwrap(),
}
}
#[inline] #[inline]
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn style<'a>(&'a self) -> &'a Arc<ComputedValues> { fn style<'a>(&'a self) -> &'a Arc<ComputedValues> {
unsafe { unsafe {
let layout_data_ref = self.borrow_layout_data(); let layout_data_ref = self.borrow_layout_data();
match self.get_pseudo_element_type() { let layout_data = layout_data_ref.as_ref().expect("no layout data");
PseudoElementType::Before(_) => { mem::transmute::<&Arc<ComputedValues>,
mem::transmute(layout_data_ref.as_ref() &'a Arc<ComputedValues>>(self.get_style(&layout_data))
.unwrap()
.data
.before_style
.as_ref()
.unwrap())
}
PseudoElementType::After(_) => {
mem::transmute(layout_data_ref.as_ref()
.unwrap()
.data
.after_style
.as_ref()
.unwrap())
}
PseudoElementType::Normal => {
mem::transmute(layout_data_ref.as_ref()
.unwrap()
.shared_data
.style
.as_ref()
.unwrap())
}
}
} }
} }

View file

@ -12,7 +12,6 @@
use azure::azure_hl::Color; use azure::azure_hl::Color;
use block::BlockFlow; use block::BlockFlow;
use canvas::canvas_msg::{CanvasMsg, CanvasCommonMsg};
use context::LayoutContext; use context::LayoutContext;
use flow::{self, BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED, NEEDS_LAYER}; use flow::{self, BaseFlow, Flow, IS_ABSOLUTELY_POSITIONED, NEEDS_LAYER};
use fragment::{CoordinateSystem, Fragment, IframeFragmentInfo, ImageFragmentInfo}; use fragment::{CoordinateSystem, Fragment, IframeFragmentInfo, ImageFragmentInfo};
@ -23,7 +22,7 @@ use model::{self, MaybeAuto, ToGfxMatrix};
use table_cell::CollapsedBordersForCell; use table_cell::CollapsedBordersForCell;
use geom::{Matrix2D, Point2D, Rect, Size2D, SideOffsets2D}; use geom::{Matrix2D, Point2D, Rect, Size2D, SideOffsets2D};
use gfx::color; use gfx_traits::color;
use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem}; use gfx::display_list::{BLUR_INFLATION_FACTOR, BaseDisplayItem, BorderDisplayItem};
use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion}; use gfx::display_list::{BorderRadii, BoxShadowClipMode, BoxShadowDisplayItem, ClippingRegion};
use gfx::display_list::{DisplayItem, DisplayList, DisplayItemMetadata}; use gfx::display_list::{DisplayItem, DisplayList, DisplayItemMetadata};
@ -32,15 +31,15 @@ use gfx::display_list::{GradientStop, ImageDisplayItem, LineDisplayItem};
use gfx::display_list::{OpaqueNode, SolidColorDisplayItem}; use gfx::display_list::{OpaqueNode, SolidColorDisplayItem};
use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation}; use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation};
use gfx::paint_task::{PaintLayer, THREAD_TINT_COLORS}; use gfx::paint_task::{PaintLayer, THREAD_TINT_COLORS};
use msg::compositor_msg::ScrollPolicy; use msg::compositor_msg::{ScrollPolicy, LayerId};
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
use net_traits::image_cache_task::UsePlaceholder;
use png::{self, PixelsByColorType}; use png::{self, PixelsByColorType};
use std::cmp; use std::cmp;
use std::default::Default; use std::default::Default;
use std::iter::repeat; use std::iter::repeat;
use std::sync::Arc; use std::sync::Arc;
use std::sync::mpsc::channel;
use style::computed_values::filter::Filter; use style::computed_values::filter::Filter;
use style::computed_values::transform::ComputedMatrix; use style::computed_values::transform::ComputedMatrix;
use style::computed_values::{background_attachment, background_clip, background_origin, background_repeat, background_size}; use style::computed_values::{background_attachment, background_clip, background_origin, background_repeat, background_size};
@ -56,6 +55,15 @@ use util::geometry::{Au, ZERO_POINT};
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
use util::opts; use util::opts;
use canvas_traits::{CanvasMsg, CanvasCommonMsg};
use std::sync::mpsc::channel;
/// A possible `PaintLayer` for an stacking context
pub enum StackingContextLayer {
Existing(PaintLayer),
IfCanvas(LayerId),
}
/// The results of display list building for a single flow. /// The results of display list building for a single flow.
pub enum DisplayListBuildingResult { pub enum DisplayListBuildingResult {
None, None,
@ -176,6 +184,8 @@ pub trait FragmentDisplayListBuilding {
/// * `relative_containing_block_size`: The size of the containing block that /// * `relative_containing_block_size`: The size of the containing block that
/// `position: relative` makes use of. /// `position: relative` makes use of.
/// * `clip`: The region to clip the display items to. /// * `clip`: The region to clip the display items to.
/// * `stacking_relative_display_port`: The position and size of the display port with respect
/// to the nearest ancestor stacking context.
fn build_display_list(&mut self, fn build_display_list(&mut self,
display_list: &mut DisplayList, display_list: &mut DisplayList,
layout_context: &LayoutContext, layout_context: &LayoutContext,
@ -184,7 +194,8 @@ pub trait FragmentDisplayListBuilding {
relative_containing_block_mode: WritingMode, relative_containing_block_mode: WritingMode,
border_painting_mode: BorderPaintingMode, border_painting_mode: BorderPaintingMode,
background_and_border_level: BackgroundAndBorderLevel, background_and_border_level: BackgroundAndBorderLevel,
clip: &ClippingRegion); clip: &ClippingRegion,
stacking_relative_display_port: &Rect<Au>);
/// Sends the size and position of this iframe fragment to the constellation. This is out of /// Sends the size and position of this iframe fragment to the constellation. This is out of
/// line to guide inlining. /// line to guide inlining.
@ -237,7 +248,8 @@ pub trait FragmentDisplayListBuilding {
fn create_stacking_context(&self, fn create_stacking_context(&self,
base_flow: &BaseFlow, base_flow: &BaseFlow,
display_list: Box<DisplayList>, display_list: Box<DisplayList>,
layer: Option<Arc<PaintLayer>>) layout_context: &LayoutContext,
layer: StackingContextLayer)
-> Arc<StackingContext>; -> Arc<StackingContext>;
} }
@ -429,7 +441,7 @@ impl FragmentDisplayListBuilding for Fragment {
clip: &ClippingRegion, clip: &ClippingRegion,
image_url: &Url) { image_url: &Url) {
let background = style.get_background(); let background = style.get_background();
let image = layout_context.get_or_request_image(image_url.clone()); let image = layout_context.get_or_request_image(image_url.clone(), UsePlaceholder::No);
if let Some(image) = image { if let Some(image) = image {
debug!("(building display list) building background image"); debug!("(building display list) building background image");
@ -866,7 +878,8 @@ impl FragmentDisplayListBuilding for Fragment {
relative_containing_block_mode: WritingMode, relative_containing_block_mode: WritingMode,
border_painting_mode: BorderPaintingMode, border_painting_mode: BorderPaintingMode,
background_and_border_level: BackgroundAndBorderLevel, background_and_border_level: BackgroundAndBorderLevel,
clip: &ClippingRegion) { clip: &ClippingRegion,
stacking_relative_display_port: &Rect<Au>) {
if self.style().get_inheritedbox().visibility != visibility::T::visible { if self.style().get_inheritedbox().visibility != visibility::T::visible {
return return
} }
@ -888,6 +901,11 @@ impl FragmentDisplayListBuilding for Fragment {
stacking_relative_flow_origin, stacking_relative_flow_origin,
self); self);
if !stacking_relative_border_box.intersects(stacking_relative_display_port) {
debug!("Fragment::build_display_list: outside display port");
return
}
if !stacking_relative_border_box.intersects(&layout_context.shared.dirty) { if !stacking_relative_border_box.intersects(&layout_context.shared.dirty) {
debug!("Fragment::build_display_list: Did not intersect..."); debug!("Fragment::build_display_list: Did not intersect...");
return return
@ -1068,21 +1086,21 @@ impl FragmentDisplayListBuilding for Fragment {
} }
} }
SpecificFragmentInfo::Canvas(ref canvas_fragment_info) => { SpecificFragmentInfo::Canvas(ref canvas_fragment_info) => {
// TODO(ecoal95): make the canvas with a renderer use the custom layer
let width = canvas_fragment_info.replaced_image_fragment_info let width = canvas_fragment_info.replaced_image_fragment_info
.computed_inline_size.map_or(0, |w| w.to_px() as usize); .computed_inline_size.map_or(0, |w| w.to_px() as usize);
let height = canvas_fragment_info.replaced_image_fragment_info let height = canvas_fragment_info.replaced_image_fragment_info
.computed_block_size.map_or(0, |h| h.to_px() as usize); .computed_block_size.map_or(0, |h| h.to_px() as usize);
let (sender, receiver) = channel::<Vec<u8>>(); let (sender, receiver) = channel::<Vec<u8>>();
let canvas_data = match canvas_fragment_info.renderer { let canvas_data = match canvas_fragment_info.renderer {
Some(ref renderer) => { Some(ref renderer) => {
renderer.lock().unwrap().send(CanvasMsg::Common(CanvasCommonMsg::SendPixelContents(sender))).unwrap(); renderer.lock().unwrap().send(CanvasMsg::Common(
CanvasCommonMsg::SendPixelContents(sender))).unwrap();
receiver.recv().unwrap() receiver.recv().unwrap()
}, },
None => repeat(0xFFu8).take(width * height * 4).collect(), None => repeat(0xFFu8).take(width * height * 4).collect(),
}; };
display_list.content.push_back(DisplayItem::ImageClass(box ImageDisplayItem{
let canvas_display_item = box ImageDisplayItem {
base: BaseDisplayItem::new(stacking_relative_content_box, base: BaseDisplayItem::new(stacking_relative_content_box,
DisplayItemMetadata::new(self.node, DisplayItemMetadata::new(self.node,
&*self.style, &*self.style,
@ -1095,9 +1113,7 @@ impl FragmentDisplayListBuilding for Fragment {
}), }),
stretch_size: stacking_relative_content_box.size, stretch_size: stacking_relative_content_box.size,
image_rendering: image_rendering::T::Auto, image_rendering: image_rendering::T::Auto,
}; }));
display_list.content.push_back(DisplayItem::ImageClass(canvas_display_item));
} }
SpecificFragmentInfo::UnscannedText(_) => { SpecificFragmentInfo::UnscannedText(_) => {
panic!("Shouldn't see unscanned fragments here.") panic!("Shouldn't see unscanned fragments here.")
@ -1111,7 +1127,8 @@ impl FragmentDisplayListBuilding for Fragment {
fn create_stacking_context(&self, fn create_stacking_context(&self,
base_flow: &BaseFlow, base_flow: &BaseFlow,
display_list: Box<DisplayList>, display_list: Box<DisplayList>,
layer: Option<Arc<PaintLayer>>) layout_context: &LayoutContext,
layer: StackingContextLayer)
-> Arc<StackingContext> { -> Arc<StackingContext> {
let border_box = self.stacking_relative_border_box(&base_flow.stacking_relative_position, let border_box = self.stacking_relative_border_box(&base_flow.stacking_relative_position,
&base_flow.absolute_position_info &base_flow.absolute_position_info
@ -1143,6 +1160,28 @@ impl FragmentDisplayListBuilding for Fragment {
filters.push(Filter::Opacity(effects.opacity)) filters.push(Filter::Opacity(effects.opacity))
} }
// Ensure every canvas has a layer
let layer = match layer {
StackingContextLayer::Existing(existing_layer) => Some(existing_layer),
StackingContextLayer::IfCanvas(layer_id) => {
if let SpecificFragmentInfo::Canvas(_) = self.specific {
Some(PaintLayer::new(layer_id, color::transparent(), ScrollPolicy::Scrollable))
} else {
None
}
}
};
// If it's a canvas we must propagate the layer and the renderer to the paint
// task
if let SpecificFragmentInfo::Canvas(ref fragment_info) = self.specific {
let layer_id = layer.as_ref().unwrap().id;
layout_context.shared.canvas_layers_sender
.send((layer_id, fragment_info.renderer.clone())).unwrap();
}
let layer = layer.map(|l| Arc::new(l));
Arc::new(StackingContext::new(display_list, Arc::new(StackingContext::new(display_list,
&border_box, &border_box,
&overflow, &overflow,
@ -1364,6 +1403,7 @@ pub trait BlockFlowDisplayListBuilding {
display_list: Box<DisplayList>, display_list: Box<DisplayList>,
layout_context: &LayoutContext, layout_context: &LayoutContext,
border_painting_mode: BorderPaintingMode); border_painting_mode: BorderPaintingMode);
fn will_get_layer(&self) -> bool;
} }
impl BlockFlowDisplayListBuilding for BlockFlow { impl BlockFlowDisplayListBuilding for BlockFlow {
@ -1386,7 +1426,8 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
self.base.absolute_position_info.relative_containing_block_mode, self.base.absolute_position_info.relative_containing_block_mode,
border_painting_mode, border_painting_mode,
background_border_level, background_border_level,
&clip); &clip,
&self.base.stacking_relative_position_of_display_port);
// Add children. // Add children.
for kid in self.base.children.iter_mut() { for kid in self.base.children.iter_mut() {
@ -1407,10 +1448,11 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
background_border_level); background_border_level);
self.base.display_list_building_result = if self.fragment.establishes_stacking_context() { self.base.display_list_building_result = if self.fragment.establishes_stacking_context() {
DisplayListBuildingResult::StackingContext(self.fragment.create_stacking_context( DisplayListBuildingResult::StackingContext(
&self.base, self.fragment.create_stacking_context(&self.base,
display_list, display_list,
None)) layout_context,
StackingContextLayer::IfCanvas(self.layer_id(0))))
} else { } else {
match self.fragment.style.get_box().position { match self.fragment.style.get_box().position {
position::T::static_ => {} position::T::static_ => {}
@ -1422,6 +1464,11 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
} }
} }
fn will_get_layer(&self) -> bool {
self.base.absolute_position_info.layers_needed_for_positioned_flows ||
self.base.flags.contains(NEEDS_LAYER)
}
fn build_display_list_for_absolutely_positioned_block( fn build_display_list_for_absolutely_positioned_block(
&mut self, &mut self,
mut display_list: Box<DisplayList>, mut display_list: Box<DisplayList>,
@ -1432,14 +1479,14 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
border_painting_mode, border_painting_mode,
BackgroundAndBorderLevel::RootOfStackingContext); BackgroundAndBorderLevel::RootOfStackingContext);
if !self.base.absolute_position_info.layers_needed_for_positioned_flows && if !self.will_get_layer() {
!self.base.flags.contains(NEEDS_LAYER) {
// We didn't need a layer. // We didn't need a layer.
self.base.display_list_building_result = self.base.display_list_building_result =
DisplayListBuildingResult::StackingContext(self.fragment.create_stacking_context( DisplayListBuildingResult::StackingContext(
&self.base, self.fragment.create_stacking_context(&self.base,
display_list, display_list,
None)); layout_context,
StackingContextLayer::IfCanvas(self.layer_id(0))));
return return
} }
@ -1450,11 +1497,11 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
ScrollPolicy::Scrollable ScrollPolicy::Scrollable
}; };
let transparent = color::transparent(); let paint_layer = PaintLayer::new(self.layer_id(0), color::transparent(), scroll_policy);
let stacking_context = self.fragment.create_stacking_context( let stacking_context = self.fragment.create_stacking_context(&self.base,
&self.base,
display_list, display_list,
Some(Arc::new(PaintLayer::new(self.layer_id(0), transparent, scroll_policy)))); layout_context,
StackingContextLayer::Existing(paint_layer));
self.base.display_list_building_result = self.base.display_list_building_result =
DisplayListBuildingResult::StackingContext(stacking_context) DisplayListBuildingResult::StackingContext(stacking_context)
} }
@ -1471,7 +1518,10 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
self.base.display_list_building_result = if self.fragment.establishes_stacking_context() { self.base.display_list_building_result = if self.fragment.establishes_stacking_context() {
DisplayListBuildingResult::StackingContext( DisplayListBuildingResult::StackingContext(
self.fragment.create_stacking_context(&self.base, display_list, None)) self.fragment.create_stacking_context(&self.base,
display_list,
layout_context,
StackingContextLayer::IfCanvas(self.layer_id(0))))
} else { } else {
DisplayListBuildingResult::Normal(display_list) DisplayListBuildingResult::Normal(display_list)
} }
@ -1524,9 +1574,11 @@ impl InlineFlowDisplayListBuilding for InlineFlow {
.relative_containing_block_mode, .relative_containing_block_mode,
BorderPaintingMode::Separate, BorderPaintingMode::Separate,
BackgroundAndBorderLevel::Content, BackgroundAndBorderLevel::Content,
&self.base.clip); &self.base.clip,
&self.base.stacking_relative_position_of_display_port);
has_stacking_context = fragment.establishes_stacking_context(); has_stacking_context = fragment.establishes_stacking_context();
match fragment.specific { match fragment.specific {
SpecificFragmentInfo::InlineBlock(ref mut block_flow) => { SpecificFragmentInfo::InlineBlock(ref mut block_flow) => {
let block_flow = &mut *block_flow.flow_ref; let block_flow = &mut *block_flow.flow_ref;
@ -1554,17 +1606,23 @@ impl InlineFlowDisplayListBuilding for InlineFlow {
// FIXME(Savago): fix Fragment::establishes_stacking_context() for absolute positioned item // FIXME(Savago): fix Fragment::establishes_stacking_context() for absolute positioned item
// and remove the check for filter presence. Further details on #5812. // and remove the check for filter presence. Further details on #5812.
if has_stacking_context && has_stacking_context = has_stacking_context && {
!self.fragments.fragments[0].style().get_effects().filter.is_empty() { if let SpecificFragmentInfo::Canvas(_) = self.fragments.fragments[0].specific {
self.base.display_list_building_result = true
} else {
!self.fragments.fragments[0].style().get_effects().filter.is_empty()
}
};
self.base.display_list_building_result = if has_stacking_context {
DisplayListBuildingResult::StackingContext( DisplayListBuildingResult::StackingContext(
self.fragments.fragments[0].create_stacking_context(&self.base, self.fragments.fragments[0].create_stacking_context(&self.base,
display_list, display_list,
None)); layout_context,
StackingContextLayer::IfCanvas(self.layer_id(0))))
} else { } else {
self.base.display_list_building_result = DisplayListBuildingResult::Normal(display_list)
DisplayListBuildingResult::Normal(display_list); };
}
if opts::get().validate_display_list_geometry { if opts::get().validate_display_list_geometry {
self.base.validate_display_list_geometry(); self.base.validate_display_list_geometry();
@ -1597,7 +1655,10 @@ impl ListItemFlowDisplayListBuilding for ListItemFlow {
.relative_containing_block_mode, .relative_containing_block_mode,
BorderPaintingMode::Separate, BorderPaintingMode::Separate,
BackgroundAndBorderLevel::Content, BackgroundAndBorderLevel::Content,
&self.block_flow.base.clip); &self.block_flow.base.clip,
&self.block_flow
.base
.stacking_relative_position_of_display_port);
} }
// Draw the rest of the block. // Draw the rest of the block.

View file

@ -271,7 +271,7 @@ pub trait Flow: fmt::Debug + Sync {
} }
/// Phase 4 of reflow: computes absolute positions. /// Phase 4 of reflow: computes absolute positions.
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, _: &LayoutContext) {
// The default implementation is a no-op. // The default implementation is a no-op.
} }
@ -859,6 +859,12 @@ pub struct BaseFlow {
/// The clipping region for this flow and its descendants, in layer coordinates. /// The clipping region for this flow and its descendants, in layer coordinates.
pub clip: ClippingRegion, pub clip: ClippingRegion,
/// The stacking-relative position of the display port.
///
/// FIXME(pcwalton): This might be faster as an Arc, since this varies only
/// per-stacking-context.
pub stacking_relative_position_of_display_port: Rect<Au>,
/// The results of display list building for this flow. /// The results of display list building for this flow.
pub display_list_building_result: DisplayListBuildingResult, pub display_list_building_result: DisplayListBuildingResult,
@ -909,10 +915,18 @@ impl Encodable for BaseFlow {
FlowClass::Block => c.as_immutable_block().encode(e), FlowClass::Block => c.as_immutable_block().encode(e),
FlowClass::Inline => c.as_immutable_inline().encode(e), FlowClass::Inline => c.as_immutable_inline().encode(e),
FlowClass::Table => c.as_immutable_table().encode(e), FlowClass::Table => c.as_immutable_table().encode(e),
FlowClass::TableWrapper => c.as_immutable_table_wrapper().encode(e), FlowClass::TableWrapper => {
FlowClass::TableRowGroup => c.as_immutable_table_rowgroup().encode(e), c.as_immutable_table_wrapper().encode(e)
FlowClass::TableRow => c.as_immutable_table_row().encode(e), }
FlowClass::TableCell => c.as_immutable_table_cell().encode(e), FlowClass::TableRowGroup => {
c.as_immutable_table_rowgroup().encode(e)
}
FlowClass::TableRow => {
c.as_immutable_table_row().encode(e)
}
FlowClass::TableCell => {
c.as_immutable_table_cell().encode(e)
}
_ => { Ok(()) } // TODO: Support captions _ => { Ok(()) } // TODO: Support captions
} }
}) })
@ -1024,6 +1038,7 @@ impl BaseFlow {
display_list_building_result: DisplayListBuildingResult::None, display_list_building_result: DisplayListBuildingResult::None,
absolute_position_info: AbsolutePositionInfo::new(writing_mode), absolute_position_info: AbsolutePositionInfo::new(writing_mode),
clip: ClippingRegion::max(), clip: ClippingRegion::max(),
stacking_relative_position_of_display_port: Rect::zero(),
flags: flags, flags: flags,
writing_mode: writing_mode, writing_mode: writing_mode,
thread_id: 0, thread_id: 0,

View file

@ -6,7 +6,7 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
use canvas::canvas_msg::CanvasMsg; use canvas_traits::CanvasMsg;
use css::node_style::StyledNode; use css::node_style::StyledNode;
use context::LayoutContext; use context::LayoutContext;
use floats::ClearType; use floats::ClearType;
@ -27,6 +27,7 @@ use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice}; use gfx::text::text_run::{TextRun, TextRunSlice};
use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId}; use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId};
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_task::UsePlaceholder;
use rustc_serialize::{Encodable, Encoder}; use rustc_serialize::{Encodable, Encoder};
use script_traits::UntrustedNodeAddress; use script_traits::UntrustedNodeAddress;
use std::borrow::ToOwned; use std::borrow::ToOwned;
@ -195,9 +196,7 @@ impl SpecificFragmentInfo {
SpecificFragmentInfo::Iframe(_) => "SpecificFragmentInfo::Iframe", SpecificFragmentInfo::Iframe(_) => "SpecificFragmentInfo::Iframe",
SpecificFragmentInfo::Image(_) => "SpecificFragmentInfo::Image", SpecificFragmentInfo::Image(_) => "SpecificFragmentInfo::Image",
SpecificFragmentInfo::InlineAbsolute(_) => "SpecificFragmentInfo::InlineAbsolute", SpecificFragmentInfo::InlineAbsolute(_) => "SpecificFragmentInfo::InlineAbsolute",
SpecificFragmentInfo::InlineAbsoluteHypothetical(_) => { SpecificFragmentInfo::InlineAbsoluteHypothetical(_) => "SpecificFragmentInfo::InlineAbsoluteHypothetical",
"SpecificFragmentInfo::InlineAbsoluteHypothetical"
}
SpecificFragmentInfo::InlineBlock(_) => "SpecificFragmentInfo::InlineBlock", SpecificFragmentInfo::InlineBlock(_) => "SpecificFragmentInfo::InlineBlock",
SpecificFragmentInfo::ScannedText(_) => "SpecificFragmentInfo::ScannedText", SpecificFragmentInfo::ScannedText(_) => "SpecificFragmentInfo::ScannedText",
SpecificFragmentInfo::Table => "SpecificFragmentInfo::Table", SpecificFragmentInfo::Table => "SpecificFragmentInfo::Table",
@ -337,7 +336,9 @@ impl ImageFragmentInfo {
.map(Au::from_px) .map(Au::from_px)
} }
let image = url.and_then(|url| layout_context.get_or_request_image(url)); let image = url.and_then(|url| {
layout_context.get_or_request_image(url, UsePlaceholder::Yes)
});
ImageFragmentInfo { ImageFragmentInfo {
replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node, replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node,
@ -566,7 +567,8 @@ impl IframeFragmentInfo {
} }
#[inline] #[inline]
pub fn calculate_replaced_inline_size(style: &ComputedValues, containing_size: Au) -> Au { pub fn calculate_replaced_inline_size(&self, style: &ComputedValues, containing_size: Au)
-> Au {
// Calculate the replaced inline size (or default) as per CSS 2.1 § 10.3.2 // Calculate the replaced inline size (or default) as per CSS 2.1 § 10.3.2
IframeFragmentInfo::calculate_replaced_size(style.content_inline_size(), IframeFragmentInfo::calculate_replaced_size(style.content_inline_size(),
style.min_inline_size(), style.min_inline_size(),
@ -576,7 +578,8 @@ impl IframeFragmentInfo {
} }
#[inline] #[inline]
pub fn calculate_replaced_block_size(style: &ComputedValues, containing_size: Au) -> Au { pub fn calculate_replaced_block_size(&self, style: &ComputedValues, containing_size: Au)
-> Au {
// Calculate the replaced block size (or default) as per CSS 2.1 § 10.3.2 // Calculate the replaced block size (or default) as per CSS 2.1 § 10.3.2
IframeFragmentInfo::calculate_replaced_size(style.content_block_size(), IframeFragmentInfo::calculate_replaced_size(style.content_block_size(),
style.min_block_size(), style.min_block_size(),
@ -589,7 +592,8 @@ impl IframeFragmentInfo {
fn calculate_replaced_size(content_size: LengthOrPercentageOrAuto, fn calculate_replaced_size(content_size: LengthOrPercentageOrAuto,
style_min_size: LengthOrPercentage, style_min_size: LengthOrPercentage,
style_max_size: LengthOrPercentageOrNone, style_max_size: LengthOrPercentageOrNone,
containing_size: Au, default_size: Au) -> Au { containing_size: Au,
default_size: Au) -> Au {
let computed_size = match MaybeAuto::from_style(content_size, containing_size) { let computed_size = match MaybeAuto::from_style(content_size, containing_size) {
MaybeAuto::Specified(length) => length, MaybeAuto::Specified(length) => length,
MaybeAuto::Auto => default_size, MaybeAuto::Auto => default_size,
@ -1702,9 +1706,10 @@ impl Fragment {
fragment_inline_size, fragment_inline_size,
fragment_block_size); fragment_block_size);
} }
SpecificFragmentInfo::Iframe(_) => { SpecificFragmentInfo::Iframe(ref iframe_fragment_info) => {
self.border_box.size.inline = IframeFragmentInfo::calculate_replaced_inline_size( self.border_box.size.inline =
style, container_inline_size) + iframe_fragment_info.calculate_replaced_inline_size(style,
container_inline_size) +
noncontent_inline_size; noncontent_inline_size;
} }
_ => panic!("this case should have been handled above"), _ => panic!("this case should have been handled above"),
@ -1786,9 +1791,9 @@ impl Fragment {
self.border_box.size.block = block_flow.base.position.size.block + self.border_box.size.block = block_flow.base.position.size.block +
block_flow.fragment.margin.block_start_end() block_flow.fragment.margin.block_start_end()
} }
SpecificFragmentInfo::Iframe(_) => { SpecificFragmentInfo::Iframe(ref info) => {
self.border_box.size.block = IframeFragmentInfo::calculate_replaced_block_size( self.border_box.size.block =
style, containing_block_block_size) + info.calculate_replaced_block_size(style, containing_block_block_size) +
noncontent_block_size; noncontent_block_size;
} }
_ => panic!("should have been handled above"), _ => panic!("should have been handled above"),
@ -1897,6 +1902,19 @@ impl Fragment {
} }
} }
/// Determines the inline sizes of inline-block fragments. These cannot be fully computed until
/// inline size assignment has run for the child flow: thus it is computed "late", during
/// block size assignment.
pub fn update_late_computed_replaced_inline_size_if_necessary(&mut self) {
if let SpecificFragmentInfo::InlineBlock(ref mut inline_block_info) = self.specific {
let block_flow = inline_block_info.flow_ref.as_block();
let margin = block_flow.fragment.style.logical_margin();
self.border_box.size.inline = block_flow.fragment.border_box.size.inline +
MaybeAuto::from_style(margin.inline_start, Au(0)).specified_or_zero() +
MaybeAuto::from_style(margin.inline_end, Au(0)).specified_or_zero()
}
}
pub fn update_late_computed_inline_position_if_necessary(&mut self) { pub fn update_late_computed_inline_position_if_necessary(&mut self) {
match self.specific { match self.specific {
SpecificFragmentInfo::InlineAbsoluteHypothetical(ref mut info) => { SpecificFragmentInfo::InlineAbsoluteHypothetical(ref mut info) => {
@ -1980,6 +1998,13 @@ impl Fragment {
if self.style().get_effects().transform.is_some() { if self.style().get_effects().transform.is_some() {
return true return true
} }
// Canvas always layerizes, as an special case
// FIXME(pcwalton): Don't unconditionally form stacking contexts for each canvas.
if let SpecificFragmentInfo::Canvas(_) = self.specific {
return true
}
match self.style().get_box().position { match self.style().get_box().position {
position::T::absolute | position::T::fixed => { position::T::absolute | position::T::fixed => {
// FIXME(pcwalton): This should only establish a new stacking context when // FIXME(pcwalton): This should only establish a new stacking context when

View file

@ -184,7 +184,6 @@ pub fn compute_damage(old: &Option<Arc<ComputedValues>>, new: &ComputedValues) -
[ get_box.float, get_box.display, get_box.position ]); [ get_box.float, get_box.display, get_box.position ]);
// FIXME: test somehow that we checked every CSS property // FIXME: test somehow that we checked every CSS property
damage damage
} }

View file

@ -1283,10 +1283,11 @@ impl Flow for InlineFlow {
// TODO(pcwalton): Cache the line scanner? // TODO(pcwalton): Cache the line scanner?
debug!("assign_block_size_inline: floats in: {:?}", self.base.floats); debug!("assign_block_size_inline: floats in: {:?}", self.base.floats);
// Assign the block-size for the inline fragments. // Assign the block-size and late-computed inline-sizes for the inline fragments.
let containing_block_block_size = let containing_block_block_size =
self.base.block_container_explicit_block_size.unwrap_or(Au(0)); self.base.block_container_explicit_block_size.unwrap_or(Au(0));
for fragment in self.fragments.fragments.iter_mut() { for fragment in self.fragments.fragments.iter_mut() {
fragment.update_late_computed_replaced_inline_size_if_necessary();
fragment.assign_replaced_block_size_if_necessary( fragment.assign_replaced_block_size_if_necessary(
containing_block_block_size); containing_block_block_size);
} }
@ -1463,7 +1464,7 @@ impl Flow for InlineFlow {
self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW); self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, _: &LayoutContext) {
// First, gather up the positions of all the containing blocks (if any). // First, gather up the positions of all the containing blocks (if any).
let mut containing_block_positions = Vec::new(); let mut containing_block_positions = Vec::new();
let container_size = Size2D(self.base.block_container_inline_size, Au(0)); let container_size = Size2D(self.base.block_container_inline_size, Au(0));
@ -1503,14 +1504,18 @@ impl Flow for InlineFlow {
let block_flow = info.flow_ref.as_block(); let block_flow = info.flow_ref.as_block();
block_flow.base.absolute_position_info = self.base.absolute_position_info; block_flow.base.absolute_position_info = self.base.absolute_position_info;
block_flow.base.stacking_relative_position = block_flow.base.stacking_relative_position =
stacking_relative_border_box.origin stacking_relative_border_box.origin;
block_flow.base.stacking_relative_position_of_display_port =
self.base.stacking_relative_position_of_display_port;
} }
SpecificFragmentInfo::InlineAbsoluteHypothetical(ref mut info) => { SpecificFragmentInfo::InlineAbsoluteHypothetical(ref mut info) => {
flow::mut_base(&mut *info.flow_ref).clip = clip; flow::mut_base(&mut *info.flow_ref).clip = clip;
let block_flow = info.flow_ref.as_block(); let block_flow = info.flow_ref.as_block();
block_flow.base.absolute_position_info = self.base.absolute_position_info; block_flow.base.absolute_position_info = self.base.absolute_position_info;
block_flow.base.stacking_relative_position = block_flow.base.stacking_relative_position =
stacking_relative_border_box.origin stacking_relative_border_box.origin;
block_flow.base.stacking_relative_position_of_display_port =
self.base.stacking_relative_position_of_display_port;
} }
SpecificFragmentInfo::InlineAbsolute(ref mut info) => { SpecificFragmentInfo::InlineAbsolute(ref mut info) => {
@ -1527,7 +1532,9 @@ impl Flow for InlineFlow {
stacking_relative_position + *padding_box_origin; stacking_relative_position + *padding_box_origin;
block_flow.base.stacking_relative_position = block_flow.base.stacking_relative_position =
stacking_relative_border_box.origin stacking_relative_border_box.origin;
block_flow.base.stacking_relative_position_of_display_port =
self.base.stacking_relative_position_of_display_port;
} }
_ => {} _ => {}
} }

View file

@ -11,12 +11,12 @@ use animation;
use construct::ConstructionResult; use construct::ConstructionResult;
use context::{SharedLayoutContext, SharedLayoutContextWrapper}; use context::{SharedLayoutContext, SharedLayoutContextWrapper};
use css::node_style::StyledNode; use css::node_style::StyledNode;
use data::{LayoutDataAccess, LayoutDataWrapper};
use display_list_builder::ToGfxColor; use display_list_builder::ToGfxColor;
use flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils}; use flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils};
use flow_ref::FlowRef; use flow_ref::FlowRef;
use fragment::{Fragment, FragmentBorderBoxIterator}; use fragment::{Fragment, FragmentBorderBoxIterator};
use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT}; use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT};
use data::{LayoutDataAccess, LayoutDataWrapper};
use layout_debug; use layout_debug;
use opaque_node::OpaqueNodeMethods; use opaque_node::OpaqueNodeMethods;
use parallel::{self, UnsafeFlow}; use parallel::{self, UnsafeFlow};
@ -24,6 +24,7 @@ use sequential;
use wrapper::{LayoutNode, TLayoutNode}; use wrapper::{LayoutNode, TLayoutNode};
use azure::azure::AzColor; use azure::azure::AzColor;
use canvas_traits::CanvasMsg;
use encoding::EncodingRef; use encoding::EncodingRef;
use encoding::all::UTF_8; use encoding::all::UTF_8;
use geom::matrix2d::Matrix2D; use geom::matrix2d::Matrix2D;
@ -31,7 +32,7 @@ use geom::point::Point2D;
use geom::rect::Rect; use geom::rect::Rect;
use geom::scale_factor::ScaleFactor; use geom::scale_factor::ScaleFactor;
use geom::size::Size2D; use geom::size::Size2D;
use gfx::color; use gfx_traits::color;
use gfx::display_list::{ClippingRegion, DisplayItemMetadata, DisplayList, OpaqueNode}; use gfx::display_list::{ClippingRegion, DisplayItemMetadata, DisplayList, OpaqueNode};
use gfx::display_list::{StackingContext}; use gfx::display_list::{StackingContext};
use gfx::font_cache_task::FontCacheTask; use gfx::font_cache_task::FontCacheTask;
@ -39,7 +40,7 @@ use gfx::paint_task::Msg as PaintMsg;
use gfx::paint_task::{PaintChan, PaintLayer}; use gfx::paint_task::{PaintChan, PaintLayer};
use layout_traits::{LayoutControlMsg, LayoutTaskFactory}; use layout_traits::{LayoutControlMsg, LayoutTaskFactory};
use log; use log;
use msg::compositor_msg::{Epoch, ScrollPolicy}; use msg::compositor_msg::{Epoch, ScrollPolicy, LayerId};
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId}; use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId};
use profile_traits::mem::{self, Report, ReportsChan}; use profile_traits::mem::{self, Report, ReportsChan};
@ -57,6 +58,8 @@ use script_traits::{ConstellationControlMsg, OpaqueScriptLayoutChannel};
use script_traits::{ScriptControlChan, StylesheetLoadResponder}; use script_traits::{ScriptControlChan, StylesheetLoadResponder};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cell::Cell; use std::cell::Cell;
use std::collections::HashMap;
use std::collections::hash_state::DefaultState;
use std::mem::transmute; use std::mem::transmute;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::ptr; use std::ptr;
@ -69,6 +72,7 @@ use style::selector_matching::Stylist;
use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt}; use style::stylesheets::{Origin, Stylesheet, CSSRuleIteratorExt};
use url::Url; use url::Url;
use util::cursor::Cursor; use util::cursor::Cursor;
use util::fnv::FnvHasher;
use util::geometry::{Au, MAX_RECT}; use util::geometry::{Au, MAX_RECT};
use util::logical_geometry::LogicalPoint; use util::logical_geometry::LogicalPoint;
use util::mem::HeapSizeOf; use util::mem::HeapSizeOf;
@ -77,6 +81,12 @@ use util::task::spawn_named_with_send_on_failure;
use util::task_state; use util::task_state;
use util::workqueue::WorkQueue; use util::workqueue::WorkQueue;
/// The number of screens of data we're allowed to generate display lists for in each direction.
pub const DISPLAY_PORT_SIZE_FACTOR: i32 = 8;
/// The number of screens we have to traverse before we decide to generate new display lists.
const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4;
/// Mutable data belonging to the LayoutTask. /// Mutable data belonging to the LayoutTask.
/// ///
/// This needs to be protected by a mutex so we can do fast RPCs. /// This needs to be protected by a mutex so we can do fast RPCs.
@ -127,6 +137,10 @@ pub struct LayoutTaskData {
/// A counter for epoch messages /// A counter for epoch messages
epoch: Epoch, epoch: Epoch,
/// The position and size of the visible rect for each layer. We do not build display lists
/// for any areas more than `DISPLAY_PORT_SIZE_FACTOR` screens away from this area.
pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,
} }
/// Information needed by the layout task. /// Information needed by the layout task.
@ -182,6 +196,11 @@ pub struct LayoutTask {
/// Is this the first reflow in this LayoutTask? /// Is this the first reflow in this LayoutTask?
pub first_reflow: Cell<bool>, pub first_reflow: Cell<bool>,
/// To receive a canvas renderer associated to a layer, this message is propagated
/// to the paint chan
pub canvas_layers_receiver: Receiver<(LayerId, Option<Arc<Mutex<Sender<CanvasMsg>>>>)>,
pub canvas_layers_sender: Sender<(LayerId, Option<Arc<Mutex<Sender<CanvasMsg>>>>)>,
/// A mutex to allow for fast, read-only RPC of layout's internal data /// A mutex to allow for fast, read-only RPC of layout's internal data
/// structures, while still letting the LayoutTask modify them. /// structures, while still letting the LayoutTask modify them.
/// ///
@ -207,7 +226,7 @@ impl LayoutTaskFactory for LayoutTask {
memory_profiler_chan: mem::ProfilerChan, memory_profiler_chan: mem::ProfilerChan,
shutdown_chan: Sender<()>) { shutdown_chan: Sender<()>) {
let ConstellationChan(con_chan) = constellation_chan.clone(); let ConstellationChan(con_chan) = constellation_chan.clone();
spawn_named_with_send_on_failure("LayoutTask", task_state::LAYOUT, move || { spawn_named_with_send_on_failure(format!("LayoutTask {:?}", id), task_state::LAYOUT, move || {
{ // Ensures layout task is destroyed before we send shutdown message { // Ensures layout task is destroyed before we send shutdown message
let sender = chan.sender(); let sender = chan.sender();
let layout = LayoutTask::new(id, let layout = LayoutTask::new(id,
@ -297,6 +316,7 @@ impl LayoutTask {
// Create the channel on which new animations can be sent. // Create the channel on which new animations can be sent.
let (new_animations_sender, new_animations_receiver) = channel(); let (new_animations_sender, new_animations_receiver) = channel();
let (image_cache_sender, image_cache_receiver) = channel(); let (image_cache_sender, image_cache_receiver) = channel();
let (canvas_layers_sender, canvas_layers_receiver) = channel();
LayoutTask { LayoutTask {
id: id, id: id,
@ -316,6 +336,8 @@ impl LayoutTask {
first_reflow: Cell::new(true), first_reflow: Cell::new(true),
image_cache_receiver: image_cache_receiver, image_cache_receiver: image_cache_receiver,
image_cache_sender: ImageCacheChan(image_cache_sender), image_cache_sender: ImageCacheChan(image_cache_sender),
canvas_layers_receiver: canvas_layers_receiver,
canvas_layers_sender: canvas_layers_sender,
rw_data: Arc::new(Mutex::new( rw_data: Arc::new(Mutex::new(
LayoutTaskData { LayoutTaskData {
root_flow: None, root_flow: None,
@ -330,6 +352,7 @@ impl LayoutTask {
content_box_response: Rect::zero(), content_box_response: Rect::zero(),
content_boxes_response: Vec::new(), content_boxes_response: Vec::new(),
running_animations: Vec::new(), running_animations: Vec::new(),
visible_rects: Arc::new(HashMap::with_hash_state(Default::default())),
new_animations_receiver: new_animations_receiver, new_animations_receiver: new_animations_receiver,
new_animations_sender: new_animations_sender, new_animations_sender: new_animations_sender,
epoch: Epoch(0), epoch: Epoch(0),
@ -361,10 +384,12 @@ impl LayoutTask {
constellation_chan: rw_data.constellation_chan.clone(), constellation_chan: rw_data.constellation_chan.clone(),
layout_chan: self.chan.clone(), layout_chan: self.chan.clone(),
font_cache_task: self.font_cache_task.clone(), font_cache_task: self.font_cache_task.clone(),
canvas_layers_sender: self.canvas_layers_sender.clone(),
stylist: &*rw_data.stylist, stylist: &*rw_data.stylist,
url: (*url).clone(), url: (*url).clone(),
reflow_root: reflow_root.map(|node| OpaqueNodeMethods::from_layout_node(node)), reflow_root: reflow_root.map(|node| OpaqueNodeMethods::from_layout_node(node)),
dirty: Rect::zero(), dirty: Rect::zero(),
visible_rects: rw_data.visible_rects.clone(),
generation: rw_data.generation, generation: rw_data.generation,
new_animations_sender: rw_data.new_animations_sender.clone(), new_animations_sender: rw_data.new_animations_sender.clone(),
goal: goal, goal: goal,
@ -406,6 +431,10 @@ impl LayoutTask {
match port_to_read { match port_to_read {
PortToRead::Pipeline => { PortToRead::Pipeline => {
match self.pipeline_port.recv().unwrap() { match self.pipeline_port.recv().unwrap() {
LayoutControlMsg::SetVisibleRects(new_visible_rects) => {
self.handle_request_helper(Msg::SetVisibleRects(new_visible_rects),
possibly_locked_rw_data)
}
LayoutControlMsg::TickAnimations => { LayoutControlMsg::TickAnimations => {
self.handle_request_helper(Msg::TickAnimations, possibly_locked_rw_data) self.handle_request_helper(Msg::TickAnimations, possibly_locked_rw_data)
} }
@ -509,6 +538,9 @@ impl LayoutTask {
|| self.handle_reflow(&*data, possibly_locked_rw_data)); || self.handle_reflow(&*data, possibly_locked_rw_data));
}, },
Msg::TickAnimations => self.tick_all_animations(possibly_locked_rw_data), Msg::TickAnimations => self.tick_all_animations(possibly_locked_rw_data),
Msg::SetVisibleRects(new_visible_rects) => {
self.set_visible_rects(new_visible_rects, possibly_locked_rw_data);
}
Msg::ReapLayoutData(dead_layout_data) => { Msg::ReapLayoutData(dead_layout_data) => {
unsafe { unsafe {
self.handle_reap_layout_data(dead_layout_data) self.handle_reap_layout_data(dead_layout_data)
@ -887,7 +919,8 @@ impl LayoutTask {
// let the constellation know about the viewport constraints // let the constellation know about the viewport constraints
let ConstellationChan(ref constellation_chan) = rw_data.constellation_chan; let ConstellationChan(ref constellation_chan) = rw_data.constellation_chan;
constellation_chan.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap(); constellation_chan.send(ConstellationMsg::ViewportConstrained(
self.id, constraints)).unwrap();
} }
} }
@ -937,6 +970,14 @@ impl LayoutTask {
animation::process_new_animations(&mut *rw_data, self.id); animation::process_new_animations(&mut *rw_data, self.id);
} }
// Send new canvas renderers to the paint task
while let Ok((layer_id, renderer)) = self.canvas_layers_receiver.try_recv() {
// Just send if there's an actual renderer
if let Some(renderer) = renderer {
self.paint_chan.send(PaintMsg::CanvasLayer(layer_id, renderer));
}
}
// Perform post-style recalculation layout passes. // Perform post-style recalculation layout passes.
self.perform_post_style_recalc_layout_passes(&data.reflow_info, self.perform_post_style_recalc_layout_passes(&data.reflow_info,
&mut rw_data, &mut rw_data,
@ -963,6 +1004,64 @@ impl LayoutTask {
chan.send(ConstellationControlMsg::ReflowComplete(self.id, data.id)).unwrap(); chan.send(ConstellationControlMsg::ReflowComplete(self.id, data.id)).unwrap();
} }
fn set_visible_rects<'a>(&'a self,
new_visible_rects: Vec<(LayerId, Rect<Au>)>,
possibly_locked_rw_data: &mut Option<MutexGuard<'a, LayoutTaskData>>)
-> bool {
let mut rw_data = self.lock_rw_data(possibly_locked_rw_data);
// First, determine if we need to regenerate the display lists. This will happen if the
// layers have moved more than `DISPLAY_PORT_THRESHOLD_SIZE_FACTOR` away from their last
// positions.
let mut must_regenerate_display_lists = false;
let mut old_visible_rects = HashMap::with_hash_state(Default::default());
let inflation_amount =
Size2D(rw_data.screen_size.width * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR,
rw_data.screen_size.height * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR);
for &(ref layer_id, ref new_visible_rect) in new_visible_rects.iter() {
match rw_data.visible_rects.get(layer_id) {
None => {
old_visible_rects.insert(*layer_id, *new_visible_rect);
}
Some(old_visible_rect) => {
old_visible_rects.insert(*layer_id, *old_visible_rect);
if !old_visible_rect.inflate(inflation_amount.width, inflation_amount.height)
.intersects(new_visible_rect) {
must_regenerate_display_lists = true;
}
}
}
}
if !must_regenerate_display_lists {
// Update `visible_rects` in case there are new layers that were discovered.
rw_data.visible_rects = Arc::new(old_visible_rects);
return true
}
debug!("regenerating display lists!");
for &(ref layer_id, ref new_visible_rect) in new_visible_rects.iter() {
old_visible_rects.insert(*layer_id, *new_visible_rect);
}
rw_data.visible_rects = Arc::new(old_visible_rects);
// Regenerate the display lists.
let reflow_info = Reflow {
goal: ReflowGoal::ForDisplay,
page_clip_rect: MAX_RECT,
};
let mut layout_context = self.build_shared_layout_context(&*rw_data,
false,
None,
&self.url,
reflow_info.goal);
self.perform_post_main_layout_passes(&reflow_info, &mut *rw_data, &mut layout_context);
true
}
fn tick_all_animations<'a>(&'a self, fn tick_all_animations<'a>(&'a self,
possibly_locked_rw_data: &mut Option<MutexGuard<'a, possibly_locked_rw_data: &mut Option<MutexGuard<'a,
LayoutTaskData>>) { LayoutTaskData>>) {
@ -1044,7 +1143,15 @@ impl LayoutTask {
} }
}); });
self.perform_post_main_layout_passes(data, rw_data, layout_context);
}
fn perform_post_main_layout_passes<'a>(&'a self,
data: &Reflow,
rw_data: &mut LayoutTaskData,
layout_context: &mut SharedLayoutContext) {
// Build the display list if necessary, and send it to the painter. // Build the display list if necessary, and send it to the painter.
let mut root_flow = (*rw_data.root_flow.as_ref().unwrap()).clone();
self.compute_abs_pos_and_build_display_list(data, self.compute_abs_pos_and_build_display_list(data,
&mut root_flow, &mut root_flow,
&mut *layout_context, &mut *layout_context,
@ -1074,6 +1181,7 @@ impl LayoutTask {
} }
fn reflow_all_nodes(flow: &mut Flow) { fn reflow_all_nodes(flow: &mut Flow) {
debug!("reflowing all nodes!");
flow::mut_base(flow).restyle_damage.insert(REFLOW | REPAINT); flow::mut_base(flow).restyle_damage.insert(REFLOW | REPAINT);
for child in flow::child_iter(flow) { for child in flow::child_iter(flow) {

View file

@ -39,13 +39,14 @@ extern crate util;
extern crate rustc_serialize; extern crate rustc_serialize;
extern crate alloc; extern crate alloc;
extern crate azure; extern crate azure;
extern crate canvas; extern crate canvas_traits;
extern crate clock_ticks; extern crate clock_ticks;
extern crate collections; extern crate collections;
extern crate cssparser; extern crate cssparser;
extern crate encoding; extern crate encoding;
extern crate geom; extern crate geom;
extern crate gfx; extern crate gfx;
extern crate gfx_traits;
extern crate layout_traits; extern crate layout_traits;
extern crate libc; extern crate libc;
extern crate msg; extern crate msg;

View file

@ -117,8 +117,8 @@ impl Flow for ListItemFlow {
} }
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn place_float_if_applicable<'a>(&mut self, layout_context: &'a LayoutContext<'a>) { fn place_float_if_applicable<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {

View file

@ -63,8 +63,8 @@ impl Flow for MulticolFlow {
self.block_flow.assign_block_size(ctx); self.block_flow.assign_block_size(ctx);
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) { fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {

View file

@ -169,7 +169,7 @@ trait ParallelPostorderDomTraversal : PostorderDomTraversal {
unsafe_node = layout_node_to_unsafe_layout_node(&parent); unsafe_node = layout_node_to_unsafe_layout_node(&parent);
let parent_layout_data: &mut LayoutDataWrapper = mem::transmute(parent_layout_data); let parent_layout_data: &LayoutDataWrapper = mem::transmute(parent_layout_data);
if parent_layout_data if parent_layout_data
.data .data
.parallel .parallel
@ -221,7 +221,7 @@ trait ParallelPostorderFlowTraversal : PostorderFlowTraversal {
loop { loop {
unsafe { unsafe {
// Get a real flow. // Get a real flow.
let flow: &mut FlowRef = mem::transmute(&unsafe_flow); let flow: &mut FlowRef = mem::transmute(&mut unsafe_flow);
// Perform the appropriate traversal. // Perform the appropriate traversal.
if self.should_process(&mut **flow) { if self.should_process(&mut **flow) {
@ -236,7 +236,7 @@ trait ParallelPostorderFlowTraversal : PostorderFlowTraversal {
Ordering::Relaxed); Ordering::Relaxed);
// Possibly enqueue the parent. // Possibly enqueue the parent.
let unsafe_parent = base.parallel.parent; let mut unsafe_parent = base.parallel.parent;
if unsafe_parent == null_unsafe_flow() { if unsafe_parent == null_unsafe_flow() {
// We're done! // We're done!
break break
@ -245,7 +245,7 @@ trait ParallelPostorderFlowTraversal : PostorderFlowTraversal {
// No, we're not at the root yet. Then are we the last child // No, we're not at the root yet. Then are we the last child
// of our parent to finish processing? If so, we can continue // of our parent to finish processing? If so, we can continue
// on with our parent; otherwise, we've gotta wait. // on with our parent; otherwise, we've gotta wait.
let parent: &mut FlowRef = mem::transmute(&unsafe_parent); let parent: &mut FlowRef = mem::transmute(&mut unsafe_parent);
let parent_base = flow::mut_base(&mut **parent); let parent_base = flow::mut_base(&mut **parent);
if parent_base.parallel.children_count.fetch_sub(1, Ordering::SeqCst) == 1 { if parent_base.parallel.children_count.fetch_sub(1, Ordering::SeqCst) == 1 {
// We were the last child of our parent. Reflow our parent. // We were the last child of our parent. Reflow our parent.
@ -269,14 +269,14 @@ trait ParallelPreorderFlowTraversal : PreorderFlowTraversal {
#[inline(always)] #[inline(always)]
fn run_parallel_helper(&self, fn run_parallel_helper(&self,
unsafe_flow: UnsafeFlow, mut unsafe_flow: UnsafeFlow,
proxy: &mut WorkerProxy<SharedLayoutContextWrapper,UnsafeFlow>, proxy: &mut WorkerProxy<SharedLayoutContextWrapper,UnsafeFlow>,
top_down_func: FlowTraversalFunction, top_down_func: FlowTraversalFunction,
bottom_up_func: FlowTraversalFunction) { bottom_up_func: FlowTraversalFunction) {
let mut had_children = false; let mut had_children = false;
unsafe { unsafe {
// Get a real flow. // Get a real flow.
let flow: &mut FlowRef = mem::transmute(&unsafe_flow); let flow: &mut FlowRef = mem::transmute(&mut unsafe_flow);
if self.should_record_thread_ids() { if self.should_record_thread_ids() {
flow::mut_base(&mut **flow).thread_id = proxy.worker_index(); flow::mut_base(&mut **flow).thread_id = proxy.worker_index();

View file

@ -503,8 +503,8 @@ impl Flow for TableFlow {
self.block_flow.assign_block_size_for_table_like_flow(layout_context, vertical_spacing) self.block_flow.assign_block_size_for_table_like_flow(layout_context, vertical_spacing)
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> { fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {

View file

@ -59,13 +59,13 @@ impl Flow for TableCaptionFlow {
self.block_flow.assign_inline_sizes(ctx); self.block_flow.assign_inline_sizes(ctx);
} }
fn assign_block_size<'a>(&mut self, ctx: &'a LayoutContext<'a>) { fn assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {
debug!("assign_block_size: assigning block_size for table_caption"); debug!("assign_block_size: assigning block_size for table_caption");
self.block_flow.assign_block_size(ctx); self.block_flow.assign_block_size(layout_context);
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) { fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {

View file

@ -160,13 +160,13 @@ impl Flow for TableCellFlow {
|_, _, _, _, _, _| {}); |_, _, _, _, _, _| {});
} }
fn assign_block_size<'a>(&mut self, ctx: &'a LayoutContext<'a>) { fn assign_block_size<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {
debug!("assign_block_size: assigning block_size for table_cell"); debug!("assign_block_size: assigning block_size for table_cell");
self.assign_block_size_table_cell_base(ctx); self.assign_block_size_table_cell_base(layout_context);
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) { fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {

View file

@ -403,8 +403,8 @@ impl Flow for TableRowFlow {
self.assign_block_size_table_row_base(layout_context); self.assign_block_size_table_row_base(layout_context);
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) { fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {

View file

@ -203,8 +203,8 @@ impl Flow for TableRowGroupFlow {
self.spacing.vertical) self.spacing.vertical)
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) { fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {

View file

@ -381,8 +381,8 @@ impl Flow for TableWrapperFlow {
MarginsMayCollapseFlag::MarginsMayNotCollapse); MarginsMayCollapseFlag::MarginsMayNotCollapse);
} }
fn compute_absolute_position(&mut self) { fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position() self.block_flow.compute_absolute_position(layout_context)
} }
fn place_float_if_applicable<'a>(&mut self, layout_context: &'a LayoutContext<'a>) { fn place_float_if_applicable<'a>(&mut self, layout_context: &'a LayoutContext<'a>) {

View file

@ -170,7 +170,7 @@ impl<'a> PreorderDomTraversal for RecalcStyleForNode<'a> {
&some_bf, &some_bf,
&mut applicable_declarations, &mut applicable_declarations,
&mut shareable); &mut shareable);
} else { } else if node.has_changed() {
ThreadSafeLayoutNode::new(&node).set_restyle_damage( ThreadSafeLayoutNode::new(&node).set_restyle_damage(
incremental::rebuild_and_reflow()) incremental::rebuild_and_reflow())
} }
@ -364,7 +364,7 @@ pub struct ComputeAbsolutePositions<'a> {
impl<'a> PreorderFlowTraversal for ComputeAbsolutePositions<'a> { impl<'a> PreorderFlowTraversal for ComputeAbsolutePositions<'a> {
#[inline] #[inline]
fn process(&self, flow: &mut Flow) { fn process(&self, flow: &mut Flow) {
flow.compute_absolute_position(); flow.compute_absolute_position(self.layout_context);
} }
} }

View file

@ -32,7 +32,7 @@
#![allow(unsafe_code)] #![allow(unsafe_code)]
use canvas::canvas_msg::CanvasMsg; use canvas_traits::CanvasMsg;
use context::SharedLayoutContext; use context::SharedLayoutContext;
use css::node_style::StyledNode; use css::node_style::StyledNode;
use incremental::RestyleDamage; use incremental::RestyleDamage;

View file

@ -7,6 +7,9 @@ authors = ["The Servo Project Developers"]
name = "layout_traits" name = "layout_traits"
path = "lib.rs" path = "lib.rs"
[dependencies.geom]
git = "https://github.com/servo/rust-geom"
[dependencies.gfx] [dependencies.gfx]
path = "../gfx" path = "../gfx"

View file

@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
extern crate geom;
extern crate gfx; extern crate gfx;
extern crate script_traits; extern crate script_traits;
extern crate msg; extern crate msg;
@ -15,25 +16,29 @@ extern crate util;
// The traits are here instead of in layout so // The traits are here instead of in layout so
// that these modules won't have to depend on layout. // that these modules won't have to depend on layout.
use geom::rect::Rect;
use gfx::font_cache_task::FontCacheTask; use gfx::font_cache_task::FontCacheTask;
use gfx::paint_task::PaintChan; use gfx::paint_task::PaintChan;
use msg::compositor_msg::Epoch; use msg::compositor_msg::{Epoch, LayerId};
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, PipelineExitType}; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, PipelineExitType};
use profile_traits::mem; use profile_traits::mem;
use profile_traits::time; use profile_traits::time;
use net_traits::image_cache_task::ImageCacheTask; use net_traits::image_cache_task::ImageCacheTask;
use url::Url;
use script_traits::{ScriptControlChan, OpaqueScriptLayoutChannel}; use script_traits::{ScriptControlChan, OpaqueScriptLayoutChannel};
use std::sync::mpsc::{Sender, Receiver}; use std::sync::mpsc::{Sender, Receiver};
use util::geometry::Au;
use url::Url;
/// Messages sent to the layout task from the constellation /// Messages sent to the layout task from the constellation and/or compositor.
pub enum LayoutControlMsg { pub enum LayoutControlMsg {
ExitNow(PipelineExitType), ExitNow(PipelineExitType),
GetCurrentEpoch(Sender<Epoch>), GetCurrentEpoch(Sender<Epoch>),
TickAnimations, TickAnimations,
SetVisibleRects(Vec<(LayerId, Rect<Au>)>),
} }
/// A channel wrapper for constellation messages /// A channel wrapper for constellation messages
#[derive(Clone)]
pub struct LayoutControlChan(pub Sender<LayoutControlMsg>); pub struct LayoutControlChan(pub Sender<LayoutControlMsg>);
// A static method creating a layout task // A static method creating a layout task

View file

@ -1,5 +1,4 @@
[package] [package]
name = "msg" name = "msg"
version = "0.0.1" version = "0.0.1"
authors = ["The Servo Project Developers"] authors = ["The Servo Project Developers"]

View file

@ -34,7 +34,7 @@ impl FrameTreeId {
} }
} }
#[derive(Clone, PartialEq, Eq, Copy)] #[derive(Clone, PartialEq, Eq, Copy, Hash)]
pub struct LayerId(pub usize, pub u32); pub struct LayerId(pub usize, pub u32);
impl Debug for LayerId { impl Debug for LayerId {

View file

@ -366,7 +366,7 @@ pub struct SubpageId(pub u32);
// The type of pipeline exit. During complete shutdowns, pipelines do not have to // The type of pipeline exit. During complete shutdowns, pipelines do not have to
// release resources automatically released on process termination. // release resources automatically released on process termination.
#[derive(Copy, Clone)] #[derive(Copy, Clone, Debug)]
pub enum PipelineExitType { pub enum PipelineExitType {
PipelineOnly, PipelineOnly,
Complete, Complete,

View file

@ -5,22 +5,24 @@
use url::Url; use url::Url;
use hyper::method::Method; use hyper::method::Method;
use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
use hyper::header::{Headers, ContentType, IfModifiedSince, IfNoneMatch, Accept}; use hyper::header::{Header, Headers, ContentType, IfModifiedSince, IfNoneMatch};
use hyper::header::{IfUnmodifiedSince, IfMatch, IfRange, Location, HeaderView}; use hyper::header::{Accept, IfUnmodifiedSince, IfMatch, IfRange, Location};
use hyper::header::{AcceptLanguage, ContentLanguage}; use hyper::header::{HeaderView, AcceptLanguage, ContentLanguage, Language};
use hyper::header::{QualityItem, qitem, q};
use hyper::status::StatusCode; use hyper::status::StatusCode;
use fetch::cors_cache::{CORSCache, CacheRequestDetails}; use fetch::cors_cache::{CORSCache, CacheRequestDetails};
use fetch::response::{Response, ResponseType}; use fetch::response::{Response, ResponseType};
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use std::str::FromStr;
/// A [request context](https://fetch.spec.whatwg.org/#concept-request-context) /// A [request context](https://fetch.spec.whatwg.org/#concept-request-context)
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq)]
pub enum Context { pub enum Context {
Audio, Beacon, CSPreport, Download, Embed, Eventsource, Audio, Beacon, CSPreport, Download, Embed, Eventsource,
Favicon, Fetch, Font, Form, Frame, Hyperlink, IFrame, Image, Favicon, Fetch, Font, Form, Frame, Hyperlink, IFrame, Image,
ImageSet, Import, Internal, Location, Manifest, Object, Ping, ImageSet, Import, Internal, Location, Manifest, MetaRefresh, Object,
Plugin, Prefetch, Script, ServiceWorker, SharedWorker, Subresource, Ping, Plugin, Prefetch, PreRender, Script, ServiceWorker, SharedWorker,
Style, Track, Video, Worker, XMLHttpRequest, XSLT Subresource, Style, Track, Video, Worker, XMLHttpRequest, XSLT
} }
/// A [request context frame type](https://fetch.spec.whatwg.org/#concept-request-context-frame-type) /// A [request context frame type](https://fetch.spec.whatwg.org/#concept-request-context-frame-type)
@ -143,9 +145,56 @@ impl Request {
} }
} }
// [Fetch](https://fetch.spec.whatwg.org#concept-fetch) /// [Fetch](https://fetch.spec.whatwg.org#concept-fetch)
pub fn fetch(&mut self, _cors_flag: bool) -> Response { pub fn fetch(&mut self, cors_flag: bool) -> Response {
// TODO: Implement fetch spec // Step 1
if self.context != Context::Fetch && !self.headers.has::<Accept>() {
// Substep 1
let value = match self.context {
Context::Favicon | Context::Image | Context::ImageSet
=> vec![qitem(Mime(TopLevel::Image, SubLevel::Png, vec![])),
// FIXME: This should properly generate a MimeType that has a
// SubLevel of svg+xml (https://github.com/hyperium/mime.rs/issues/22)
qitem(Mime(TopLevel::Image, SubLevel::Ext("svg+xml".to_string()), vec![])),
QualityItem::new(Mime(TopLevel::Image, SubLevel::Star, vec![]), q(0.8)),
QualityItem::new(Mime(TopLevel::Star, SubLevel::Star, vec![]), q(0.5))],
Context::Form | Context::Frame | Context::Hyperlink |
Context::IFrame | Context::Location | Context::MetaRefresh |
Context::PreRender
=> vec![qitem(Mime(TopLevel::Text, SubLevel::Html, vec![])),
// FIXME: This should properly generate a MimeType that has a
// SubLevel of xhtml+xml (https://github.com/hyperium/mime.rs/issues/22)
qitem(Mime(TopLevel::Application, SubLevel::Ext("xhtml+xml".to_string()), vec![])),
QualityItem::new(Mime(TopLevel::Application, SubLevel::Xml, vec![]), q(0.9)),
QualityItem::new(Mime(TopLevel::Star, SubLevel::Star, vec![]), q(0.8))],
Context::Internal if self.context_frame_type != ContextFrameType::ContextNone
=> vec![qitem(Mime(TopLevel::Text, SubLevel::Html, vec![])),
// FIXME: This should properly generate a MimeType that has a
// SubLevel of xhtml+xml (https://github.com/hyperium/mime.rs/issues/22)
qitem(Mime(TopLevel::Application, SubLevel::Ext("xhtml+xml".to_string()), vec![])),
QualityItem::new(Mime(TopLevel::Application, SubLevel::Xml, vec![]), q(0.9)),
QualityItem::new(Mime(TopLevel::Star, SubLevel::Star, vec![]), q(0.8))],
Context::Style
=> vec![qitem(Mime(TopLevel::Text, SubLevel::Css, vec![])),
QualityItem::new(Mime(TopLevel::Star, SubLevel::Star, vec![]), q(0.1))],
_ => vec![qitem(Mime(TopLevel::Star, SubLevel::Star, vec![]))]
};
// Substep 2
self.headers.set(Accept(value));
}
// Step 2
if self.context != Context::Fetch && !self.headers.has::<AcceptLanguage>() {
self.headers.set(AcceptLanguage(vec![qitem(Language::from_str("en-US").unwrap())]));
}
// TODO: Figure out what a Priority object is
// Step 3
// Step 4
self.main_fetch(cors_flag)
}
/// [Main fetch](https://fetch.spec.whatwg.org/#concept-main-fetch)
pub fn main_fetch(&mut self, _cors_flag: bool) -> Response {
// TODO: Implement main fetch spec
Response::network_error() Response::network_error()
} }
@ -174,7 +223,7 @@ impl Request {
} }
} }
// [HTTP fetch](https://fetch.spec.whatwg.org#http-fetch) /// [HTTP fetch](https://fetch.spec.whatwg.org#http-fetch)
pub fn http_fetch(&mut self, cors_flag: bool, cors_preflight_flag: bool, authentication_fetch_flag: bool) -> Response { pub fn http_fetch(&mut self, cors_flag: bool, cors_preflight_flag: bool, authentication_fetch_flag: bool) -> Response {
// Step 1 // Step 1
let mut response: Option<Response> = None; let mut response: Option<Response> = None;
@ -337,19 +386,19 @@ impl Request {
response response
} }
// [HTTP network or cache fetch](https://fetch.spec.whatwg.org#http-network-or-cache-fetch) /// [HTTP network or cache fetch](https://fetch.spec.whatwg.org#http-network-or-cache-fetch)
pub fn http_network_or_cache_fetch(&mut self, _credentials_flag: bool, _authentication_fetch_flag: bool) -> Response { pub fn http_network_or_cache_fetch(&mut self, _credentials_flag: bool, _authentication_fetch_flag: bool) -> Response {
// TODO: Implement HTTP network or cache fetch spec // TODO: Implement HTTP network or cache fetch spec
Response::network_error() Response::network_error()
} }
// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch) /// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch)
pub fn preflight_fetch(&mut self) -> Response { pub fn preflight_fetch(&mut self) -> Response {
// TODO: Implement preflight fetch spec // TODO: Implement preflight fetch spec
Response::network_error() Response::network_error()
} }
// [CORS check](https://fetch.spec.whatwg.org#concept-cors-check) /// [CORS check](https://fetch.spec.whatwg.org#concept-cors-check)
pub fn cors_check(&mut self, response: &Response) -> Result<(), ()> { pub fn cors_check(&mut self, response: &Response) -> Result<(), ()> {
// TODO: Implement CORS check spec // TODO: Implement CORS check spec
Err(()) Err(())

View file

@ -4,7 +4,8 @@
use collections::borrow::ToOwned; use collections::borrow::ToOwned;
use net_traits::image::base::{Image, load_from_memory}; use net_traits::image::base::{Image, load_from_memory};
use net_traits::image_cache_task::{ImageState, ImageCacheTask, ImageCacheChan, ImageCacheCommand, ImageCacheResult}; use net_traits::image_cache_task::{ImageState, ImageCacheTask, ImageCacheChan, ImageCacheCommand};
use net_traits::image_cache_task::{ImageCacheResult, ImageResponse, UsePlaceholder};
use net_traits::load_whole_resource; use net_traits::load_whole_resource;
use std::collections::HashMap; use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map::Entry::{Occupied, Vacant};
@ -53,13 +54,13 @@ impl PendingLoad {
/// failure) are still stored here, so that they aren't /// failure) are still stored here, so that they aren't
/// fetched again. /// fetched again.
struct CompletedLoad { struct CompletedLoad {
image: Option<Arc<Image>>, image_response: ImageResponse,
} }
impl CompletedLoad { impl CompletedLoad {
fn new(image: Option<Arc<Image>>) -> CompletedLoad { fn new(image_response: ImageResponse) -> CompletedLoad {
CompletedLoad { CompletedLoad {
image: image, image_response: image_response,
} }
} }
} }
@ -79,11 +80,11 @@ impl ImageListener {
} }
} }
fn notify(self, image: Option<Arc<Image>>) { fn notify(self, image_response: ImageResponse) {
let ImageCacheChan(ref sender) = self.sender; let ImageCacheChan(ref sender) = self.sender;
let msg = ImageCacheResult { let msg = ImageCacheResult {
responder: self.responder, responder: self.responder,
image: image, image_response: image_response,
}; };
sender.send(msg).ok(); sender.send(msg).ok();
} }
@ -210,10 +211,19 @@ impl ImageCache {
ImageCacheCommand::RequestImage(url, result_chan, responder) => { ImageCacheCommand::RequestImage(url, result_chan, responder) => {
self.request_image(url, result_chan, responder); self.request_image(url, result_chan, responder);
} }
ImageCacheCommand::GetImageIfAvailable(url, consumer) => { ImageCacheCommand::GetImageIfAvailable(url, use_placeholder, consumer) => {
let result = match self.completed_loads.get(&url) { let result = match self.completed_loads.get(&url) {
Some(completed_load) => { Some(completed_load) => {
completed_load.image.clone().ok_or(ImageState::LoadError) match (completed_load.image_response.clone(), use_placeholder) {
(ImageResponse::Loaded(image), _) |
(ImageResponse::PlaceholderLoaded(image), UsePlaceholder::Yes) => {
Ok(image)
}
(ImageResponse::PlaceholderLoaded(_), UsePlaceholder::No) |
(ImageResponse::None, _) => {
Err(ImageState::LoadError)
}
}
} }
None => { None => {
let pending_load = self.pending_loads.get(&url); let pending_load = self.pending_loads.get(&url);
@ -255,8 +265,13 @@ impl ImageCache {
}); });
} }
Err(_) => { Err(_) => {
let placeholder_image = self.placeholder_image.clone(); match self.placeholder_image.clone() {
self.complete_load(msg.url, placeholder_image); Some(placeholder_image) => {
self.complete_load(msg.url, ImageResponse::PlaceholderLoaded(
placeholder_image))
}
None => self.complete_load(msg.url, ImageResponse::None),
}
} }
} }
} }
@ -265,31 +280,37 @@ impl ImageCache {
// Handle a message from one of the decoder worker threads // Handle a message from one of the decoder worker threads
fn handle_decoder(&mut self, msg: DecoderMsg) { fn handle_decoder(&mut self, msg: DecoderMsg) {
let image = msg.image.map(Arc::new); let image = match msg.image {
None => ImageResponse::None,
Some(image) => ImageResponse::Loaded(Arc::new(image)),
};
self.complete_load(msg.url, image); self.complete_load(msg.url, image);
} }
// Change state of a url from pending -> loaded. // Change state of a url from pending -> loaded.
fn complete_load(&mut self, url: Url, image: Option<Arc<Image>>) { fn complete_load(&mut self, url: Url, image_response: ImageResponse) {
let pending_load = self.pending_loads.remove(&url).unwrap(); let pending_load = self.pending_loads.remove(&url).unwrap();
let completed_load = CompletedLoad::new(image.clone()); let completed_load = CompletedLoad::new(image_response.clone());
self.completed_loads.insert(url, completed_load); self.completed_loads.insert(url, completed_load);
for listener in pending_load.listeners.into_iter() { for listener in pending_load.listeners.into_iter() {
listener.notify(image.clone()); listener.notify(image_response.clone());
} }
} }
// Request an image from the cache // Request an image from the cache
fn request_image(&mut self, url: Url, result_chan: ImageCacheChan, responder: Option<Box<ImageResponder>>) { fn request_image(&mut self,
url: Url,
result_chan: ImageCacheChan,
responder: Option<Box<ImageResponder>>) {
let image_listener = ImageListener::new(result_chan, responder); let image_listener = ImageListener::new(result_chan, responder);
// Check if already completed // Check if already completed
match self.completed_loads.get(&url) { match self.completed_loads.get(&url) {
Some(completed_load) => { Some(completed_load) => {
// It's already completed, return a notify straight away // It's already completed, return a notify straight away
image_listener.notify(completed_load.image.clone()); image_listener.notify(completed_load.image_response.clone());
} }
None => { None => {
// Check if the load is already pending // Check if the load is already pending
@ -366,3 +387,4 @@ pub fn new_image_cache_task(resource_task: ResourceTask) -> ImageCacheTask {
ImageCacheTask::new(cmd_sender) ImageCacheTask::new(cmd_sender)
} }

View file

@ -12,7 +12,7 @@ use std::sync::mpsc::{channel, Sender};
/// image load completes. It is typically used to trigger a reflow /// image load completes. It is typically used to trigger a reflow
/// and/or repaint. /// and/or repaint.
pub trait ImageResponder : Send { pub trait ImageResponder : Send {
fn respond(&self, Option<Arc<Image>>); fn respond(&self, ImageResponse);
} }
/// The current state of an image in the cache. /// The current state of an image in the cache.
@ -23,6 +23,17 @@ pub enum ImageState {
NotRequested, NotRequested,
} }
/// The returned image.
#[derive(Clone)]
pub enum ImageResponse {
/// The requested image was loaded.
Loaded(Arc<Image>),
/// The requested image failed to load, so a placeholder was loaded instead.
PlaceholderLoaded(Arc<Image>),
/// Neither the requested image nor the placeholder could be loaded.
None
}
/// Channel for sending commands to the image cache. /// Channel for sending commands to the image cache.
#[derive(Clone)] #[derive(Clone)]
pub struct ImageCacheChan(pub Sender<ImageCacheResult>); pub struct ImageCacheChan(pub Sender<ImageCacheResult>);
@ -31,7 +42,7 @@ pub struct ImageCacheChan(pub Sender<ImageCacheResult>);
/// caller. /// caller.
pub struct ImageCacheResult { pub struct ImageCacheResult {
pub responder: Option<Box<ImageResponder>>, pub responder: Option<Box<ImageResponder>>,
pub image: Option<Arc<Image>>, pub image_response: ImageResponse,
} }
/// Commands that the image cache understands. /// Commands that the image cache understands.
@ -45,12 +56,18 @@ pub enum ImageCacheCommand {
/// TODO(gw): Profile this on some real world sites and see /// TODO(gw): Profile this on some real world sites and see
/// if it's worth caching the results of this locally in each /// if it's worth caching the results of this locally in each
/// layout / paint task. /// layout / paint task.
GetImageIfAvailable(Url, Sender<Result<Arc<Image>, ImageState>>), GetImageIfAvailable(Url, UsePlaceholder, Sender<Result<Arc<Image>, ImageState>>),
/// Clients must wait for a response before shutting down the ResourceTask /// Clients must wait for a response before shutting down the ResourceTask
Exit(Sender<()>), Exit(Sender<()>),
} }
#[derive(Copy, Clone, PartialEq)]
pub enum UsePlaceholder {
No,
Yes,
}
/// The client side of the image cache task. This can be safely cloned /// The client side of the image cache task. This can be safely cloned
/// and passed to different tasks. /// and passed to different tasks.
#[derive(Clone)] #[derive(Clone)]
@ -78,9 +95,10 @@ impl ImageCacheTask {
} }
/// Get the current state of an image. See ImageCacheCommand::GetImageIfAvailable. /// Get the current state of an image. See ImageCacheCommand::GetImageIfAvailable.
pub fn get_image_if_available(&self, url: Url) -> Result<Arc<Image>, ImageState> { pub fn get_image_if_available(&self, url: Url, use_placeholder: UsePlaceholder)
-> Result<Arc<Image>, ImageState> {
let (sender, receiver) = channel(); let (sender, receiver) = channel();
let msg = ImageCacheCommand::GetImageIfAvailable(url, sender); let msg = ImageCacheCommand::GetImageIfAvailable(url, use_placeholder, sender);
self.chan.send(msg).unwrap(); self.chan.send(msg).unwrap();
receiver.recv().unwrap() receiver.recv().unwrap()
} }
@ -92,3 +110,4 @@ impl ImageCacheTask {
response_port.recv().unwrap(); response_port.recv().unwrap();
} }
} }

View file

@ -132,8 +132,6 @@ pub struct PendingAsyncLoad {
resource_task: ResourceTask, resource_task: ResourceTask,
url: Url, url: Url,
pipeline: Option<PipelineId>, pipeline: Option<PipelineId>,
input_sender: Sender<LoadResponse>,
input_receiver: Receiver<LoadResponse>,
guard: PendingLoadGuard, guard: PendingLoadGuard,
} }
@ -156,13 +154,10 @@ impl Drop for PendingLoadGuard {
impl PendingAsyncLoad { impl PendingAsyncLoad {
pub fn new(resource_task: ResourceTask, url: Url, pipeline: Option<PipelineId>) pub fn new(resource_task: ResourceTask, url: Url, pipeline: Option<PipelineId>)
-> PendingAsyncLoad { -> PendingAsyncLoad {
let (sender, receiver) = channel();
PendingAsyncLoad { PendingAsyncLoad {
resource_task: resource_task, resource_task: resource_task,
url: url, url: url,
pipeline: pipeline, pipeline: pipeline,
input_sender: sender,
input_receiver: receiver,
guard: PendingLoadGuard { loaded: false, }, guard: PendingLoadGuard { loaded: false, },
} }
} }
@ -171,9 +166,18 @@ impl PendingAsyncLoad {
pub fn load(mut self) -> Receiver<LoadResponse> { pub fn load(mut self) -> Receiver<LoadResponse> {
self.guard.neuter(); self.guard.neuter();
let load_data = LoadData::new(self.url, self.pipeline); let load_data = LoadData::new(self.url, self.pipeline);
let consumer = LoadConsumer::Channel(self.input_sender); let (sender, receiver) = channel();
let consumer = LoadConsumer::Channel(sender);
self.resource_task.send(ControlMsg::Load(load_data, consumer)).unwrap();
receiver
}
/// Initiate the network request associated with this pending load, using the provided target.
pub fn load_async(mut self, listener: Box<AsyncResponseTarget + Send>) {
self.guard.neuter();
let load_data = LoadData::new(self.url, self.pipeline);
let consumer = LoadConsumer::Listener(listener);
self.resource_task.send(ControlMsg::Load(load_data, consumer)).unwrap(); self.resource_task.send(ControlMsg::Load(load_data, consumer)).unwrap();
self.input_receiver
} }
} }

View file

@ -8,5 +8,5 @@ name = "plugins"
path = "lib.rs" path = "lib.rs"
plugin = true plugin = true
[dependencies.tenacious] [dependencies]
git = "https://github.com/Manishearth/rust-tenacious.git" tenacious = "*"

View file

@ -2,15 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use syntax::ext::base::ExtCtxt; use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::codemap::Span; use syntax::codemap::Span;
use syntax::ptr::P; use syntax::ptr::P;
use syntax::ast::{Item, MetaItem, Expr}; use syntax::ast::{MetaItem, Expr};
use syntax::ast; use syntax::ast;
use syntax::ext::build::AstBuilder; use syntax::ext::build::AstBuilder;
use syntax::ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef, Struct, Substructure, TraitDef, ty}; use syntax::ext::deriving::generic::{combine_substructure, EnumMatching, FieldInfo, MethodDef, Struct, Substructure, TraitDef, ty};
pub fn expand_dom_struct(cx: &mut ExtCtxt, _: Span, _: &MetaItem, item: P<Item>) -> P<Item> { pub fn expand_dom_struct(cx: &mut ExtCtxt, sp: Span, _: &MetaItem, anno: Annotatable) -> Annotatable {
if let Annotatable::Item(item) = anno {
let mut item2 = (*item).clone(); let mut item2 = (*item).clone();
item2.attrs.push(quote_attr!(cx, #[must_root])); item2.attrs.push(quote_attr!(cx, #[must_root]));
item2.attrs.push(quote_attr!(cx, #[privatize])); item2.attrs.push(quote_attr!(cx, #[privatize]));
@ -21,13 +22,17 @@ pub fn expand_dom_struct(cx: &mut ExtCtxt, _: Span, _: &MetaItem, item: P<Item>)
// #[dom_struct] gets consumed, so this lets us keep around a residue // #[dom_struct] gets consumed, so this lets us keep around a residue
// Do NOT register a modifier/decorator on this attribute // Do NOT register a modifier/decorator on this attribute
item2.attrs.push(quote_attr!(cx, #[_dom_struct_marker])); item2.attrs.push(quote_attr!(cx, #[_dom_struct_marker]));
P(item2) Annotatable::Item(P(item2))
} else {
cx.span_err(sp, "#[dom_struct] applied to something other than a struct");
anno
}
} }
/// Provides the hook to expand `#[jstraceable]` into an implementation of `JSTraceable` /// Provides the hook to expand `#[jstraceable]` into an implementation of `JSTraceable`
/// ///
/// The expansion basically calls `trace()` on all of the fields of the struct/enum, erroring if they do not implement the method. /// The expansion basically calls `trace()` on all of the fields of the struct/enum, erroring if they do not implement the method.
pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item: &Item, push: &mut FnMut(P<Item>)) { pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item: Annotatable, push: &mut FnMut(Annotatable)) {
let trait_def = TraitDef { let trait_def = TraitDef {
span: span, span: span,
attributes: Vec::new(), attributes: Vec::new(),
@ -42,12 +47,13 @@ pub fn expand_jstraceable(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, item:
args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js","jsapi","JSTracer"))), ty::Raw(ast::MutMutable))), args: vec!(ty::Ptr(box ty::Literal(ty::Path::new(vec!("js","jsapi","JSTracer"))), ty::Raw(ast::MutMutable))),
ret_ty: ty::nil_ty(), ret_ty: ty::nil_ty(),
attributes: vec![quote_attr!(cx, #[inline(always)])], attributes: vec![quote_attr!(cx, #[inline(always)])],
is_unsafe: false,
combine_substructure: combine_substructure(box jstraceable_substructure) combine_substructure: combine_substructure(box jstraceable_substructure)
} }
], ],
associated_types: vec![], associated_types: vec![],
}; };
trait_def.expand(cx, mitem, item, push) trait_def.expand(cx, mitem, &item, push)
} }
// Mostly copied from syntax::ext::deriving::hash // Mostly copied from syntax::ext::deriving::hash

View file

@ -23,7 +23,7 @@ extern crate tenacious;
use rustc::lint::LintPassObject; use rustc::lint::LintPassObject;
use rustc::plugin::Registry; use rustc::plugin::Registry;
use syntax::ext::base::{Decorator, Modifier}; use syntax::ext::base::*;
use syntax::parse::token::intern; use syntax::parse::token::intern;
@ -39,9 +39,9 @@ pub mod casing;
#[plugin_registrar] #[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) { pub fn plugin_registrar(reg: &mut Registry) {
reg.register_syntax_extension(intern("dom_struct"), Modifier(box jstraceable::expand_dom_struct)); reg.register_syntax_extension(intern("dom_struct"), MultiModifier(box jstraceable::expand_dom_struct));
reg.register_syntax_extension(intern("jstraceable"), Decorator(box jstraceable::expand_jstraceable)); reg.register_syntax_extension(intern("jstraceable"), MultiDecorator(box jstraceable::expand_jstraceable));
reg.register_syntax_extension(intern("_generate_reflector"), Decorator(box reflector::expand_reflector)); reg.register_syntax_extension(intern("_generate_reflector"), MultiDecorator(box reflector::expand_reflector));
reg.register_macro("to_lower", casing::expand_lower); reg.register_macro("to_lower", casing::expand_lower);
reg.register_macro("to_upper", casing::expand_upper); reg.register_macro("to_upper", casing::expand_upper);
reg.register_lint_pass(box lints::transmute_type::TransmutePass as LintPassObject); reg.register_lint_pass(box lints::transmute_type::TransmutePass as LintPassObject);

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use syntax::{ast, codemap, visit}; use syntax::{ast, codemap, visit, ast_map};
use syntax::attr::AttrMetaMethods; use syntax::attr::AttrMetaMethods;
use rustc::lint::{Context, LintPass, LintArray}; use rustc::lint::{Context, LintPass, LintArray};
use rustc::middle::ty::expr_ty; use rustc::middle::ty::expr_ty;
@ -52,7 +52,11 @@ impl LintPass for UnrootedPass {
} }
/// All structs containing #[must_root] types must be #[must_root] themselves /// All structs containing #[must_root] types must be #[must_root] themselves
fn check_struct_def(&mut self, cx: &Context, def: &ast::StructDef, _i: ast::Ident, _gen: &ast::Generics, id: ast::NodeId) { fn check_struct_def(&mut self, cx: &Context, def: &ast::StructDef, _i: ast::Ident, _gen: &ast::Generics, id: ast::NodeId) {
if cx.tcx.map.expect_item(id).attrs.iter().all(|a| !a.check_name("must_root")) { let item = match cx.tcx.map.get(id) {
ast_map::Node::NodeItem(item) => item,
_ => cx.tcx.map.expect_item(cx.tcx.map.get_parent(id)),
};
if item.attrs.iter().all(|a| !a.check_name("must_root")) {
for ref field in def.fields.iter() { for ref field in def.fields.iter() {
lint_unrooted_ty(cx, &*field.node.ty, lint_unrooted_ty(cx, &*field.node.ty,
"Type must be rooted, use #[must_root] on the struct definition to propagate"); "Type must be rooted, use #[must_root] on the struct definition to propagate");

View file

@ -2,15 +2,15 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use syntax::ext::base::ExtCtxt; use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::codemap::Span; use syntax::codemap::Span;
use syntax::ptr::P; use syntax::ast::MetaItem;
use syntax::ast::{Item, MetaItem};
use syntax::ast; use syntax::ast;
use utils::match_ty_unwrap; use utils::match_ty_unwrap;
pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, item: &Item, push: &mut FnMut(P<Item>) -> ()) { pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, annotatable: Annotatable, push: &mut FnMut(Annotatable)) {
if let Annotatable::Item(item) = annotatable {
if let ast::ItemStruct(ref def, _) = item.node { if let ast::ItemStruct(ref def, _) = item.node {
let struct_name = item.ident; let struct_name = item.ident;
// This path has to be hardcoded, unfortunately, since we can't resolve paths at expansion time // This path has to be hardcoded, unfortunately, since we can't resolve paths at expansion time
@ -25,7 +25,7 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, item: &Item,
} }
} }
); );
impl_item.map(|it| push(it)) impl_item.map(|it| push(Annotatable::Item(it)))
}, },
// Or just call it on the first field (supertype). // Or just call it on the first field (supertype).
None => { None => {
@ -37,10 +37,11 @@ pub fn expand_reflector(cx: &mut ExtCtxt, span: Span, _: &MetaItem, item: &Item,
} }
} }
); );
impl_item.map(|it| push(it)) impl_item.map(|it| push(Annotatable::Item(it)))
} }
}; };
} else { } else {
cx.span_err(span, "#[dom_struct] seems to have been applied to a non-struct"); cx.span_err(span, "#[dom_struct] seems to have been applied to a non-struct");
} }
}
} }

View file

@ -42,6 +42,9 @@ path = "../gfx"
[dependencies.canvas] [dependencies.canvas]
path = "../canvas" path = "../canvas"
[dependencies.canvas_traits]
path = "../canvas_traits"
[dependencies.webdriver_traits] [dependencies.webdriver_traits]
path = "../webdriver_traits" path = "../webdriver_traits"

View file

@ -7,13 +7,12 @@
use script_task::{ScriptMsg, ScriptChan}; use script_task::{ScriptMsg, ScriptChan};
use msg::constellation_msg::{PipelineId}; use msg::constellation_msg::{PipelineId};
use net_traits::{LoadResponse, Metadata, load_whole_resource, ResourceTask, PendingAsyncLoad}; use net_traits::{Metadata, load_whole_resource, ResourceTask, PendingAsyncLoad};
use net_traits::AsyncResponseTarget;
use url::Url; use url::Url;
use std::sync::mpsc::Receiver;
#[jstraceable] #[jstraceable]
#[derive(PartialEq, Clone)] #[derive(PartialEq, Clone, Debug)]
pub enum LoadType { pub enum LoadType {
Image(Url), Image(Url),
Script(Url), Script(Url),
@ -75,9 +74,9 @@ impl DocumentLoader {
} }
/// Create and initiate a new network request. /// Create and initiate a new network request.
pub fn load_async(&mut self, load: LoadType) -> Receiver<LoadResponse> { pub fn load_async(&mut self, load: LoadType, listener: Box<AsyncResponseTarget + Send>) {
let pending = self.prepare_async_load(load); let pending = self.prepare_async_load(load);
pending.load() pending.load_async(listener)
} }
/// Create, initiate, and await the response for a new network request. /// Create, initiate, and await the response for a new network request.
@ -91,7 +90,7 @@ impl DocumentLoader {
/// Mark an in-progress network request complete. /// Mark an in-progress network request complete.
pub fn finish_load(&mut self, load: LoadType) { pub fn finish_load(&mut self, load: LoadType) {
let idx = self.blocking_loads.iter().position(|unfinished| *unfinished == load); let idx = self.blocking_loads.iter().position(|unfinished| *unfinished == load);
self.blocking_loads.remove(idx.expect("unknown completed load")); self.blocking_loads.remove(idx.expect(&format!("unknown completed load {:?}", load)));
if let Some(NotifierData { ref script_chan, pipeline }) = self.notifier_data { if let Some(NotifierData { ref script_chan, pipeline }) = self.notifier_data {
if !self.is_blocked() { if !self.is_blocked() {
@ -101,6 +100,7 @@ impl DocumentLoader {
} }
pub fn is_blocked(&self) -> bool { pub fn is_blocked(&self) -> bool {
//TODO: Ensure that we report blocked if parsing is still ongoing.
!self.blocking_loads.is_empty() !self.blocking_loads.is_empty()
} }

View file

@ -311,6 +311,7 @@ pub trait AttrHelpersForLayout {
unsafe fn value_atom_forever(&self) -> Option<Atom>; unsafe fn value_atom_forever(&self) -> Option<Atom>;
unsafe fn value_tokens_forever(&self) -> Option<&'static [Atom]>; unsafe fn value_tokens_forever(&self) -> Option<&'static [Atom]>;
unsafe fn local_name_atom_forever(&self) -> Atom; unsafe fn local_name_atom_forever(&self) -> Atom;
unsafe fn value(&self) -> &AttrValue;
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]
@ -351,4 +352,9 @@ impl AttrHelpersForLayout for Attr {
unsafe fn local_name_atom_forever(&self) -> Atom { unsafe fn local_name_atom_forever(&self) -> Atom {
self.local_name.clone() self.local_name.clone()
} }
#[inline]
unsafe fn value(&self) -> &AttrValue {
self.value.borrow_for_layout()
}
} }

View file

@ -34,8 +34,8 @@ use dom::bindings::refcounted::Trusted;
use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler}; use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler};
use script_task::ScriptChan; use script_task::ScriptChan;
use canvas::canvas_paint_task::{CanvasGradientStop, LinearGradientStyle, RadialGradientStyle}; use canvas_traits::{CanvasGradientStop, LinearGradientStyle, RadialGradientStyle};
use canvas::canvas_paint_task::{LineCapStyle, LineJoinStyle, CompositionOrBlending}; use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending};
use cssparser::RGBA; use cssparser::RGBA;
use encoding::types::EncodingRef; use encoding::types::EncodingRef;
use geom::matrix2d::Matrix2D; use geom::matrix2d::Matrix2D;

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use cssparser::RGBA; use cssparser::RGBA;
use canvas::canvas_paint_task::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle}; use canvas_traits::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle};
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::CanvasGradientBinding; use dom::bindings::codegen::Bindings::CanvasGradientBinding;
use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods; use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods;

View file

@ -28,19 +28,17 @@ use geom::point::Point2D;
use geom::rect::Rect; use geom::rect::Rect;
use geom::size::Size2D; use geom::size::Size2D;
use canvas::canvas_msg::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg}; use canvas_traits::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg};
use canvas::canvas_paint_task::{CanvasPaintTask, FillOrStrokeStyle}; use canvas_traits::{FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle};
use canvas::canvas_paint_task::{LinearGradientStyle, RadialGradientStyle}; use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending};
use canvas::canvas_paint_task::{LineCapStyle, LineJoinStyle, CompositionOrBlending}; use canvas::canvas_paint_task::CanvasPaintTask;
use net_traits::image::base::Image; use net_traits::image_cache_task::{ImageCacheChan, ImageResponse};
use net_traits::image_cache_task::ImageCacheChan;
use png::PixelsByColorType; use png::PixelsByColorType;
use num::{Float, ToPrimitive}; use num::{Float, ToPrimitive};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cell::RefCell; use std::cell::RefCell;
use std::sync::{Arc};
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::{channel, Sender};
use util::str::DOMString; use util::str::DOMString;
@ -260,8 +258,8 @@ impl CanvasRenderingContext2D {
}; };
let img = match self.request_image_from_cache(url) { let img = match self.request_image_from_cache(url) {
Some(img) => img, ImageResponse::Loaded(img) => img,
None => return None, ImageResponse::PlaceholderLoaded(_) | ImageResponse::None => return None,
}; };
let image_size = Size2D(img.width as f64, img.height as f64); let image_size = Size2D(img.width as f64, img.height as f64);
@ -277,7 +275,7 @@ impl CanvasRenderingContext2D {
return Some((image_data, image_size)); return Some((image_data, image_size));
} }
fn request_image_from_cache(&self, url: Url) -> Option<Arc<Image>> { fn request_image_from_cache(&self, url: Url) -> ImageResponse {
let canvas = self.canvas.root(); let canvas = self.canvas.root();
let window = window_from_node(canvas.r()).root(); let window = window_from_node(canvas.r()).root();
let window = window.r(); let window = window.r();
@ -285,7 +283,7 @@ impl CanvasRenderingContext2D {
let (response_chan, response_port) = channel(); let (response_chan, response_port) = channel();
image_cache.request_image(url, ImageCacheChan(response_chan), None); image_cache.request_image(url, ImageCacheChan(response_chan), None);
let result = response_port.recv().unwrap(); let result = response_port.recv().unwrap();
result.image result.image_response
} }
fn create_drawable_rect(&self, x: f64, y: f64, w: f64, h: f64) -> Option<Rect<f32>> { fn create_drawable_rect(&self, x: f64, y: f64, w: f64, h: f64) -> Option<Rect<f32>> {

View file

@ -61,6 +61,7 @@ use dom::nodelist::NodeList;
use dom::text::Text; use dom::text::Text;
use dom::processinginstruction::ProcessingInstruction; use dom::processinginstruction::ProcessingInstruction;
use dom::range::Range; use dom::range::Range;
use dom::servohtmlparser::ServoHTMLParser;
use dom::treewalker::TreeWalker; use dom::treewalker::TreeWalker;
use dom::uievent::UIEvent; use dom::uievent::UIEvent;
use dom::window::{Window, WindowHelpers, ReflowReason}; use dom::window::{Window, WindowHelpers, ReflowReason};
@ -73,7 +74,7 @@ use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyState, KeyMod
use msg::constellation_msg::{SUPER, ALT, SHIFT, CONTROL}; use msg::constellation_msg::{SUPER, ALT, SHIFT, CONTROL};
use net_traits::CookieSource::NonHTTP; use net_traits::CookieSource::NonHTTP;
use net_traits::ControlMsg::{SetCookiesForUrl, GetCookiesForUrl}; use net_traits::ControlMsg::{SetCookiesForUrl, GetCookiesForUrl};
use net_traits::{Metadata, LoadResponse, PendingAsyncLoad}; use net_traits::{Metadata, PendingAsyncLoad, AsyncResponseTarget};
use script_task::Runnable; use script_task::Runnable;
use script_traits::{MouseButton, UntrustedNodeAddress}; use script_traits::{MouseButton, UntrustedNodeAddress};
use util::opts; use util::opts;
@ -96,7 +97,7 @@ use std::ascii::AsciiExt;
use std::cell::{Cell, Ref, RefMut, RefCell}; use std::cell::{Cell, Ref, RefMut, RefCell};
use std::default::Default; use std::default::Default;
use std::ptr; use std::ptr;
use std::sync::mpsc::{Receiver, channel}; use std::sync::mpsc::channel;
use time; use time;
#[derive(PartialEq)] #[derive(PartialEq)]
@ -145,6 +146,8 @@ pub struct Document {
animation_frame_list: RefCell<HashMap<i32, Box<Fn(f64)>>>, animation_frame_list: RefCell<HashMap<i32, Box<Fn(f64)>>>,
/// Tracks all outstanding loads related to this document. /// Tracks all outstanding loads related to this document.
loader: DOMRefCell<DocumentLoader>, loader: DOMRefCell<DocumentLoader>,
/// The current active HTML parser, to allow resuming after interruptions.
current_parser: MutNullableHeap<JS<ServoHTMLParser>>,
} }
impl DocumentDerived for EventTarget { impl DocumentDerived for EventTarget {
@ -263,9 +266,11 @@ pub trait DocumentHelpers<'a> {
/// http://w3c.github.io/animation-timing/#dfn-invoke-callbacks-algorithm /// http://w3c.github.io/animation-timing/#dfn-invoke-callbacks-algorithm
fn invoke_animation_callbacks(self); fn invoke_animation_callbacks(self);
fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad; fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad;
fn load_async(self, load: LoadType) -> Receiver<LoadResponse>; fn load_async(self, load: LoadType, listener: Box<AsyncResponseTarget + Send>);
fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), String>; fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), String>;
fn finish_load(self, load: LoadType); fn finish_load(self, load: LoadType);
fn set_current_parser(self, script: Option<JSRef<ServoHTMLParser>>);
fn get_current_parser(self) -> Option<Temporary<ServoHTMLParser>>;
} }
impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> { impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
@ -892,9 +897,9 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
loader.prepare_async_load(load) loader.prepare_async_load(load)
} }
fn load_async(self, load: LoadType) -> Receiver<LoadResponse> { fn load_async(self, load: LoadType, listener: Box<AsyncResponseTarget + Send>) {
let mut loader = self.loader.borrow_mut(); let mut loader = self.loader.borrow_mut();
loader.load_async(load) loader.load_async(load, listener)
} }
fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), String> { fn load_sync(self, load: LoadType) -> Result<(Metadata, Vec<u8>), String> {
@ -906,6 +911,14 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
let mut loader = self.loader.borrow_mut(); let mut loader = self.loader.borrow_mut();
loader.finish_load(load); loader.finish_load(load);
} }
fn set_current_parser(self, script: Option<JSRef<ServoHTMLParser>>) {
self.current_parser.set(script.map(JS::from_rooted));
}
fn get_current_parser(self) -> Option<Temporary<ServoHTMLParser>> {
self.current_parser.get().map(Temporary::from_rooted)
}
} }
pub enum MouseEventType { pub enum MouseEventType {
@ -914,6 +927,7 @@ pub enum MouseEventType {
MouseUp, MouseUp,
} }
#[derive(PartialEq)] #[derive(PartialEq)]
pub enum DocumentSource { pub enum DocumentSource {
FromParser, FromParser,
@ -987,6 +1001,7 @@ impl Document {
animation_frame_ident: Cell::new(0), animation_frame_ident: Cell::new(0),
animation_frame_list: RefCell::new(HashMap::new()), animation_frame_list: RefCell::new(HashMap::new()),
loader: DOMRefCell::new(doc_loader), loader: DOMRefCell::new(doc_loader),
current_parser: Default::default(),
} }
} }
@ -1830,6 +1845,9 @@ impl DocumentProgressHandler {
impl Runnable for DocumentProgressHandler { impl Runnable for DocumentProgressHandler {
fn handler(self: Box<DocumentProgressHandler>) { fn handler(self: Box<DocumentProgressHandler>) {
let document = self.addr.to_temporary().root();
let window = document.r().window().root();
if window.r().is_alive() {
match self.task { match self.task {
DocumentProgressTask::DOMContentLoaded => { DocumentProgressTask::DOMContentLoaded => {
self.dispatch_dom_content_loaded(); self.dispatch_dom_content_loaded();
@ -1840,4 +1858,5 @@ impl Runnable for DocumentProgressHandler {
} }
} }
} }
}
} }

View file

@ -15,7 +15,7 @@ use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::document::{Document, DocumentHelpers, IsHTMLDocument}; use dom::document::{Document, DocumentHelpers, IsHTMLDocument};
use dom::document::DocumentSource; use dom::document::DocumentSource;
use dom::window::{Window, WindowHelpers}; use dom::window::{Window, WindowHelpers};
use parse::html::{HTMLInput, parse_html}; use parse::html::{ParseContext, parse_html};
use util::str::DOMString; use util::str::DOMString;
use std::borrow::ToOwned; use std::borrow::ToOwned;
@ -64,7 +64,7 @@ impl<'a> DOMParserMethods for JSRef<'a, DOMParser> {
None, None,
DocumentSource::FromParser, DocumentSource::FromParser,
loader).root(); loader).root();
parse_html(document.r(), HTMLInput::InputString(s), &url, None); parse_html(document.r(), s, &url, ParseContext::Owner(None));
document.r().set_ready_state(DocumentReadyState::Complete); document.r().set_ready_state(DocumentReadyState::Complete);
Ok(Temporary::from_rooted(document.r())) Ok(Temporary::from_rooted(document.r()))
} }

View file

@ -17,7 +17,8 @@ use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementM
use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods; use dom::bindings::codegen::Bindings::NamedNodeMapBinding::NamedNodeMapMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::codegen::InheritTypes::{ElementCast, ElementDerived, EventTargetCast}; use dom::bindings::codegen::InheritTypes::{ElementCast, ElementDerived, EventTargetCast};
use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLInputElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLBodyElementDerived, HTMLFontElementDerived};
use dom::bindings::codegen::InheritTypes::{HTMLIFrameElementDerived, HTMLInputElementCast};
use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLTableElementCast}; use dom::bindings::codegen::InheritTypes::{HTMLInputElementDerived, HTMLTableElementCast};
use dom::bindings::codegen::InheritTypes::{HTMLTableElementDerived, HTMLTableCellElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLTableElementDerived, HTMLTableCellElementDerived};
use dom::bindings::codegen::InheritTypes::{HTMLTableRowElementDerived, HTMLTextAreaElementDerived}; use dom::bindings::codegen::InheritTypes::{HTMLTableRowElementDerived, HTMLTextAreaElementDerived};
@ -45,13 +46,15 @@ use dom::htmlanchorelement::HTMLAnchorElement;
use dom::htmlbodyelement::{HTMLBodyElement, HTMLBodyElementHelpers}; use dom::htmlbodyelement::{HTMLBodyElement, HTMLBodyElementHelpers};
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::htmlelement::HTMLElementTypeId; use dom::htmlelement::HTMLElementTypeId;
use dom::htmlfontelement::{HTMLFontElement, HTMLFontElementHelpers};
use dom::htmliframeelement::{HTMLIFrameElement, RawHTMLIFrameElementHelpers};
use dom::htmlinputelement::{HTMLInputElement, RawLayoutHTMLInputElementHelpers, HTMLInputElementHelpers}; use dom::htmlinputelement::{HTMLInputElement, RawLayoutHTMLInputElementHelpers, HTMLInputElementHelpers};
use dom::htmltableelement::{HTMLTableElement, HTMLTableElementHelpers}; use dom::htmltableelement::{HTMLTableElement, HTMLTableElementHelpers};
use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementHelpers}; use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementHelpers};
use dom::htmltablerowelement::{HTMLTableRowElement, HTMLTableRowElementHelpers}; use dom::htmltablerowelement::{HTMLTableRowElement, HTMLTableRowElementHelpers};
use dom::htmltablesectionelement::{HTMLTableSectionElement, HTMLTableSectionElementHelpers}; use dom::htmltablesectionelement::{HTMLTableSectionElement, HTMLTableSectionElementHelpers};
use dom::htmltextareaelement::{HTMLTextAreaElement, RawLayoutHTMLTextAreaElementHelpers}; use dom::htmltextareaelement::{HTMLTextAreaElement, RawLayoutHTMLTextAreaElementHelpers};
use dom::node::{CLICK_IN_PROGRESS, LayoutNodeHelpers, Node, NodeHelpers, NodeTypeId}; use dom::node::{CLICK_IN_PROGRESS, LayoutNodeHelpers, Node, NodeHelpers, NodeTypeId, SEQUENTIALLY_FOCUSABLE};
use dom::node::{document_from_node, NodeDamage}; use dom::node::{document_from_node, NodeDamage};
use dom::node::{window_from_node}; use dom::node::{window_from_node};
use dom::nodelist::NodeList; use dom::nodelist::NodeList;
@ -62,9 +65,9 @@ use style;
use style::legacy::{UnsignedIntegerAttribute, from_declaration}; use style::legacy::{UnsignedIntegerAttribute, from_declaration};
use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute}; use style::properties::{PropertyDeclarationBlock, PropertyDeclaration, parse_style_attribute};
use style::properties::DeclaredValue::SpecifiedValue; use style::properties::DeclaredValue::SpecifiedValue;
use style::properties::longhands::{self, border_spacing}; use style::properties::longhands::{self, border_spacing, height};
use style::values::CSSFloat; use style::values::CSSFloat;
use style::values::specified::{self, CSSColor}; use style::values::specified::{self, CSSColor, CSSRGBA};
use util::geometry::Au; use util::geometry::Au;
use util::namespace; use util::namespace;
use util::smallvec::VecLike; use util::smallvec::VecLike;
@ -179,7 +182,8 @@ pub trait RawLayoutElementHelpers {
#[inline] #[inline]
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_attr_for_layout(elem: &Element, namespace: &Namespace, name: &Atom) -> Option<LayoutJS<Attr>> { pub unsafe fn get_attr_for_layout<'a>(elem: &'a Element, namespace: &Namespace, name: &Atom)
-> Option<LayoutJS<Attr>> {
// cast to point to T in RefCell<T> directly // cast to point to T in RefCell<T> directly
let attrs = elem.attrs.borrow_for_layout(); let attrs = elem.attrs.borrow_for_layout();
attrs.iter().find(|attr: & &JS<Attr>| { attrs.iter().find(|attr: & &JS<Attr>| {
@ -269,6 +273,20 @@ impl RawLayoutElementHelpers for Element {
CSSColor { parsed: Color::RGBA(color), authored: None })))); CSSColor { parsed: Color::RGBA(color), authored: None }))));
} }
let color = if self.is_htmlfontelement() {
let this: &HTMLFontElement = mem::transmute(self);
this.get_color()
} else {
None
};
if let Some(color) = color {
hints.push(from_declaration(
PropertyDeclaration::Color(SpecifiedValue(CSSRGBA {
parsed: color,
authored: None,
}))));
}
let cellspacing = if self.is_htmltableelement() { let cellspacing = if self.is_htmltableelement() {
let this: &HTMLTableElement = mem::transmute(self); let this: &HTMLTableElement = mem::transmute(self);
@ -315,7 +333,10 @@ impl RawLayoutElementHelpers for Element {
} }
let width = if self.is_htmltableelement() { let width = if self.is_htmliframeelement() {
let this: &HTMLIFrameElement = mem::transmute(self);
this.get_width()
} else if self.is_htmltableelement() {
let this: &HTMLTableElement = mem::transmute(self); let this: &HTMLTableElement = mem::transmute(self);
this.get_width() this.get_width()
} else if self.is_htmltabledatacellelement() { } else if self.is_htmltabledatacellelement() {
@ -333,13 +354,37 @@ impl RawLayoutElementHelpers for Element {
PropertyDeclaration::Width(SpecifiedValue(width_value)))); PropertyDeclaration::Width(SpecifiedValue(width_value))));
} }
LengthOrPercentageOrAuto::Length(length) => { LengthOrPercentageOrAuto::Length(length) => {
let width_value = specified::LengthOrPercentageOrAuto::Length(specified::Length::Absolute(length)); let width_value = specified::LengthOrPercentageOrAuto::Length(
specified::Length::Absolute(length));
hints.push(from_declaration( hints.push(from_declaration(
PropertyDeclaration::Width(SpecifiedValue(width_value)))); PropertyDeclaration::Width(SpecifiedValue(width_value))));
} }
} }
let height = if self.is_htmliframeelement() {
let this: &HTMLIFrameElement = mem::transmute(self);
this.get_height()
} else {
LengthOrPercentageOrAuto::Auto
};
match height {
LengthOrPercentageOrAuto::Auto => {}
LengthOrPercentageOrAuto::Percentage(percentage) => {
let width_value = specified::LengthOrPercentageOrAuto::Percentage(percentage);
hints.push(from_declaration(PropertyDeclaration::Height(SpecifiedValue(
height::SpecifiedValue(width_value)))));
}
LengthOrPercentageOrAuto::Length(length) => {
let width_value = specified::LengthOrPercentageOrAuto::Length(
specified::Length::Absolute(length));
hints.push(from_declaration(PropertyDeclaration::Height(SpecifiedValue(
height::SpecifiedValue(width_value)))));
}
}
let cols = if self.is_htmltextareaelement() { let cols = if self.is_htmltextareaelement() {
let this: &HTMLTextAreaElement = mem::transmute(self); let this: &HTMLTextAreaElement = mem::transmute(self);
match this.get_cols_for_layout() { match this.get_cols_for_layout() {
@ -712,9 +757,11 @@ impl<'a> FocusElementHelpers for JSRef<'a, Element> {
return false; return false;
} }
// TODO: Check whether the element is being rendered (i.e. not hidden). // TODO: Check whether the element is being rendered (i.e. not hidden).
// TODO: Check the tabindex focus flag.
// https://html.spec.whatwg.org/multipage/#specially-focusable
let node: JSRef<Node> = NodeCast::from_ref(self); let node: JSRef<Node> = NodeCast::from_ref(self);
if node.get_flag(SEQUENTIALLY_FOCUSABLE) {
return true;
}
// https://html.spec.whatwg.org/multipage/#specially-focusable
match node.type_id() { match node.type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) | NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) | NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) |
@ -934,6 +981,9 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
self.attrs.borrow_mut().remove(idx); self.attrs.borrow_mut().remove(idx);
attr.r().set_owner(None); attr.r().set_owner(None);
if attr.r().namespace() == &ns!("") {
vtable_for(&NodeCast::from_ref(self)).after_remove_attr(attr.r().name());
}
let node: JSRef<Node> = NodeCast::from_ref(self); let node: JSRef<Node> = NodeCast::from_ref(self);
if node.is_in_doc() { if node.is_in_doc() {

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas::canvas_msg::CanvasMsg; use canvas_traits::CanvasMsg;
use dom::attr::Attr; use dom::attr::Attr;
use dom::attr::AttrHelpers; use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding;

View file

@ -4,6 +4,7 @@
use dom::attr::Attr; use dom::attr::Attr;
use dom::attr::AttrHelpers; use dom::attr::AttrHelpers;
use dom::attr::AttrValue;
use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::Bindings::HTMLElementBinding; use dom::bindings::codegen::Bindings::HTMLElementBinding;
use dom::bindings::codegen::Bindings::HTMLElementBinding::HTMLElementMethods; use dom::bindings::codegen::Bindings::HTMLElementBinding::HTMLElementMethods;
@ -24,7 +25,7 @@ use dom::eventtarget::{EventTarget, EventTargetHelpers, EventTargetTypeId};
use dom::htmlinputelement::HTMLInputElement; use dom::htmlinputelement::HTMLInputElement;
use dom::htmlmediaelement::HTMLMediaElementTypeId; use dom::htmlmediaelement::HTMLMediaElementTypeId;
use dom::htmltablecellelement::HTMLTableCellElementTypeId; use dom::htmltablecellelement::HTMLTableCellElementTypeId;
use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node}; use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node, SEQUENTIALLY_FOCUSABLE};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use dom::window::WindowHelpers; use dom::window::WindowHelpers;
@ -70,6 +71,7 @@ impl HTMLElement {
trait PrivateHTMLElementHelpers { trait PrivateHTMLElementHelpers {
fn is_body_or_frameset(self) -> bool; fn is_body_or_frameset(self) -> bool;
fn update_sequentially_focusable_status(self);
} }
impl<'a> PrivateHTMLElementHelpers for JSRef<'a, HTMLElement> { impl<'a> PrivateHTMLElementHelpers for JSRef<'a, HTMLElement> {
@ -77,6 +79,44 @@ impl<'a> PrivateHTMLElementHelpers for JSRef<'a, HTMLElement> {
let eventtarget: JSRef<EventTarget> = EventTargetCast::from_ref(self); let eventtarget: JSRef<EventTarget> = EventTargetCast::from_ref(self);
eventtarget.is_htmlbodyelement() || eventtarget.is_htmlframesetelement() eventtarget.is_htmlbodyelement() || eventtarget.is_htmlframesetelement()
} }
fn update_sequentially_focusable_status(self) {
let element = ElementCast::from_ref(self);
let node = NodeCast::from_ref(self);
if element.has_attribute(&atom!("tabindex")) {
node.set_flag(SEQUENTIALLY_FOCUSABLE, true);
} else {
match node.type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLIFrameElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement))
=> node.set_flag(SEQUENTIALLY_FOCUSABLE, true),
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLLinkElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLAnchorElement)) => {
if element.has_attribute(&atom!("href")) {
node.set_flag(SEQUENTIALLY_FOCUSABLE, true);
}
},
_ => {
if let Some(attr) = element.get_attribute(&ns!(""), &atom!("draggable")) {
let attr = attr.root();
let attr = attr.r();
let value = attr.value();
let is_true = match *value {
AttrValue::String(ref string) => string == "true",
_ => false,
};
node.set_flag(SEQUENTIALLY_FOCUSABLE, is_true);
} else {
node.set_flag(SEQUENTIALLY_FOCUSABLE, false);
}
//TODO set SEQUENTIALLY_FOCUSABLE flag if editing host
//TODO set SEQUENTIALLY_FOCUSABLE flag if "sorting interface th elements"
},
}
}
}
} }
impl<'a> HTMLElementMethods for JSRef<'a, HTMLElement> { impl<'a> HTMLElementMethods for JSRef<'a, HTMLElement> {
@ -220,6 +260,19 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLElement> {
Some(element as &VirtualMethods) Some(element as &VirtualMethods)
} }
fn before_remove_attr(&self, attr: JSRef<Attr>) {
if let Some(ref s) = self.super_type() {
s.before_remove_attr(attr);
}
}
fn after_remove_attr(&self, name: &Atom) {
if let Some(ref s) = self.super_type() {
s.after_remove_attr(name);
}
self.update_sequentially_focusable_status();
}
fn after_set_attr(&self, attr: JSRef<Attr>) { fn after_set_attr(&self, attr: JSRef<Attr>) {
if let Some(ref s) = self.super_type() { if let Some(ref s) = self.super_type() {
s.after_set_attr(attr); s.after_set_attr(attr);
@ -236,6 +289,13 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLElement> {
&name[2..], &name[2..],
(**attr.value()).to_owned()); (**attr.value()).to_owned());
} }
self.update_sequentially_focusable_status();
}
fn bind_to_tree(&self, tree_in_doc: bool) {
if let Some(ref s) = self.super_type() {
s.bind_to_tree(tree_in_doc);
}
self.update_sequentially_focusable_status();
} }
} }

View file

@ -2,19 +2,26 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::{Attr, AttrHelpers};
use dom::bindings::codegen::Bindings::HTMLFontElementBinding; use dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLFontElementDerived; use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMethods;
use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLFontElementDerived};
use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::eventtarget::{EventTarget, EventTargetTypeId};
use dom::element::ElementTypeId; use dom::element::ElementTypeId;
use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::node::{Node, NodeTypeId}; use dom::node::{Node, NodeTypeId};
use util::str::DOMString; use dom::virtualmethods::VirtualMethods;
use util::str::{self, DOMString};
use cssparser::RGBA;
use std::cell::Cell;
#[dom_struct] #[dom_struct]
pub struct HTMLFontElement { pub struct HTMLFontElement {
htmlelement: HTMLElement htmlelement: HTMLElement,
color: Cell<Option<RGBA>>,
} }
impl HTMLFontElementDerived for EventTarget { impl HTMLFontElementDerived for EventTarget {
@ -26,7 +33,8 @@ impl HTMLFontElementDerived for EventTarget {
impl HTMLFontElement { impl HTMLFontElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLFontElement { fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLFontElement {
HTMLFontElement { HTMLFontElement {
htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLFontElement, localName, prefix, document) htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLFontElement, localName, prefix, document),
color: Cell::new(None),
} }
} }
@ -37,3 +45,49 @@ impl HTMLFontElement {
} }
} }
impl<'a> HTMLFontElementMethods for JSRef<'a, HTMLFontElement> {
make_getter!(Color, "color");
make_setter!(SetColor, "color");
}
impl<'a> VirtualMethods for JSRef<'a,HTMLFontElement> {
fn super_type<'b>(&'b self) -> Option<&'b VirtualMethods> {
let htmlelement: &JSRef<HTMLElement> = HTMLElementCast::from_borrowed_ref(self);
Some(htmlelement as &VirtualMethods)
}
fn after_set_attr(&self, attr: JSRef<Attr>) {
if let Some(ref s) = self.super_type() {
s.after_set_attr(attr);
}
match attr.local_name() {
&atom!("color") => {
self.color.set(str::parse_legacy_color(&attr.value()).ok())
}
_ => {}
}
}
fn before_remove_attr(&self, attr: JSRef<Attr>) {
if let Some(ref s) = self.super_type() {
s.before_remove_attr(attr);
}
match attr.local_name() {
&atom!("color") => self.color.set(None),
_ => ()
}
}
}
pub trait HTMLFontElementHelpers {
fn get_color(&self) -> Option<RGBA>;
}
impl HTMLFontElementHelpers for HTMLFontElement {
fn get_color(&self) -> Option<RGBA> {
self.color.get()
}
}

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr; use dom::attr::{Attr, AttrHelpers, AttrHelpersForLayout, AttrValue};
use dom::attr::AttrValue;
use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding;
use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
@ -17,8 +15,7 @@ use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JSRef, OptionalRootable, Rootable, Temporary}; use dom::bindings::js::{JSRef, OptionalRootable, Rootable, Temporary};
use dom::customevent::CustomEvent; use dom::customevent::CustomEvent;
use dom::document::Document; use dom::document::Document;
use dom::element::Element; use dom::element::{self, AttributeHandlers, Element};
use dom::element::AttributeHandlers;
use dom::event::{Event, EventHelpers}; use dom::event::{Event, EventHelpers};
use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::eventtarget::{EventTarget, EventTargetTypeId};
use dom::element::ElementTypeId; use dom::element::ElementTypeId;
@ -40,6 +37,7 @@ use std::ascii::AsciiExt;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cell::Cell; use std::cell::Cell;
use url::{Url, UrlParser}; use url::{Url, UrlParser};
use util::str::{self, LengthOrPercentageOrAuto};
enum SandboxAllowance { enum SandboxAllowance {
AllowNothing = 0x00, AllowNothing = 0x00,
@ -76,6 +74,11 @@ pub trait HTMLIFrameElementHelpers {
fn update_subpage_id(self, new_subpage_id: SubpageId); fn update_subpage_id(self, new_subpage_id: SubpageId);
} }
pub trait RawHTMLIFrameElementHelpers {
fn get_width(&self) -> LengthOrPercentageOrAuto;
fn get_height(&self) -> LengthOrPercentageOrAuto;
}
impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> { impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
fn is_sandboxed(self) -> bool { fn is_sandboxed(self) -> bool {
self.sandbox.get().is_some() self.sandbox.get().is_some()
@ -163,6 +166,30 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
} }
} }
impl RawHTMLIFrameElementHelpers for HTMLIFrameElement {
#[allow(unsafe_code)]
fn get_width(&self) -> LengthOrPercentageOrAuto {
unsafe {
element::get_attr_for_layout(ElementCast::from_actual(&*self),
&ns!(""),
&atom!("width")).map(|attribute| {
str::parse_length(&**(*attribute.unsafe_get()).value())
}).unwrap_or(LengthOrPercentageOrAuto::Auto)
}
}
#[allow(unsafe_code)]
fn get_height(&self) -> LengthOrPercentageOrAuto {
unsafe {
element::get_attr_for_layout(ElementCast::from_actual(&*self),
&ns!(""),
&atom!("height")).map(|attribute| {
str::parse_length(&**(*attribute.unsafe_get()).value())
}).unwrap_or(LengthOrPercentageOrAuto::Auto)
}
}
}
impl HTMLIFrameElement { impl HTMLIFrameElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLIFrameElement { fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLIFrameElement {
HTMLIFrameElement { HTMLIFrameElement {
@ -317,6 +344,14 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
fn Stop(self) -> Fallible<()> { fn Stop(self) -> Fallible<()> {
Err(NotSupported) Err(NotSupported)
} }
make_getter!(Width);
make_setter!(SetWidth, "width");
make_getter!(Height);
make_setter!(SetHeight, "height");
} }
impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> { impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> {
@ -347,7 +382,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLIFrameElement> {
} }
} }
self.sandbox.set(Some(modes)); self.sandbox.set(Some(modes));
}, }
&atom!("src") => { &atom!("src") => {
let node: JSRef<Node> = NodeCast::from_ref(*self); let node: JSRef<Node> = NodeCast::from_ref(*self);
if node.is_in_doc() { if node.is_in_doc() {

View file

@ -25,7 +25,7 @@ use util::str::DOMString;
use string_cache::Atom; use string_cache::Atom;
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_task::ImageResponder; use net_traits::image_cache_task::{ImageResponder, ImageResponse};
use url::{Url, UrlParser}; use url::{Url, UrlParser};
use std::borrow::ToOwned; use std::borrow::ToOwned;
@ -74,11 +74,16 @@ impl Responder {
} }
impl ImageResponder for Responder { impl ImageResponder for Responder {
fn respond(&self, image: Option<Arc<Image>>) { fn respond(&self, image: ImageResponse) {
// Update the image field // Update the image field
let element = self.element.to_temporary().root(); let element = self.element.to_temporary().root();
let element_ref = element.r(); let element_ref = element.r();
*element_ref.image.borrow_mut() = image; *element_ref.image.borrow_mut() = match image {
ImageResponse::Loaded(image) | ImageResponse::PlaceholderLoaded(image) => {
Some(image)
}
ImageResponse::None => None,
};
// Mark the node dirty // Mark the node dirty
let node = NodeCast::from_ref(element.r()); let node = NodeCast::from_ref(element.r());

View file

@ -413,6 +413,8 @@ impl<'a> HTMLInputElementHelpers for JSRef<'a, HTMLInputElement> {
.as_ref() .as_ref()
.map(|group| &**group)); .map(|group| &**group));
} }
self.force_relayout();
//TODO: dispatch change event //TODO: dispatch change event
} }

View file

@ -28,17 +28,21 @@ use dom::event::{Event, EventBubbles, EventCancelable, EventHelpers};
use dom::element::ElementTypeId; use dom::element::ElementTypeId;
use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node, CloneChildrenFlag}; use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node, CloneChildrenFlag};
use dom::servohtmlparser::ServoHTMLParserHelpers;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use dom::window::{WindowHelpers, ScriptHelpers}; use dom::window::{WindowHelpers, ScriptHelpers};
use script_task::{ScriptMsg, Runnable}; use network_listener::{NetworkListener, PreInvoke};
use script_task::{ScriptChan, ScriptMsg, Runnable};
use encoding::all::UTF_8; use encoding::all::UTF_8;
use encoding::label::encoding_from_whatwg_label; use encoding::label::encoding_from_whatwg_label;
use encoding::types::{Encoding, EncodingRef, DecoderTrap}; use encoding::types::{Encoding, EncodingRef, DecoderTrap};
use net_traits::Metadata; use net_traits::{Metadata, AsyncResponseListener};
use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec}; use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
use std::borrow::ToOwned; use html5ever::tree_builder::NextParserState;
use std::cell::Cell; use std::cell::{RefCell, Cell};
use std::mem;
use std::sync::{Arc, Mutex};
use string_cache::Atom; use string_cache::Atom;
use url::{Url, UrlParser}; use url::{Url, UrlParser};
@ -99,7 +103,7 @@ impl HTMLScriptElement {
pub trait HTMLScriptElementHelpers { pub trait HTMLScriptElementHelpers {
/// Prepare a script (<https://www.whatwg.org/html/#prepare-a-script>) /// Prepare a script (<https://www.whatwg.org/html/#prepare-a-script>)
fn prepare(self); fn prepare(self) -> NextParserState;
/// [Execute a script block] /// [Execute a script block]
/// (https://html.spec.whatwg.org/multipage/#execute-the-script-block) /// (https://html.spec.whatwg.org/multipage/#execute-the-script-block)
@ -153,12 +157,57 @@ pub enum ScriptOrigin {
External(Result<(Metadata, Vec<u8>), String>), External(Result<(Metadata, Vec<u8>), String>),
} }
/// The context required for asynchronously loading an external script source.
struct ScriptContext {
/// The element that initiated the request.
elem: Trusted<HTMLScriptElement>,
/// The response body received to date.
data: RefCell<Vec<u8>>,
/// The response metadata received to date.
metadata: RefCell<Option<Metadata>>,
/// Whether the owning document's parser should resume once the response completes.
resume_on_completion: bool,
/// The initial URL requested.
url: Url,
}
impl AsyncResponseListener for ScriptContext {
fn headers_available(&self, metadata: Metadata) {
*self.metadata.borrow_mut() = Some(metadata);
}
fn data_available(&self, payload: Vec<u8>) {
let mut payload = payload;
self.data.borrow_mut().append(&mut payload);
}
fn response_complete(&self, status: Result<(), String>) {
let load = status.map(|_| {
let data = mem::replace(&mut *self.data.borrow_mut(), vec!());
let metadata = self.metadata.borrow_mut().take().unwrap();
(metadata, data)
});
let elem = self.elem.to_temporary().root();
elem.r().execute(ScriptOrigin::External(load));
let document = document_from_node(elem.r()).root();
document.r().finish_load(LoadType::Script(self.url.clone()));
if self.resume_on_completion {
document.r().get_current_parser().unwrap().root().r().resume();
}
}
}
impl PreInvoke for ScriptContext {}
impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> { impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
fn prepare(self) { fn prepare(self) -> NextParserState {
// https://html.spec.whatwg.org/multipage/#prepare-a-script // https://html.spec.whatwg.org/multipage/#prepare-a-script
// Step 1. // Step 1.
if self.already_started.get() { if self.already_started.get() {
return; return NextParserState::Continue;
} }
// Step 2. // Step 2.
let was_parser_inserted = self.parser_inserted.get(); let was_parser_inserted = self.parser_inserted.get();
@ -172,16 +221,16 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// Step 4. // Step 4.
let text = self.Text(); let text = self.Text();
if text.len() == 0 && !element.has_attribute(&atom!("src")) { if text.len() == 0 && !element.has_attribute(&atom!("src")) {
return; return NextParserState::Continue;
} }
// Step 5. // Step 5.
let node: JSRef<Node> = NodeCast::from_ref(self); let node: JSRef<Node> = NodeCast::from_ref(self);
if !node.is_in_doc() { if !node.is_in_doc() {
return; return NextParserState::Continue;
} }
// Step 6, 7. // Step 6, 7.
if !self.is_javascript() { if !self.is_javascript() {
return; return NextParserState::Continue;
} }
// Step 8. // Step 8.
if was_parser_inserted { if was_parser_inserted {
@ -195,12 +244,12 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
let document_from_node_ref = document_from_node(self).root(); let document_from_node_ref = document_from_node(self).root();
let document_from_node_ref = document_from_node_ref.r(); let document_from_node_ref = document_from_node_ref.r();
if self.parser_inserted.get() && self.parser_document.root().r() != document_from_node_ref { if self.parser_inserted.get() && self.parser_document.root().r() != document_from_node_ref {
return; return NextParserState::Continue;
} }
// Step 11. // Step 11.
if !document_from_node_ref.is_scripting_enabled() { if !document_from_node_ref.is_scripting_enabled() {
return; return NextParserState::Continue;
} }
// Step 12. // Step 12.
@ -212,13 +261,13 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
.to_ascii_lowercase(); .to_ascii_lowercase();
let for_value = for_value.trim_matches(HTML_SPACE_CHARACTERS); let for_value = for_value.trim_matches(HTML_SPACE_CHARACTERS);
if for_value != "window" { if for_value != "window" {
return; return NextParserState::Continue;
} }
let event_value = event_attribute.Value().to_ascii_lowercase(); let event_value = event_attribute.Value().to_ascii_lowercase();
let event_value = event_value.trim_matches(HTML_SPACE_CHARACTERS); let event_value = event_value.trim_matches(HTML_SPACE_CHARACTERS);
if event_value != "onload" && event_value != "onload()" { if event_value != "onload" && event_value != "onload()" {
return; return NextParserState::Continue;
} }
}, },
(_, _) => (), (_, _) => (),
@ -245,7 +294,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// Step 14.2 // Step 14.2
if src.is_empty() { if src.is_empty() {
self.queue_error_event(); self.queue_error_event();
return; return NextParserState::Continue;
} }
// Step 14.3 // Step 14.3
@ -254,7 +303,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// Step 14.4 // Step 14.4
error!("error parsing URL for script {}", src); error!("error parsing URL for script {}", src);
self.queue_error_event(); self.queue_error_event();
return; return NextParserState::Continue;
} }
Ok(url) => { Ok(url) => {
// Step 14.5 // Step 14.5
@ -263,8 +312,29 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// the origin of the script element's node document, and the default origin // the origin of the script element's node document, and the default origin
// behaviour set to taint. // behaviour set to taint.
let doc = document_from_node(self).root(); let doc = document_from_node(self).root();
let contents = doc.r().load_sync(LoadType::Script(url));
ScriptOrigin::External(contents) let script_chan = window.script_chan();
let elem = Trusted::new(window.get_cx(), self, script_chan.clone());
let context = Arc::new(Mutex::new(ScriptContext {
elem: elem,
data: RefCell::new(vec!()),
metadata: RefCell::new(None),
resume_on_completion: self.parser_inserted.get(),
url: url.clone(),
}));
let listener = box NetworkListener {
context: context,
script_chan: script_chan,
};
doc.r().load_async(LoadType::Script(url), listener);
if self.parser_inserted.get() {
doc.r().get_current_parser().unwrap().root().r().suspend();
}
return NextParserState::Suspend;
} }
} }
}, },
@ -275,6 +345,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// TODO: Add support for the `defer` and `async` attributes. (For now, we fetch all // TODO: Add support for the `defer` and `async` attributes. (For now, we fetch all
// scripts synchronously and execute them immediately.) // scripts synchronously and execute them immediately.)
self.execute(load); self.execute(load);
NextParserState::Continue
} }
fn execute(self, load: ScriptOrigin) { fn execute(self, load: ScriptOrigin) {

View file

@ -158,6 +158,9 @@ bitflags! {
const CLICK_IN_PROGRESS = 0x100, const CLICK_IN_PROGRESS = 0x100,
#[doc = "Specifies whether this node has the focus."] #[doc = "Specifies whether this node has the focus."]
const IN_FOCUS_STATE = 0x200, const IN_FOCUS_STATE = 0x200,
#[doc = "Specifies whether this node is focusable and whether it is supposed \
to be reachable with using sequential focus navigation."]
const SEQUENTIALLY_FOCUSABLE = 0x400,
} }
} }
@ -245,7 +248,7 @@ impl LayoutDataRef {
#[inline] #[inline]
#[allow(unsafe_code)] #[allow(unsafe_code)]
pub unsafe fn borrow_unchecked(&self) -> *const Option<LayoutData> { pub unsafe fn borrow_unchecked(&self) -> *const Option<LayoutData> {
mem::transmute(&self.data_cell) self.data_cell.as_unsafe_cell().get() as *const _
} }
/// Borrows the layout data immutably. This function is *not* thread-safe. /// Borrows the layout data immutably. This function is *not* thread-safe.
@ -629,7 +632,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
fn set_hover_state(self, state: bool) { fn set_hover_state(self, state: bool) {
self.set_flag(IN_HOVER_STATE, state); self.set_flag(IN_HOVER_STATE, state);
self.dirty(NodeDamage::OtherNodeDamage); self.dirty(NodeDamage::NodeStyleDamaged);
} }
fn get_focus_state(self) -> bool { fn get_focus_state(self) -> bool {
@ -638,7 +641,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
fn set_focus_state(self, state: bool) { fn set_focus_state(self, state: bool) {
self.set_flag(IN_FOCUS_STATE, state); self.set_flag(IN_FOCUS_STATE, state);
self.dirty(NodeDamage::OtherNodeDamage); self.dirty(NodeDamage::NodeStyleDamaged);
} }
fn get_disabled_state(self) -> bool { fn get_disabled_state(self) -> bool {

View file

@ -5,24 +5,35 @@
//! The bulk of the HTML parser integration is in `script::parse::html`. //! The bulk of the HTML parser integration is in `script::parse::html`.
//! This module is mostly about its interaction with DOM memory management. //! This module is mostly about its interaction with DOM memory management.
use document_loader::LoadType;
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::ServoHTMLParserBinding; use dom::bindings::codegen::Bindings::ServoHTMLParserBinding;
use dom::bindings::global::GlobalRef; use dom::bindings::global::GlobalRef;
use dom::bindings::trace::JSTraceable; use dom::bindings::trace::JSTraceable;
use dom::bindings::js::{JS, JSRef, Rootable, Temporary}; use dom::bindings::js::{JS, JSRef, Rootable, Temporary};
use dom::bindings::refcounted::Trusted;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::document::{Document, DocumentHelpers}; use dom::document::{Document, DocumentHelpers};
use dom::node::Node; use dom::node::{window_from_node, Node};
use dom::window::Window;
use network_listener::PreInvoke;
use parse::Parser; use parse::Parser;
use script_task::{ScriptTask, ScriptChan};
use util::task_state; use msg::constellation_msg::{PipelineId, SubpageId};
use net_traits::{Metadata, AsyncResponseListener};
use encoding::all::UTF_8;
use encoding::types::{Encoding, DecoderTrap};
use std::cell::{Cell, RefCell};
use std::default::Default; use std::default::Default;
use url::Url; use url::Url;
use js::jsapi::JSTracer; use js::jsapi::JSTracer;
use html5ever::tokenizer; use html5ever::tokenizer;
use html5ever::tree_builder; use html5ever::tree_builder;
use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts}; use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts};
use hyper::header::ContentType;
use hyper::mime::{Mime, TopLevel, SubLevel};
#[must_root] #[must_root]
#[jstraceable] #[jstraceable]
@ -41,6 +52,110 @@ pub struct FragmentContext<'a> {
pub type Tokenizer = tokenizer::Tokenizer<TreeBuilder<JS<Node>, Sink>>; pub type Tokenizer = tokenizer::Tokenizer<TreeBuilder<JS<Node>, Sink>>;
/// The context required for asynchronously fetching a document and parsing it progressively.
pub struct ParserContext {
/// The parser that initiated the request.
parser: RefCell<Option<Trusted<ServoHTMLParser>>>,
/// Is this document a synthesized document for a single image?
is_image_document: Cell<bool>,
/// The pipeline associated with this document.
id: PipelineId,
/// The subpage associated with this document.
subpage: Option<SubpageId>,
/// The target event loop for the response notifications.
script_chan: Box<ScriptChan+Send>,
/// The URL for this document.
url: Url,
}
impl ParserContext {
pub fn new(id: PipelineId, subpage: Option<SubpageId>, script_chan: Box<ScriptChan+Send>,
url: Url) -> ParserContext {
ParserContext {
parser: RefCell::new(None),
is_image_document: Cell::new(false),
id: id,
subpage: subpage,
script_chan: script_chan,
url: url,
}
}
}
impl AsyncResponseListener for ParserContext {
fn headers_available(&self, metadata: Metadata) {
let content_type = metadata.content_type.clone();
let parser = ScriptTask::page_fetch_complete(self.id.clone(), self.subpage.clone(),
metadata);
let parser = match parser {
Some(parser) => parser,
None => return,
}.root();
let parser = parser.r();
let win = parser.window().root();
*self.parser.borrow_mut() = Some(Trusted::new(win.r().get_cx(), parser,
self.script_chan.clone()));
match content_type {
Some(ContentType(Mime(TopLevel::Image, _, _))) => {
self.is_image_document.set(true);
let page = format!("<html><body><img src='{}' /></body></html>",
self.url.serialize());
parser.pending_input.borrow_mut().push(page);
parser.parse_sync();
}
Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => {
// FIXME: When servo/html5ever#109 is fixed remove <plaintext> usage and
// replace with fix from that issue.
// text/plain documents require setting the tokenizer into PLAINTEXT mode.
// This is done by using a <plaintext> element as the html5ever tokenizer
// provides no other way to change to that state.
// Spec for text/plain handling is:
// https://html.spec.whatwg.org/multipage/#read-text
let page = format!("<pre>\u{000A}<plaintext>");
parser.pending_input.borrow_mut().push(page);
parser.parse_sync();
},
_ => {}
}
}
fn data_available(&self, payload: Vec<u8>) {
if !self.is_image_document.get() {
// FIXME: use Vec<u8> (html5ever #34)
let data = UTF_8.decode(&payload, DecoderTrap::Replace).unwrap();
let parser = match self.parser.borrow().as_ref() {
Some(parser) => parser.to_temporary(),
None => return,
}.root();
parser.r().parse_chunk(data);
}
}
fn response_complete(&self, status: Result<(), String>) {
let parser = match self.parser.borrow().as_ref() {
Some(parser) => parser.to_temporary(),
None => return,
}.root();
let doc = parser.r().document.root();
doc.r().finish_load(LoadType::PageSource(self.url.clone()));
if let Err(err) = status {
debug!("Failed to load page URL {}, error: {}", self.url.serialize(), err);
// TODO(Savago): we should send a notification to callers #5463.
}
parser.r().last_chunk_received.set(true);
parser.r().parse_sync();
}
}
impl PreInvoke for ParserContext {
}
// NB: JSTraceable is *not* auto-derived. // NB: JSTraceable is *not* auto-derived.
// You must edit the impl below if you add fields! // You must edit the impl below if you add fields!
#[must_root] #[must_root]
@ -48,20 +163,46 @@ pub type Tokenizer = tokenizer::Tokenizer<TreeBuilder<JS<Node>, Sink>>;
pub struct ServoHTMLParser { pub struct ServoHTMLParser {
reflector_: Reflector, reflector_: Reflector,
tokenizer: DOMRefCell<Tokenizer>, tokenizer: DOMRefCell<Tokenizer>,
/// Input chunks received but not yet passed to the parser.
pending_input: DOMRefCell<Vec<String>>,
/// The document associated with this parser.
document: JS<Document>,
/// True if this parser should avoid passing any further data to the tokenizer.
suspended: Cell<bool>,
/// Whether to expect any further input from the associated network request.
last_chunk_received: Cell<bool>,
/// The pipeline associated with this parse, unavailable if this parse does not
/// correspond to a page load.
pipeline: Option<PipelineId>,
} }
impl Parser for ServoHTMLParser{ impl<'a> Parser for JSRef<'a, ServoHTMLParser> {
fn parse_chunk(&self, input: String) { fn parse_chunk(self, input: String) {
self.tokenizer().borrow_mut().feed(input); self.document.root().r().set_current_parser(Some(self));
self.pending_input.borrow_mut().push(input);
self.parse_sync();
} }
fn finish(&self){
fn finish(self) {
assert!(!self.suspended.get());
assert!(self.pending_input.borrow().is_empty());
self.tokenizer().borrow_mut().end(); self.tokenizer().borrow_mut().end();
debug!("finished parsing");
let document = self.document.root();
document.r().set_current_parser(None);
if let Some(pipeline) = self.pipeline {
ScriptTask::parsing_complete(pipeline);
}
} }
} }
impl ServoHTMLParser { impl ServoHTMLParser {
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(base_url: Option<Url>, document: JSRef<Document>) -> Temporary<ServoHTMLParser> { pub fn new(base_url: Option<Url>, document: JSRef<Document>, pipeline: Option<PipelineId>)
-> Temporary<ServoHTMLParser> {
let window = document.window().root(); let window = document.window().root();
let sink = Sink { let sink = Sink {
base_url: base_url, base_url: base_url,
@ -78,6 +219,11 @@ impl ServoHTMLParser {
let parser = ServoHTMLParser { let parser = ServoHTMLParser {
reflector_: Reflector::new(), reflector_: Reflector::new(),
tokenizer: DOMRefCell::new(tok), tokenizer: DOMRefCell::new(tok),
pending_input: DOMRefCell::new(vec!()),
document: JS::from_rooted(document),
suspended: Cell::new(false),
last_chunk_received: Cell::new(false),
pipeline: pipeline,
}; };
reflect_dom_object(box parser, GlobalRef::Window(window.r()), reflect_dom_object(box parser, GlobalRef::Window(window.r()),
@ -111,6 +257,11 @@ impl ServoHTMLParser {
let parser = ServoHTMLParser { let parser = ServoHTMLParser {
reflector_: Reflector::new(), reflector_: Reflector::new(),
tokenizer: DOMRefCell::new(tok), tokenizer: DOMRefCell::new(tok),
pending_input: DOMRefCell::new(vec!()),
document: JS::from_rooted(document),
suspended: Cell::new(false),
last_chunk_received: Cell::new(true),
pipeline: None,
}; };
reflect_dom_object(box parser, GlobalRef::Window(window.r()), reflect_dom_object(box parser, GlobalRef::Window(window.r()),
@ -129,6 +280,73 @@ impl Reflectable for ServoHTMLParser {
} }
} }
trait PrivateServoHTMLParserHelpers {
/// Synchronously run the tokenizer parse loop until explicitly suspended or
/// the tokenizer runs out of input.
fn parse_sync(self);
/// Retrieve the window object associated with this parser.
fn window(self) -> Temporary<Window>;
}
impl<'a> PrivateServoHTMLParserHelpers for JSRef<'a, ServoHTMLParser> {
fn parse_sync(self) {
let mut first = true;
// This parser will continue to parse while there is either pending input or
// the parser remains unsuspended.
loop {
if self.suspended.get() {
return;
}
if self.pending_input.borrow().is_empty() && !first {
break;
}
let mut pending_input = self.pending_input.borrow_mut();
if !pending_input.is_empty() {
let chunk = pending_input.remove(0);
self.tokenizer.borrow_mut().feed(chunk);
} else {
self.tokenizer.borrow_mut().run();
}
first = false;
}
if self.last_chunk_received.get() {
self.finish();
}
}
fn window(self) -> Temporary<Window> {
let doc = self.document.root();
window_from_node(doc.r())
}
}
pub trait ServoHTMLParserHelpers {
/// Cause the parser to interrupt next time the tokenizer reaches a quiescent state.
/// No further parsing will occur after that point until the `resume` method is called.
/// Panics if the parser is already suspended.
fn suspend(self);
/// Immediately resume a suspended parser. Panics if the parser is not suspended.
fn resume(self);
}
impl<'a> ServoHTMLParserHelpers for JSRef<'a, ServoHTMLParser> {
fn suspend(self) {
assert!(!self.suspended.get());
self.suspended.set(true);
}
fn resume(self) {
assert!(self.suspended.get());
self.suspended.set(false);
self.parse_sync();
}
}
struct Tracer { struct Tracer {
trc: *mut JSTracer, trc: *mut JSTracer,
} }
@ -152,11 +370,6 @@ impl JSTraceable for ServoHTMLParser {
let tracer = &tracer as &tree_builder::Tracer<Handle=JS<Node>>; let tracer = &tracer as &tree_builder::Tracer<Handle=JS<Node>>;
unsafe { unsafe {
// Assertion: If the parser is mutably borrowed, we're in the
// parsing code paths.
debug_assert!(task_state::get().contains(task_state::IN_HTML_PARSER)
|| !self.tokenizer.is_mutably_borrowed());
let tokenizer = self.tokenizer.borrow_for_gc_trace(); let tokenizer = self.tokenizer.borrow_for_gc_trace();
let tree_builder = tokenizer.sink(); let tree_builder = tokenizer.sink();
tree_builder.trace_handles(tracer); tree_builder.trace_handles(tracer);

View file

@ -12,6 +12,7 @@ use dom::bindings::codegen::InheritTypes::HTMLButtonElementCast;
use dom::bindings::codegen::InheritTypes::HTMLCanvasElementCast; use dom::bindings::codegen::InheritTypes::HTMLCanvasElementCast;
use dom::bindings::codegen::InheritTypes::HTMLElementCast; use dom::bindings::codegen::InheritTypes::HTMLElementCast;
use dom::bindings::codegen::InheritTypes::HTMLFieldSetElementCast; use dom::bindings::codegen::InheritTypes::HTMLFieldSetElementCast;
use dom::bindings::codegen::InheritTypes::HTMLFontElementCast;
use dom::bindings::codegen::InheritTypes::HTMLFormElementCast; use dom::bindings::codegen::InheritTypes::HTMLFormElementCast;
use dom::bindings::codegen::InheritTypes::HTMLHeadElementCast; use dom::bindings::codegen::InheritTypes::HTMLHeadElementCast;
use dom::bindings::codegen::InheritTypes::HTMLIFrameElementCast; use dom::bindings::codegen::InheritTypes::HTMLIFrameElementCast;
@ -42,6 +43,8 @@ use dom::htmlbuttonelement::HTMLButtonElement;
use dom::htmlcanvaselement::HTMLCanvasElement; use dom::htmlcanvaselement::HTMLCanvasElement;
use dom::htmlelement::{HTMLElement, HTMLElementTypeId}; use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::htmlfieldsetelement::HTMLFieldSetElement; use dom::htmlfieldsetelement::HTMLFieldSetElement;
use dom::htmlfontelement::HTMLFontElement;
use dom::htmlformelement::HTMLFormElement;
use dom::htmlheadelement::HTMLHeadElement; use dom::htmlheadelement::HTMLHeadElement;
use dom::htmliframeelement::HTMLIFrameElement; use dom::htmliframeelement::HTMLIFrameElement;
use dom::htmlimageelement::HTMLImageElement; use dom::htmlimageelement::HTMLImageElement;
@ -88,6 +91,14 @@ pub trait VirtualMethods {
} }
} }
/// Called when changing or removing attributes, after all modification
/// has taken place.
fn after_remove_attr(&self, name: &Atom) {
if let Some(ref s) = self.super_type() {
s.after_remove_attr(name);
}
}
/// Returns the right AttrValue variant for the attribute with name `name` /// Returns the right AttrValue variant for the attribute with name `name`
/// on this element. /// on this element.
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue { fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
@ -169,8 +180,13 @@ pub fn vtable_for<'a>(node: &'a JSRef<'a, Node>) -> &'a (VirtualMethods + 'a) {
let element: &'a JSRef<'a, HTMLFieldSetElement> = HTMLFieldSetElementCast::to_borrowed_ref(node).unwrap(); let element: &'a JSRef<'a, HTMLFieldSetElement> = HTMLFieldSetElementCast::to_borrowed_ref(node).unwrap();
element as &'a (VirtualMethods + 'a) element as &'a (VirtualMethods + 'a)
} }
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFontElement)) => {
let element: &'a JSRef<'a, HTMLFontElement> = HTMLFontElementCast::to_borrowed_ref(node).unwrap();
element as &'a (VirtualMethods + 'a)
}
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFormElement)) => { NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLFormElement)) => {
HTMLFormElementCast::to_borrowed_ref(node).unwrap() as &'a (VirtualMethods + 'a) let element: &'a JSRef<'a, HTMLFormElement> = HTMLFormElementCast::to_borrowed_ref(node).unwrap();
element as &'a (VirtualMethods + 'a)
} }
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHeadElement)) => { NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLHeadElement)) => {
let element: &'a JSRef<'a, HTMLHeadElement> = HTMLHeadElementCast::to_borrowed_ref(node).unwrap(); let element: &'a JSRef<'a, HTMLHeadElement> = HTMLHeadElementCast::to_borrowed_ref(node).unwrap();

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas::webgl_paint_task::WebGLPaintTask; use canvas::webgl_paint_task::WebGLPaintTask;
use canvas::canvas_msg::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg};
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{ WebGLRenderingContextMethods, WebGLRenderingContextConstants}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{ WebGLRenderingContextMethods, WebGLRenderingContextConstants};
use dom::bindings::global::{GlobalRef, GlobalField}; use dom::bindings::global::{GlobalRef, GlobalField};

View file

@ -5,7 +5,7 @@
// https://www.whatwg.org/html/#htmlfontelement // https://www.whatwg.org/html/#htmlfontelement
interface HTMLFontElement : HTMLElement { interface HTMLFontElement : HTMLElement {
//[TreatNullAs=EmptyString] attribute DOMString color; [TreatNullAs=EmptyString] attribute DOMString color;
// attribute DOMString face; // attribute DOMString face;
// attribute DOMString size; // attribute DOMString size;
}; };

View file

@ -12,8 +12,8 @@ interface HTMLIFrameElement : HTMLElement {
attribute DOMString sandbox; attribute DOMString sandbox;
// attribute boolean seamless; // attribute boolean seamless;
// attribute boolean allowFullscreen; // attribute boolean allowFullscreen;
// attribute DOMString width; attribute DOMString width;
// attribute DOMString height; attribute DOMString height;
readonly attribute Document? contentDocument; readonly attribute Document? contentDocument;
//readonly attribute WindowProxy? contentWindow; //readonly attribute WindowProxy? contentWindow;
readonly attribute Window? contentWindow; readonly attribute Window? contentWindow;

View file

@ -21,13 +21,13 @@ interface WebSocket : EventTarget {
attribute EventHandler onclose; attribute EventHandler onclose;
//readonly attribute DOMString extensions; //readonly attribute DOMString extensions;
//readonly attribute DOMString protocol; //readonly attribute DOMString protocol;
//[Throws] void close([Clamp] optional unsigned short code, optional DOMString reason); //Clamp doesn't work //[Throws] void close([Clamp] optional unsigned short code, optional USVString reason); //Clamp doesn't work
[Throws] void close(optional unsigned short code, optional DOMString reason); //No clamp version - works [Throws] void close(optional unsigned short code, optional USVString reason); //No clamp version - works
//messaging //messaging
//attribute EventHandler onmessage; //attribute EventHandler onmessage;
//attribute BinaryType binaryType; //attribute BinaryType binaryType;
[Throws] void send(optional DOMString data); [Throws] void send(optional USVString data);
//void send(Blob data); //void send(Blob data);
//void send(ArrayBuffer data); //void send(ArrayBuffer data);
//void send(ArrayBufferView data); //void send(ArrayBufferView data);

View file

@ -9,11 +9,11 @@ use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::InheritTypes::EventTargetCast; use dom::bindings::codegen::InheritTypes::EventTargetCast;
use dom::bindings::codegen::InheritTypes::EventCast; use dom::bindings::codegen::InheritTypes::EventCast;
use dom::bindings::error::{Error, Fallible}; use dom::bindings::error::{Error, Fallible};
use dom::bindings::error::Error::InvalidAccess; use dom::bindings::error::Error::{InvalidAccess, Syntax};
use dom::bindings::error::Error::Syntax;
use dom::bindings::global::{GlobalField, GlobalRef}; use dom::bindings::global::{GlobalField, GlobalRef};
use dom::bindings::js::{Temporary, JSRef, Rootable}; use dom::bindings::js::{Temporary, JSRef, Rootable};
use dom::bindings::refcounted::Trusted; use dom::bindings::refcounted::Trusted;
use dom::bindings::str::USVString;
use dom::bindings::trace::JSTraceable; use dom::bindings::trace::JSTraceable;
use dom::bindings::utils::reflect_dom_object; use dom::bindings::utils::reflect_dom_object;
use dom::closeevent::CloseEvent; use dom::closeevent::CloseEvent;
@ -33,7 +33,6 @@ use websocket::stream::WebSocketStream;
use websocket::client::request::Url; use websocket::client::request::Url;
use websocket::Client; use websocket::Client;
#[derive(PartialEq, Copy, Clone)] #[derive(PartialEq, Copy, Clone)]
#[jstraceable] #[jstraceable]
enum WebSocketRequestState { enum WebSocketRequestState {
@ -63,6 +62,45 @@ pub struct WebSocket {
sendCloseFrame: Cell<bool> sendCloseFrame: Cell<bool>
} }
fn parse_web_socket_url(url_str: &str) -> Fallible<(Url, String, u16, String, bool)> {
// https://html.spec.whatwg.org/multipage/#parse-a-websocket-url's-components
// Steps 1 and 2
let parsed_url = Url::parse(url_str);
let parsed_url = match parsed_url {
Ok(parsed_url) => parsed_url,
Err(_) => return Err(Error::Syntax),
};
// Step 4
if parsed_url.fragment != None {
return Err(Error::Syntax);
}
// Steps 3 and 5
let secure = match parsed_url.scheme.as_ref() {
"ws" => false,
"wss" => true,
_ => return Err(Error::Syntax), // step 3
};
let host = parsed_url.host().unwrap().serialize(); // Step 6
let port = parsed_url.port_or_default().unwrap(); // Steps 7 and 8
let mut resource = parsed_url.path().unwrap().connect("/"); // Step 9
if resource.is_empty() {
resource = "/".to_owned(); // Step 10
}
// Step 11
if let Some(ref query) = parsed_url.query {
resource.push('?');
resource.push_str(query);
}
// Step 12
// FIXME remove parsed_url once it's no longer used in WebSocket::new
Ok((parsed_url, host, port, resource, secure))
}
impl WebSocket { impl WebSocket {
pub fn new_inherited(global: GlobalRef, url: DOMString) -> WebSocket { pub fn new_inherited(global: GlobalRef, url: DOMString) -> WebSocket {
WebSocket { WebSocket {
@ -83,11 +121,12 @@ impl WebSocket {
} }
pub fn new(global: GlobalRef, url: DOMString) -> Temporary<WebSocket> { pub fn new(global: GlobalRef, url: DOMString) -> Fallible<Temporary<WebSocket>> {
/*TODO: This constructor is only a prototype, it does not accomplish the specs /*TODO: This constructor is only a prototype, it does not accomplish the specs
defined here: defined here:
http://html.spec.whatwg.org http://html.spec.whatwg.org
All 9 items must be satisfied. Item 1 is already satisfied.
The remaining 8 items must be satisfied.
TODO: This constructor should be responsible for spawning a thread for the TODO: This constructor should be responsible for spawning a thread for the
receive loop after ws_root.r().Open() - See comment receive loop after ws_root.r().Open() - See comment
*/ */
@ -95,7 +134,13 @@ impl WebSocket {
global, global,
WebSocketBinding::Wrap).root(); WebSocketBinding::Wrap).root();
let ws_root = ws_root.r(); let ws_root = ws_root.r();
let parsed_url = Url::parse(&ws_root.url).unwrap();
// FIXME extract the right variables once Client::connect implementation is
// fixed to follow the RFC 6455 properly
let (parsed_url, _, _, _, _) = try!(parse_web_socket_url(&ws_root.url));
// TODO Client::connect does not conform to RFC 6455
// see https://github.com/cyderize/rust-websocket/issues/38
let request = Client::connect(parsed_url).unwrap(); let request = Client::connect(parsed_url).unwrap();
let response = request.send().unwrap(); let response = request.send().unwrap();
response.validate().unwrap(); response.validate().unwrap();
@ -106,8 +151,9 @@ impl WebSocket {
let failed = ws_root.failed.get(); let failed = ws_root.failed.get();
if failed && (ready_state == WebSocketRequestState::Closed || ready_state == WebSocketRequestState::Closing) { if failed && (ready_state == WebSocketRequestState::Closed || ready_state == WebSocketRequestState::Closing) {
//Do nothing else. Let the close finish. //Do nothing else. Let the close finish.
return Temporary::from_rooted(ws_root); return Ok(Temporary::from_rooted(ws_root));
} }
let (temp_sender, temp_receiver) = response.begin().split(); let (temp_sender, temp_receiver) = response.begin().split();
let mut other_sender = ws_root.sender.borrow_mut(); let mut other_sender = ws_root.sender.borrow_mut();
let mut other_receiver = ws_root.receiver.borrow_mut(); let mut other_receiver = ws_root.receiver.borrow_mut();
@ -132,11 +178,11 @@ impl WebSocket {
it confirms the websocket is now closed. This requires the close event it confirms the websocket is now closed. This requires the close event
to be fired (dispatch_close fires the close event - see implementation below) to be fired (dispatch_close fires the close event - see implementation below)
*/ */
Temporary::from_rooted(ws_root) Ok(Temporary::from_rooted(ws_root))
} }
pub fn Constructor(global: GlobalRef, url: DOMString) -> Fallible<Temporary<WebSocket>> { pub fn Constructor(global: GlobalRef, url: DOMString) -> Fallible<Temporary<WebSocket>> {
Ok(WebSocket::new(global, url)) WebSocket::new(global, url)
} }
} }
@ -153,7 +199,7 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
self.ready_state.get() as u16 self.ready_state.get() as u16
} }
fn Send(self, data: Option<DOMString>)-> Fallible<()>{ fn Send(self, data: Option<USVString>)-> Fallible<()>{
/*TODO: This is not up to spec see http://html.spec.whatwg.org/multipage/comms.html search for "If argument is a string" /*TODO: This is not up to spec see http://html.spec.whatwg.org/multipage/comms.html search for "If argument is a string"
TODO: Need to buffer data TODO: Need to buffer data
TODO: bufferedAmount attribute returns the size of the buffer in bytes - TODO: bufferedAmount attribute returns the size of the buffer in bytes -
@ -168,11 +214,11 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
let _ = my_sender.send_message(Message::Close(None)); let _ = my_sender.send_message(Message::Close(None));
return Ok(()); return Ok(());
} }
let _ = my_sender.send_message(Message::Text(data.unwrap())); let _ = my_sender.send_message(Message::Text(data.unwrap().0));
return Ok(()) return Ok(())
} }
fn Close(self, code: Option<u16>, reason: Option<DOMString>) -> Fallible<()>{ fn Close(self, code: Option<u16>, reason: Option<USVString>) -> Fallible<()>{
if let Some(code) = code { if let Some(code) = code {
//Check code is NOT 1000 NOR in the range of 3000-4999 (inclusive) //Check code is NOT 1000 NOR in the range of 3000-4999 (inclusive)
if code != 1000 && (code < 3000 || code > 4999) { if code != 1000 && (code < 3000 || code > 4999) {
@ -180,7 +226,7 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
} }
} }
if let Some(ref reason) = reason { if let Some(ref reason) = reason {
if reason.as_bytes().len() > 123 { //reason cannot be larger than 123 bytes if reason.0.as_bytes().len() > 123 { //reason cannot be larger than 123 bytes
return Err(Error::Syntax); return Err(Error::Syntax);
} }
} }
@ -205,7 +251,7 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
self.code.set(code); self.code.set(code);
} }
if let Some(reason) = reason { if let Some(reason) = reason {
*self.reason.borrow_mut() = reason; *self.reason.borrow_mut() = reason.0;
} }
self.ready_state.set(WebSocketRequestState::Closing); self.ready_state.set(WebSocketRequestState::Closing);
self.sendCloseFrame.set(true); self.sendCloseFrame.set(true);

View file

@ -69,6 +69,14 @@ use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::mpsc::TryRecvError::{Empty, Disconnected}; use std::sync::mpsc::TryRecvError::{Empty, Disconnected};
use time; use time;
/// Current state of the window object
#[derive(Copy, Clone, Debug, PartialEq)]
#[jstraceable]
enum WindowState {
Alive,
Zombie, // Pipeline is closed, but the window hasn't been GCed yet.
}
/// Extra information concerning the reason for reflowing. /// Extra information concerning the reason for reflowing.
#[derive(Debug)] #[derive(Debug)]
pub enum ReflowReason { pub enum ReflowReason {
@ -170,7 +178,10 @@ pub struct Window {
pending_reflow_count: Cell<u32>, pending_reflow_count: Cell<u32>,
/// A channel for communicating results of async scripts back to the webdriver server /// A channel for communicating results of async scripts back to the webdriver server
webdriver_script_chan: RefCell<Option<Sender<WebDriverJSResult>>> webdriver_script_chan: RefCell<Option<Sender<WebDriverJSResult>>>,
/// The current state of the window object
current_state: Cell<WindowState>,
} }
impl Window { impl Window {
@ -179,6 +190,7 @@ impl Window {
unsafe { unsafe {
*self.js_runtime.borrow_for_script_deallocation() = None; *self.js_runtime.borrow_for_script_deallocation() = None;
*self.browser_context.borrow_for_script_deallocation() = None; *self.browser_context.borrow_for_script_deallocation() = None;
self.current_state.set(WindowState::Zombie);
} }
} }
@ -544,6 +556,7 @@ pub trait WindowHelpers {
fn set_devtools_timeline_marker(self, marker: TimelineMarkerType, reply: Sender<TimelineMarker>); fn set_devtools_timeline_marker(self, marker: TimelineMarkerType, reply: Sender<TimelineMarker>);
fn drop_devtools_timeline_markers(self); fn drop_devtools_timeline_markers(self);
fn set_webdriver_script_chan(self, chan: Option<Sender<WebDriverJSResult>>); fn set_webdriver_script_chan(self, chan: Option<Sender<WebDriverJSResult>>);
fn is_alive(self) -> bool;
} }
pub trait ScriptHelpers { pub trait ScriptHelpers {
@ -584,6 +597,18 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
let document = self.Document().root(); let document = self.Document().root();
NodeCast::from_ref(document.r()).teardown(); NodeCast::from_ref(document.r()).teardown();
// The above code may not catch all DOM objects
// (e.g. DOM objects removed from the tree that haven't
// been collected yet). Forcing a GC here means that
// those DOM objects will be able to call dispose()
// to free their layout data before the layout task
// exits. Without this, those remaining objects try to
// send a message to free their layout data to the
// layout task when the script task is dropped,
// which causes a panic!
self.Gc();
self.current_state.set(WindowState::Zombie);
*self.js_runtime.borrow_mut() = None; *self.js_runtime.borrow_mut() = None;
*self.browser_context.borrow_mut() = None; *self.browser_context.borrow_mut() = None;
} }
@ -905,6 +930,10 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
fn set_webdriver_script_chan(self, chan: Option<Sender<WebDriverJSResult>>) { fn set_webdriver_script_chan(self, chan: Option<Sender<WebDriverJSResult>>) {
*self.webdriver_script_chan.borrow_mut() = chan; *self.webdriver_script_chan.borrow_mut() = chan;
} }
fn is_alive(self) -> bool {
self.current_state.get() == WindowState::Alive
}
} }
impl Window { impl Window {
@ -968,6 +997,7 @@ impl Window {
layout_join_port: DOMRefCell::new(None), layout_join_port: DOMRefCell::new(None),
window_size: Cell::new(window_size), window_size: Cell::new(window_size),
pending_reflow_count: Cell::new(0), pending_reflow_count: Cell::new(0),
current_state: Cell::new(WindowState::Alive),
devtools_marker_sender: RefCell::new(None), devtools_marker_sender: RefCell::new(None),
devtools_markers: RefCell::new(HashSet::new()), devtools_markers: RefCell::new(HashSet::new()),

View file

@ -11,6 +11,7 @@ use dom::node::LayoutData;
use geom::point::Point2D; use geom::point::Point2D;
use geom::rect::Rect; use geom::rect::Rect;
use libc::uintptr_t; use libc::uintptr_t;
use msg::compositor_msg::LayerId;
use msg::constellation_msg::{PipelineExitType, WindowSizeData}; use msg::constellation_msg::{PipelineExitType, WindowSizeData};
use msg::compositor_msg::Epoch; use msg::compositor_msg::Epoch;
use net_traits::PendingAsyncLoad; use net_traits::PendingAsyncLoad;
@ -47,6 +48,10 @@ pub enum Msg {
/// Requests that the layout task render the next frame of all animations. /// Requests that the layout task render the next frame of all animations.
TickAnimations, TickAnimations,
/// Updates the layout visible rects, affecting the area that display lists will be constructed
/// for.
SetVisibleRects(Vec<(LayerId, Rect<Au>)>),
/// Destroys layout data associated with a DOM node. /// Destroys layout data associated with a DOM node.
/// ///
/// TODO(pcwalton): Maybe think about batching to avoid message traffic. /// TODO(pcwalton): Maybe think about batching to avoid message traffic.

View file

@ -40,6 +40,7 @@ extern crate png;
extern crate rustc_serialize; extern crate rustc_serialize;
extern crate time; extern crate time;
extern crate canvas; extern crate canvas;
extern crate canvas_traits;
extern crate profile_traits; extern crate profile_traits;
extern crate script_traits; extern crate script_traits;
extern crate selectors; extern crate selectors;

View file

@ -4,7 +4,7 @@
#![allow(unsafe_code, unrooted_must_root)] #![allow(unsafe_code, unrooted_must_root)]
use document_loader::{DocumentLoader, LoadType}; use document_loader::DocumentLoader;
use dom::attr::AttrHelpers; use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
@ -32,13 +32,10 @@ use dom::servohtmlparser::{ServoHTMLParser, FragmentContext};
use dom::text::Text; use dom::text::Text;
use parse::Parser; use parse::Parser;
use encoding::all::UTF_8; use encoding::types::Encoding;
use encoding::types::{Encoding, DecoderTrap};
use net_traits::{ProgressMsg, LoadResponse}; use msg::constellation_msg::PipelineId;
use util::str::DOMString; use util::str::DOMString;
use util::task_state;
use util::task_state::IN_HTML_PARSER;
use std::borrow::Cow; use std::borrow::Cow;
use std::io::{self, Write}; use std::io::{self, Write};
use url::Url; use url::Url;
@ -49,14 +46,6 @@ use html5ever::serialize::TraversalScope::{IncludeNode, ChildrenOnly};
use html5ever::tree_builder::{TreeSink, QuirksMode, NodeOrText, AppendNode, AppendText, NextParserState}; use html5ever::tree_builder::{TreeSink, QuirksMode, NodeOrText, AppendNode, AppendText, NextParserState};
use string_cache::QualName; use string_cache::QualName;
use hyper::header::ContentType;
use hyper::mime::{Mime, TopLevel, SubLevel};
pub enum HTMLInput {
InputString(String),
InputUrl(LoadResponse),
}
trait SinkHelpers { trait SinkHelpers {
fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Temporary<Node>; fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Temporary<Node>;
} }
@ -183,7 +172,9 @@ impl<'a> TreeSink for servohtmlparser::Sink {
fn complete_script(&mut self, node: JS<Node>) -> NextParserState { fn complete_script(&mut self, node: JS<Node>) -> NextParserState {
let node: Root<Node> = node.root(); let node: Root<Node> = node.root();
let script: Option<JSRef<HTMLScriptElement>> = HTMLScriptElementCast::to_ref(node.r()); let script: Option<JSRef<HTMLScriptElement>> = HTMLScriptElementCast::to_ref(node.r());
script.map(|script| script.prepare()); if let Some(script) = script {
return script.prepare();
}
NextParserState::Continue NextParserState::Continue
} }
@ -272,80 +263,22 @@ impl<'a> Serializable for JSRef<'a, Node> {
} }
} }
pub enum ParseContext<'a> {
Fragment(FragmentContext<'a>),
Owner(Option<PipelineId>),
}
pub fn parse_html(document: JSRef<Document>, pub fn parse_html(document: JSRef<Document>,
input: HTMLInput, input: String,
url: &Url, url: &Url,
fragment_context: Option<FragmentContext>) { context: ParseContext) {
let parser = match fragment_context { let parser = match context {
None => ServoHTMLParser::new(Some(url.clone()), document).root(), ParseContext::Owner(owner) =>
Some(fc) => ServoHTMLParser::new_for_fragment(Some(url.clone()), document, fc).root(), ServoHTMLParser::new(Some(url.clone()), document, owner),
}; ParseContext::Fragment(fc) =>
let parser: JSRef<ServoHTMLParser> = parser.r(); ServoHTMLParser::new_for_fragment(Some(url.clone()), document, fc),
}.root();
let nested_parse = task_state::get().contains(task_state::IN_HTML_PARSER); parser.r().parse_chunk(input);
if !nested_parse {
task_state::enter(IN_HTML_PARSER);
}
fn parse_progress(document: JSRef<Document>, parser: JSRef<ServoHTMLParser>, url: &Url, load_response: &LoadResponse) {
for msg in load_response.progress_port.iter() {
match msg {
ProgressMsg::Payload(data) => {
// FIXME: use Vec<u8> (html5ever #34)
let data = UTF_8.decode(&data, DecoderTrap::Replace).unwrap();
parser.parse_chunk(data);
}
ProgressMsg::Done(Err(err)) => {
debug!("Failed to load page URL {}, error: {}", url.serialize(), err);
// TODO(Savago): we should send a notification to callers #5463.
break;
}
ProgressMsg::Done(Ok(())) => {
document.finish_load(LoadType::PageSource(url.clone()));
break;
}
}
}
};
match input {
HTMLInput::InputString(s) => {
parser.parse_chunk(s);
}
HTMLInput::InputUrl(load_response) => {
match load_response.metadata.content_type {
Some(ContentType(Mime(TopLevel::Image, _, _))) => {
let page = format!("<html><body><img src='{}' /></body></html>", url.serialize());
parser.parse_chunk(page);
document.finish_load(LoadType::PageSource(url.clone()));
},
Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => {
// FIXME: When servo/html5ever#109 is fixed remove <plaintext> usage and
// replace with fix from that issue.
// text/plain documents require setting the tokenizer into PLAINTEXT mode.
// This is done by using a <plaintext> element as the html5ever tokenizer
// provides no other way to change to that state.
// Spec for text/plain handling is:
// https://html.spec.whatwg.org/multipage/#read-text
let page = format!("<pre>\u{000A}<plaintext>");
parser.parse_chunk(page);
parse_progress(document, parser, url, &load_response);
},
_ => {
parse_progress(document, parser, url, &load_response);
}
}
}
}
parser.finish();
if !nested_parse {
task_state::exit(IN_HTML_PARSER);
}
debug!("finished parsing");
} }
// https://html.spec.whatwg.org/multipage/#parsing-html-fragments // https://html.spec.whatwg.org/multipage/#parsing-html-fragments
@ -376,7 +309,7 @@ pub fn parse_html_fragment(context_node: JSRef<Node>,
context_elem: context_node, context_elem: context_node,
form_elem: form.r(), form_elem: form.r(),
}; };
parse_html(document.r(), HTMLInput::InputString(input), &url, Some(fragment_context)); parse_html(document.r(), input, &url, ParseContext::Fragment(fragment_context));
// Step 14. // Step 14.
let root_element = document.r().GetDocumentElement().expect("no document element").root(); let root_element = document.r().GetDocumentElement().expect("no document element").root();

View file

@ -5,6 +5,6 @@
pub mod html; pub mod html;
pub trait Parser { pub trait Parser {
fn parse_chunk(&self,input: String); fn parse_chunk(self, input: String);
fn finish(&self); fn finish(self);
} }

View file

@ -39,11 +39,13 @@ use dom::htmliframeelement::{HTMLIFrameElement, HTMLIFrameElementHelpers};
use dom::uievent::UIEvent; use dom::uievent::UIEvent;
use dom::eventtarget::EventTarget; use dom::eventtarget::EventTarget;
use dom::node::{Node, NodeHelpers, NodeDamage, window_from_node}; use dom::node::{Node, NodeHelpers, NodeDamage, window_from_node};
use dom::servohtmlparser::{ServoHTMLParser, ParserContext};
use dom::window::{Window, WindowHelpers, ScriptHelpers, ReflowReason}; use dom::window::{Window, WindowHelpers, ScriptHelpers, ReflowReason};
use dom::worker::TrustedWorkerAddress; use dom::worker::TrustedWorkerAddress;
use parse::html::{HTMLInput, parse_html}; use parse::html::{ParseContext, parse_html};
use layout_interface::{ScriptLayoutChan, LayoutChan, ReflowGoal, ReflowQueryType}; use layout_interface::{ScriptLayoutChan, LayoutChan, ReflowGoal, ReflowQueryType};
use layout_interface; use layout_interface;
use network_listener::NetworkListener;
use page::{Page, IterablePage, Frame}; use page::{Page, IterablePage, Frame};
use timers::TimerId; use timers::TimerId;
use devtools; use devtools;
@ -65,13 +67,13 @@ use msg::constellation_msg::{ConstellationChan, FocusType};
use msg::constellation_msg::{LoadData, PipelineId, SubpageId, MozBrowserEvent, WorkerId}; use msg::constellation_msg::{LoadData, PipelineId, SubpageId, MozBrowserEvent, WorkerId};
use msg::constellation_msg::{Failure, WindowSizeData, PipelineExitType}; use msg::constellation_msg::{Failure, WindowSizeData, PipelineExitType};
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
use net_traits::{ResourceTask, LoadResponse, LoadConsumer, ControlMsg}; use net_traits::{ResourceTask, LoadConsumer, ControlMsg, Metadata};
use net_traits::LoadData as NetLoadData; use net_traits::LoadData as NetLoadData;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageCacheResult}; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageCacheResult};
use net_traits::storage_task::StorageTask; use net_traits::storage_task::StorageTask;
use string_cache::Atom; use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
use util::task::{spawn_named, spawn_named_with_send_on_failure}; use util::task::spawn_named_with_send_on_failure;
use util::task_state; use util::task_state;
use geom::Rect; use geom::Rect;
@ -92,6 +94,7 @@ use std::option::Option;
use std::ptr; use std::ptr;
use std::rc::Rc; use std::rc::Rc;
use std::result::Result; use std::result::Result;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::{channel, Sender, Receiver, Select}; use std::sync::mpsc::{channel, Sender, Receiver, Select};
use time::Tm; use time::Tm;
@ -188,8 +191,6 @@ pub enum ScriptMsg {
MainThreadRunnableMsg(Box<MainThreadRunnable+Send>), MainThreadRunnableMsg(Box<MainThreadRunnable+Send>),
/// A DOM object's last pinned reference was removed (dispatched to all tasks). /// A DOM object's last pinned reference was removed (dispatched to all tasks).
RefcountCleanup(TrustedReference), RefcountCleanup(TrustedReference),
/// The final network response for a page has arrived.
PageFetchComplete(PipelineId, Option<SubpageId>, LoadResponse),
/// Notify a document that all pending loads are complete. /// Notify a document that all pending loads are complete.
DocumentLoadsComplete(PipelineId), DocumentLoadsComplete(PipelineId),
} }
@ -317,6 +318,9 @@ pub struct ScriptTask {
js_runtime: Rc<Runtime>, js_runtime: Rc<Runtime>,
mouse_over_targets: DOMRefCell<Vec<JS<Node>>>, mouse_over_targets: DOMRefCell<Vec<JS<Node>>>,
/// List of pipelines that have been owned and closed by this script task.
closed_pipelines: RefCell<HashSet<PipelineId>>,
} }
/// In the event of task failure, all data on the stack runs its destructor. However, there /// In the event of task failure, all data on the stack runs its destructor. However, there
@ -386,7 +390,7 @@ impl ScriptTaskFactory for ScriptTask {
let ConstellationChan(const_chan) = constellation_chan.clone(); let ConstellationChan(const_chan) = constellation_chan.clone();
let (script_chan, script_port) = channel(); let (script_chan, script_port) = channel();
let layout_chan = LayoutChan(layout_chan.sender()); let layout_chan = LayoutChan(layout_chan.sender());
spawn_named_with_send_on_failure("ScriptTask", task_state::SCRIPT, move || { spawn_named_with_send_on_failure(format!("ScriptTask {:?}", id), task_state::SCRIPT, move || {
let script_task = ScriptTask::new(box compositor as Box<ScriptListener>, let script_task = ScriptTask::new(box compositor as Box<ScriptListener>,
script_port, script_port,
NonWorkerScriptChan(script_chan), NonWorkerScriptChan(script_chan),
@ -424,6 +428,21 @@ unsafe extern "C" fn debug_gc_callback(_rt: *mut JSRuntime, status: JSGCStatus)
} }
impl ScriptTask { impl ScriptTask {
pub fn page_fetch_complete(id: PipelineId, subpage: Option<SubpageId>, metadata: Metadata)
-> Option<Temporary<ServoHTMLParser>> {
SCRIPT_TASK_ROOT.with(|root| {
let script_task = unsafe { &*root.borrow().unwrap() };
script_task.handle_page_fetch_complete(id, subpage, metadata)
})
}
pub fn parsing_complete(id: PipelineId) {
SCRIPT_TASK_ROOT.with(|root| {
let script_task = unsafe { &*root.borrow().unwrap() };
script_task.handle_parsing_complete(id);
});
}
pub fn process_event(msg: ScriptMsg) { pub fn process_event(msg: ScriptMsg) {
SCRIPT_TASK_ROOT.with(|root| { SCRIPT_TASK_ROOT.with(|root| {
if let Some(script_task) = *root.borrow() { if let Some(script_task) = *root.borrow() {
@ -494,7 +513,8 @@ impl ScriptTask {
devtools_marker_sender: RefCell::new(None), devtools_marker_sender: RefCell::new(None),
js_runtime: Rc::new(runtime), js_runtime: Rc::new(runtime),
mouse_over_targets: DOMRefCell::new(vec!()) mouse_over_targets: DOMRefCell::new(vec!()),
closed_pipelines: RefCell::new(HashSet::new()),
} }
} }
@ -761,8 +781,6 @@ impl ScriptTask {
runnable.handler(self), runnable.handler(self),
ScriptMsg::RefcountCleanup(addr) => ScriptMsg::RefcountCleanup(addr) =>
LiveDOMReferences::cleanup(self.get_cx(), addr), LiveDOMReferences::cleanup(self.get_cx(), addr),
ScriptMsg::PageFetchComplete(id, subpage, response) =>
self.handle_page_fetch_complete(id, subpage, response),
ScriptMsg::DocumentLoadsComplete(id) => ScriptMsg::DocumentLoadsComplete(id) =>
self.handle_loads_complete(id), self.handle_loads_complete(id),
} }
@ -795,7 +813,7 @@ impl ScriptTask {
} }
fn handle_msg_from_image_cache(&self, msg: ImageCacheResult) { fn handle_msg_from_image_cache(&self, msg: ImageCacheResult) {
msg.responder.unwrap().respond(msg.image); msg.responder.unwrap().respond(msg.image_response);
} }
fn handle_webdriver_msg(&self, pipeline_id: PipelineId, msg: WebDriverScriptCommand) { fn handle_webdriver_msg(&self, pipeline_id: PipelineId, msg: WebDriverScriptCommand) {
@ -1027,12 +1045,16 @@ impl ScriptTask {
fn handle_reflow_complete_msg(&self, pipeline_id: PipelineId, reflow_id: u32) { fn handle_reflow_complete_msg(&self, pipeline_id: PipelineId, reflow_id: u32) {
debug!("Script: Reflow {:?} complete for {:?}", reflow_id, pipeline_id); debug!("Script: Reflow {:?} complete for {:?}", reflow_id, pipeline_id);
let page = self.root_page(); let page = self.root_page();
let page = page.find(pipeline_id).expect( match page.find(pipeline_id) {
"ScriptTask: received a load message for a layout channel that is not associated \ Some(page) => {
with this script task. This is a bug.");
let window = page.window().root(); let window = page.window().root();
window.r().handle_reflow_complete_msg(reflow_id); window.r().handle_reflow_complete_msg(reflow_id);
} }
None => {
assert!(self.closed_pipelines.borrow().contains(&pipeline_id));
}
}
}
/// Window was resized, but this script was not active, so don't reflow yet /// Window was resized, but this script was not active, so don't reflow yet
fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData) { fn handle_resize_inactive_msg(&self, id: PipelineId, new_size: WindowSizeData) {
@ -1061,13 +1083,22 @@ impl ScriptTask {
/// We have received notification that the response associated with a load has completed. /// We have received notification that the response associated with a load has completed.
/// Kick off the document and frame tree creation process using the result. /// Kick off the document and frame tree creation process using the result.
fn handle_page_fetch_complete(&self, id: PipelineId, subpage: Option<SubpageId>, fn handle_page_fetch_complete(&self, id: PipelineId, subpage: Option<SubpageId>,
response: LoadResponse) { metadata: Metadata) -> Option<Temporary<ServoHTMLParser>> {
// Any notification received should refer to an existing, in-progress load that is tracked.
let idx = self.incomplete_loads.borrow().iter().position(|load| { let idx = self.incomplete_loads.borrow().iter().position(|load| {
load.pipeline_id == id && load.parent_info.map(|info| info.1) == subpage load.pipeline_id == id && load.parent_info.map(|info| info.1) == subpage
}).unwrap(); });
// The matching in progress load structure may not exist if
// the pipeline exited before the page load completed.
match idx {
Some(idx) => {
let load = self.incomplete_loads.borrow_mut().remove(idx); let load = self.incomplete_loads.borrow_mut().remove(idx);
self.load(response, load); Some(self.load(metadata, load))
}
None => {
assert!(self.closed_pipelines.borrow().contains(&id));
None
}
}
} }
/// Handles a request for the window title. /// Handles a request for the window title.
@ -1080,11 +1111,31 @@ impl ScriptTask {
/// Handles a request to exit the script task and shut down layout. /// Handles a request to exit the script task and shut down layout.
/// Returns true if the script task should shut down and false otherwise. /// Returns true if the script task should shut down and false otherwise.
fn handle_exit_pipeline_msg(&self, id: PipelineId, exit_type: PipelineExitType) -> bool { fn handle_exit_pipeline_msg(&self, id: PipelineId, exit_type: PipelineExitType) -> bool {
if self.page.borrow().is_none() { self.closed_pipelines.borrow_mut().insert(id);
// The root page doesn't even exist yet, so it
// is safe to exit this script task. // Check if the exit message is for an in progress load.
// TODO(gw): This probably leaks resources! let idx = self.incomplete_loads.borrow().iter().position(|load| {
return true; load.pipeline_id == id
});
if let Some(idx) = idx {
let load = self.incomplete_loads.borrow_mut().remove(idx);
// Tell the layout task to begin shutting down, and wait until it
// processed this message.
let (response_chan, response_port) = channel();
let LayoutChan(chan) = load.layout_chan;
if chan.send(layout_interface::Msg::PrepareToExit(response_chan)).is_ok() {
debug!("shutting down layout for page {:?}", id);
response_port.recv().unwrap();
chan.send(layout_interface::Msg::ExitNow(exit_type)).ok();
}
let has_pending_loads = self.incomplete_loads.borrow().len() > 0;
let has_root_page = self.page.borrow().is_some();
// Exit if no pending loads and no root page
return !has_pending_loads && !has_root_page;
} }
// If root is being exited, shut down all pages // If root is being exited, shut down all pages
@ -1112,8 +1163,8 @@ impl ScriptTask {
/// The entry point to document loading. Defines bindings, sets up the window and document /// The entry point to document loading. Defines bindings, sets up the window and document
/// objects, parses HTML and CSS, and kicks off initial layout. /// objects, parses HTML and CSS, and kicks off initial layout.
fn load(&self, response: LoadResponse, incomplete: InProgressLoad) { fn load(&self, metadata: Metadata, incomplete: InProgressLoad) -> Temporary<ServoHTMLParser> {
let final_url = response.metadata.final_url.clone(); let final_url = metadata.final_url.clone();
debug!("ScriptTask: loading {} on page {:?}", incomplete.url.serialize(), incomplete.pipeline_id); debug!("ScriptTask: loading {} on page {:?}", incomplete.url.serialize(), incomplete.pipeline_id);
// We should either be initializing a root page or loading a child page of an // We should either be initializing a root page or loading a child page of an
@ -1213,11 +1264,11 @@ impl ScriptTask {
incomplete.parent_info, incomplete.parent_info,
incomplete.window_size).root(); incomplete.window_size).root();
let last_modified: Option<DOMString> = response.metadata.headers.as_ref().and_then(|headers| { let last_modified: Option<DOMString> = metadata.headers.as_ref().and_then(|headers| {
headers.get().map(|&LastModified(HttpDate(ref tm))| dom_last_modified(tm)) headers.get().map(|&LastModified(HttpDate(ref tm))| dom_last_modified(tm))
}); });
let content_type = match response.metadata.content_type { let content_type = match metadata.content_type {
Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => Some("text/plain".to_owned()), Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => Some("text/plain".to_owned()),
_ => None _ => None
}; };
@ -1228,7 +1279,7 @@ impl ScriptTask {
}; };
let loader = DocumentLoader::new_with_task(self.resource_task.clone(), let loader = DocumentLoader::new_with_task(self.resource_task.clone(),
Some(notifier_data), Some(notifier_data),
Some(final_url.clone())); Some(incomplete.url.clone()));
let document = Document::new(window.r(), let document = Document::new(window.r(),
Some(final_url.clone()), Some(final_url.clone()),
IsHTMLDocument::HTMLDocument, IsHTMLDocument::HTMLDocument,
@ -1252,14 +1303,17 @@ impl ScriptTask {
let jsval = window.r().evaluate_js_on_global_with_result(evalstr); let jsval = window.r().evaluate_js_on_global_with_result(evalstr);
let strval = FromJSValConvertible::from_jsval(self.get_cx(), jsval, let strval = FromJSValConvertible::from_jsval(self.get_cx(), jsval,
StringificationBehavior::Empty); StringificationBehavior::Empty);
HTMLInput::InputString(strval.unwrap_or("".to_owned())) strval.unwrap_or("".to_owned())
} else { } else {
HTMLInput::InputUrl(response) "".to_owned()
}; };
parse_html(document.r(), parse_input, &final_url, None); parse_html(document.r(), parse_input, &final_url,
self.handle_parsing_complete(incomplete.pipeline_id); ParseContext::Owner(Some(incomplete.pipeline_id)));
page_remover.neuter(); page_remover.neuter();
document.r().get_current_parser().unwrap()
} }
fn notify_devtools(&self, title: DOMString, url: Url, ids: (PipelineId, Option<WorkerId>)) { fn notify_devtools(&self, title: DOMString, url: Url, ids: (PipelineId, Option<WorkerId>)) {
@ -1444,12 +1498,17 @@ impl ScriptTask {
let script_chan = self.chan.clone(); let script_chan = self.chan.clone();
let resource_task = self.resource_task.clone(); let resource_task = self.resource_task.clone();
spawn_named(format!("fetch for {:?}", load_data.url.serialize()), move || { let context = Arc::new(Mutex::new(ParserContext::new(id, subpage, script_chan.clone(),
load_data.url.clone())));
let listener = box NetworkListener {
context: context,
script_chan: script_chan.clone(),
};
if load_data.url.scheme == "javascript" { if load_data.url.scheme == "javascript" {
load_data.url = Url::parse("about:blank").unwrap(); load_data.url = Url::parse("about:blank").unwrap();
} }
let (input_chan, input_port) = channel();
resource_task.send(ControlMsg::Load(NetLoadData { resource_task.send(ControlMsg::Load(NetLoadData {
url: load_data.url, url: load_data.url,
method: load_data.method, method: load_data.method,
@ -1458,15 +1517,7 @@ impl ScriptTask {
data: load_data.data, data: load_data.data,
cors: None, cors: None,
pipeline_id: Some(id), pipeline_id: Some(id),
}, LoadConsumer::Channel(input_chan))).unwrap(); }, LoadConsumer::Listener(listener))).unwrap();
let load_response = input_port.recv().unwrap();
if script_chan.send(ScriptMsg::PageFetchComplete(id, subpage, load_response)).is_err() {
// TODO(gw): This should be handled by aborting
// the load before the script task exits.
debug!("PageFetchComplete: script channel has exited");
}
});
self.incomplete_loads.borrow_mut().push(incomplete); self.incomplete_loads.borrow_mut().push(incomplete);
} }
@ -1505,6 +1556,7 @@ impl ScriptTask {
// Kick off the initial reflow of the page. // Kick off the initial reflow of the page.
debug!("kicking off initial reflow of {:?}", final_url); debug!("kicking off initial reflow of {:?}", final_url);
document.r().content_changed(NodeCast::from_ref(document.r()), document.r().content_changed(NodeCast::from_ref(document.r()),
NodeDamage::OtherNodeDamage); NodeDamage::OtherNodeDamage);
let window = window_from_node(document.r()).root(); let window = window_from_node(document.r()).root();

View file

@ -23,7 +23,7 @@ dependencies = [
"script_tests 0.0.1", "script_tests 0.0.1",
"style_tests 0.0.1", "style_tests 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"util_tests 0.0.1", "util_tests 0.0.1",
"webdriver_server 0.0.1", "webdriver_server 0.0.1",
@ -69,15 +69,28 @@ name = "canvas"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx_traits 0.0.1",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.0.1 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.0.1 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "canvas_traits"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx_traits 0.0.1",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
]
[[package]] [[package]]
name = "cgl" name = "cgl"
version = "0.0.1" version = "0.0.1"
@ -115,6 +128,7 @@ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout_traits 0.0.1", "layout_traits 0.0.1",
@ -128,20 +142,20 @@ dependencies = [
"script_traits 0.0.1", "script_traits 0.0.1",
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
[[package]] [[package]]
name = "cookie" name = "cookie"
version = "0.1.19" version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -155,7 +169,7 @@ dependencies = [
[[package]] [[package]]
name = "core_graphics" name = "core_graphics"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-core-graphics#da0d2fe947412afea55b438454194b2183c21594" source = "git+https://github.com/servo/rust-core-graphics#2d8d665c5bdd116b4a1addbe5c415735fb78e1a9"
dependencies = [ dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -164,7 +178,7 @@ dependencies = [
[[package]] [[package]]
name = "core_text" name = "core_text"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-core-text#bc6994c3765f0660e9c04f5488ba194a9354e8fb" source = "git+https://github.com/servo/rust-core-text#2b4b546718310a9d3fe4273a1df092c79d9fb2c2"
dependencies = [ dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@ -192,9 +206,9 @@ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -204,9 +218,9 @@ version = "0.0.1"
dependencies = [ dependencies = [
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -278,7 +292,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "expat-sys" name = "expat-sys"
version = "2.1.0" version = "2.1.0"
source = "git+https://github.com/servo/libexpat#5f798cfbb74650a5e1d95e4c03a9e41e55e28625" source = "git+https://github.com/servo/libexpat#91775ceb69adaea0ce903271b185079a2c484f57"
[[package]] [[package]]
name = "flate2" name = "flate2"
@ -327,7 +341,7 @@ source = "git+https://github.com/servo/libfreetype2#50c1cf412d87f20ccbb940e39a14
[[package]] [[package]]
name = "gcc" name = "gcc"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -346,7 +360,7 @@ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -355,12 +369,14 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx_traits 0.0.1",
"harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)", "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -370,14 +386,14 @@ dependencies = [
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1", "script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia)", "skia 0.0.20130412 (git+https://github.com/servo/skia)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -389,14 +405,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "gl" name = "gfx_traits"
version = "0.0.12" version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -409,7 +421,7 @@ dependencies = [
[[package]] [[package]]
name = "gl_generator" name = "gl_generator"
version = "0.0.24" version = "0.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -423,7 +435,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/gleam#f2edabf2ef0474bb270b107e5e68c2727c4a422d" source = "git+https://github.com/servo/gleam#f2edabf2ef0474bb270b107e5e68c2727c4a422d"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -431,24 +443,24 @@ dependencies = [
[[package]] [[package]]
name = "glutin" name = "glutin"
version = "0.0.26" version = "0.0.26"
source = "git+https://github.com/servo/glutin?branch=servo#b28f35aa5b06e7d34ada307a5a1b1e9b9de697a1" source = "git+https://github.com/servo/glutin?branch=servo#ec7a5e40c1cc7b8176eb1e1f7bf70c8a19559400"
dependencies = [ dependencies = [
"android_glue 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "android_glue 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_cocoa 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_cocoa 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_core_graphics 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_core_graphics 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"osmesa-sys 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"user32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 0.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "x11 0.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -467,18 +479,18 @@ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]] [[package]]
name = "glutin_cocoa" name = "glutin_cocoa"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -491,7 +503,7 @@ dependencies = [
[[package]] [[package]]
name = "glutin_core_graphics" name = "glutin_core_graphics"
version = "0.1.3" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -504,7 +516,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/rust-glx#60ac0aee2438eadb4b51ddc8eac6fc4b5ca8e447" source = "git+https://github.com/servo/rust-glx#60ac0aee2438eadb4b51ddc8eac6fc4b5ca8e447"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -520,7 +532,7 @@ dependencies = [
[[package]] [[package]]
name = "html5ever" name = "html5ever"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/html5ever#74dc5f5a36451cfbe789488b20d51bef97c63898" source = "git+https://github.com/servo/html5ever#7ddaa598b84e5e7fb9bf5313c02c1aaca970cb4b"
dependencies = [ dependencies = [
"html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)", "html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -535,10 +547,10 @@ dependencies = [
[[package]] [[package]]
name = "html5ever_macros" name = "html5ever_macros"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/html5ever#74dc5f5a36451cfbe789488b20d51bef97c63898" source = "git+https://github.com/servo/html5ever#7ddaa598b84e5e7fb9bf5313c02c1aaca970cb4b"
dependencies = [ dependencies = [
"mac 0.0.2 (git+https://github.com/reem/rust-mac)", "mac 0.0.2 (git+https://github.com/reem/rust-mac)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -546,42 +558,23 @@ name = "httparse"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -604,7 +597,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -635,7 +628,7 @@ dependencies = [
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)", "io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia)", "skia 0.0.20130412 (git+https://github.com/servo/skia)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
] ]
@ -647,11 +640,13 @@ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1",
"clock_ticks 0.0.5 (git+https://github.com/tomaka/clock_ticks)", "clock_ticks 0.0.5 (git+https://github.com/tomaka/clock_ticks)",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1",
"layout_traits 0.0.1", "layout_traits 0.0.1",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
@ -659,14 +654,14 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1", "script 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -674,12 +669,13 @@ dependencies = [
name = "layout_traits" name = "layout_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"msg 0.0.1", "msg 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -734,7 +730,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "mime" name = "mime"
version = "0.0.10" version = "0.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -745,7 +741,7 @@ name = "miniz-sys"
version = "0.1.4" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -772,7 +768,7 @@ dependencies = [
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -781,19 +777,19 @@ dependencies = [
name = "net" name = "net"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net_traits 0.0.1", "net_traits 0.0.1",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -802,11 +798,11 @@ dependencies = [
name = "net_tests" name = "net_tests"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net 0.0.1", "net 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -819,7 +815,7 @@ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -829,7 +825,7 @@ version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -842,7 +838,7 @@ dependencies = [
[[package]] [[package]]
name = "objc" name = "objc"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -852,13 +848,14 @@ dependencies = [
[[package]] [[package]]
name = "offscreen_gl_context" name = "offscreen_gl_context"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#c2b3dfd7fe344384e4206672b99c296141f5b4d6" source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#97eacf34b72f69b10130a0de016529e98ee32f04"
dependencies = [ dependencies = [
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)", "glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
@ -866,34 +863,33 @@ dependencies = [
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "osmesa-sys" name = "osmesa-sys"
version = "0.0.3" version = "0.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gl 0.0.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "shared_library 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -930,14 +926,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.3" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "plugins" name = "plugins"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", "tenacious 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -953,7 +949,7 @@ name = "png"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-png#34fca101357da41b2b8c95f3efe6cb88a2b36bca" source = "git+https://github.com/servo/rust-png#34fca101357da41b2b8c95f3efe6cb88a2b36bca"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"png-sys 1.6.16 (git+https://github.com/servo/rust-png)", "png-sys 1.6.16 (git+https://github.com/servo/rust-png)",
] ]
@ -980,7 +976,7 @@ name = "profile_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1011,7 +1007,7 @@ dependencies = [
[[package]] [[package]]
name = "rustc-serialize" name = "rustc-serialize"
version = "0.3.13" version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -1020,6 +1016,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1035,7 +1032,7 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1", "script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
@ -1043,11 +1040,11 @@ dependencies = [
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
"websocket 0.11.10 (registry+https://github.com/rust-lang/crates.io-index)", "websocket 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1067,7 +1064,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -1086,6 +1083,15 @@ dependencies = [
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
] ]
[[package]]
name = "shared_library"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "skia" name = "skia"
version = "0.0.20130412" version = "0.0.20130412"
@ -1149,11 +1155,11 @@ dependencies = [
"mod_path 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "mod_path 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -1167,7 +1173,7 @@ dependencies = [
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -1185,15 +1191,15 @@ dependencies = [
[[package]] [[package]]
name = "tenacious" name = "tenacious"
version = "0.0.1" version = "0.0.3"
source = "git+https://github.com/Manishearth/rust-tenacious.git#5112359cd36682cd7df3a7bb9a963299890be26c" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.25" version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1214,11 +1220,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "url" name = "url"
version = "0.2.31" version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1245,13 +1251,13 @@ dependencies = [
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"smallvec 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1268,18 +1274,18 @@ version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "webdriver" name = "webdriver"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/jgraham/webdriver-rust.git#4065017191f1054b62f8c17c2b07c412111e0022" source = "git+https://github.com/jgraham/webdriver-rust.git#038c1828c5dd4ab7b8f70b3d859c0ff988e6ca25"
dependencies = [ dependencies = [
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1289,11 +1295,11 @@ version = "0.0.1"
dependencies = [ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver 0.1.0 (git+https://github.com/jgraham/webdriver-rust.git)", "webdriver 0.2.0 (git+https://github.com/jgraham/webdriver-rust.git)",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -1301,22 +1307,22 @@ dependencies = [
name = "webdriver_traits" name = "webdriver_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.11.10" version = "0.11.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1329,7 +1335,7 @@ dependencies = [
[[package]] [[package]]
name = "x11" name = "x11"
version = "0.0.32" version = "0.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -124,8 +124,8 @@ impl Browser {
} }
} }
pub fn handle_event(&mut self, event: WindowEvent) -> bool { pub fn handle_events(&mut self, events: Vec<WindowEvent>) -> bool {
self.compositor.handle_event(event) self.compositor.handle_events(events)
} }
pub fn repaint_synchronously(&mut self) { pub fn repaint_synchronously(&mut self) {

View file

@ -64,17 +64,14 @@ fn main() {
maybe_register_glutin_resize_handler(&window, &mut browser); maybe_register_glutin_resize_handler(&window, &mut browser);
browser.browser.handle_event(WindowEvent::InitializeCompositing); browser.browser.handle_events(vec![WindowEvent::InitializeCompositing]);
// Feed events from the window to the browser until the browser // Feed events from the window to the browser until the browser
// says to stop. // says to stop.
loop { loop {
let should_continue = match window { let should_continue = match window {
None => browser.browser.handle_event(WindowEvent::Idle), None => browser.browser.handle_events(Vec::new()),
Some(ref window) => { Some(ref window) => browser.browser.handle_events(window.wait_events()),
let event = window.wait_events();
browser.browser.handle_event(event)
}
}; };
if !should_continue { if !should_continue {
break break
@ -123,7 +120,7 @@ impl app::NestedEventLoopListener for BrowserWrapper {
WindowEvent::Resize(..) => true, WindowEvent::Resize(..) => true,
_ => false, _ => false,
}; };
if !self.browser.handle_event(event) { if !self.browser.handle_events(vec![event]) {
return false return false
} }
if is_resize { if is_resize {

View file

@ -424,7 +424,7 @@ pub mod longhands {
${new_style_struct("InheritedBox", is_inherited=True)} ${new_style_struct("InheritedBox", is_inherited=True)}
${single_keyword("direction", "ltr rtl", experimental=True)} ${single_keyword("direction", "ltr rtl")}
// CSS 2.1, Section 10 - Visual formatting model details // CSS 2.1, Section 10 - Visual formatting model details

View file

@ -127,7 +127,7 @@ pub fn parse_unsigned_integer<T: Iterator<Item=char>>(input: T) -> Option<u32> {
}) })
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone, Debug)]
pub enum LengthOrPercentageOrAuto { pub enum LengthOrPercentageOrAuto {
Auto, Auto,
Percentage(f32), Percentage(f32),

View file

@ -18,7 +18,7 @@ pub fn spawn_named<F>(name: String, f: F)
} }
/// Arrange to send a particular message to a channel if the task fails. /// Arrange to send a particular message to a channel if the task fails.
pub fn spawn_named_with_send_on_failure<F, T>(name: &'static str, pub fn spawn_named_with_send_on_failure<F, T>(name: String,
state: task_state::TaskState, state: task_state::TaskState,
f: F, f: F,
msg: T, msg: T,

260
ports/cef/Cargo.lock generated
View file

@ -19,7 +19,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"net 0.0.1", "net 0.0.1",
"objc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"script 0.0.1", "script 0.0.1",
@ -27,7 +27,7 @@ dependencies = [
"servo 0.0.1", "servo 0.0.1",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"x11 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "x11 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -68,15 +68,28 @@ name = "canvas"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx_traits 0.0.1",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.0.1 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.0.1 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "canvas_traits"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx_traits 0.0.1",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
]
[[package]] [[package]]
name = "cgl" name = "cgl"
version = "0.0.1" version = "0.0.1"
@ -106,11 +119,11 @@ dependencies = [
[[package]] [[package]]
name = "cocoa" name = "cocoa"
version = "0.1.1" version = "0.1.1"
source = "git+https://github.com/servo/rust-cocoa#26d02e3f3606223645dde173a7bb924bce4836de" source = "git+https://github.com/servo/rust-cocoa#493594f4e23a5f534a28be83748b6a0c058e2373"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -124,6 +137,7 @@ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout_traits 0.0.1", "layout_traits 0.0.1",
@ -137,20 +151,20 @@ dependencies = [
"script_traits 0.0.1", "script_traits 0.0.1",
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
[[package]] [[package]]
name = "cookie" name = "cookie"
version = "0.1.19" version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -164,7 +178,7 @@ dependencies = [
[[package]] [[package]]
name = "core_graphics" name = "core_graphics"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-core-graphics#da0d2fe947412afea55b438454194b2183c21594" source = "git+https://github.com/servo/rust-core-graphics#2d8d665c5bdd116b4a1addbe5c415735fb78e1a9"
dependencies = [ dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -173,7 +187,7 @@ dependencies = [
[[package]] [[package]]
name = "core_text" name = "core_text"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-core-text#bc6994c3765f0660e9c04f5488ba194a9354e8fb" source = "git+https://github.com/servo/rust-core-text#2b4b546718310a9d3fe4273a1df092c79d9fb2c2"
dependencies = [ dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@ -201,9 +215,9 @@ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -213,9 +227,9 @@ version = "0.0.1"
dependencies = [ dependencies = [
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -287,7 +301,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "expat-sys" name = "expat-sys"
version = "2.1.0" version = "2.1.0"
source = "git+https://github.com/servo/libexpat#5f798cfbb74650a5e1d95e4c03a9e41e55e28625" source = "git+https://github.com/servo/libexpat#91775ceb69adaea0ce903271b185079a2c484f57"
[[package]] [[package]]
name = "flate2" name = "flate2"
@ -336,7 +350,7 @@ source = "git+https://github.com/servo/libfreetype2#50c1cf412d87f20ccbb940e39a14
[[package]] [[package]]
name = "gcc" name = "gcc"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -355,7 +369,7 @@ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -364,12 +378,14 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx_traits 0.0.1",
"harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)", "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -379,26 +395,22 @@ dependencies = [
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1", "script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia)", "skia 0.0.20130412 (git+https://github.com/servo/skia)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]] [[package]]
name = "gl" name = "gfx_traits"
version = "0.0.12" version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -411,7 +423,7 @@ dependencies = [
[[package]] [[package]]
name = "gl_generator" name = "gl_generator"
version = "0.0.24" version = "0.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -425,7 +437,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/gleam#f2edabf2ef0474bb270b107e5e68c2727c4a422d" source = "git+https://github.com/servo/gleam#f2edabf2ef0474bb270b107e5e68c2727c4a422d"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -433,24 +445,24 @@ dependencies = [
[[package]] [[package]]
name = "glutin" name = "glutin"
version = "0.0.26" version = "0.0.26"
source = "git+https://github.com/servo/glutin?branch=servo#b28f35aa5b06e7d34ada307a5a1b1e9b9de697a1" source = "git+https://github.com/servo/glutin?branch=servo#ec7a5e40c1cc7b8176eb1e1f7bf70c8a19559400"
dependencies = [ dependencies = [
"android_glue 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "android_glue 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_cocoa 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_cocoa 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_core_graphics 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_core_graphics 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"osmesa-sys 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"user32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"x11 0.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "x11 0.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -469,18 +481,18 @@ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]] [[package]]
name = "glutin_cocoa" name = "glutin_cocoa"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -493,7 +505,7 @@ dependencies = [
[[package]] [[package]]
name = "glutin_core_graphics" name = "glutin_core_graphics"
version = "0.1.3" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "glutin_core_foundation 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -506,7 +518,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/rust-glx#60ac0aee2438eadb4b51ddc8eac6fc4b5ca8e447" source = "git+https://github.com/servo/rust-glx#60ac0aee2438eadb4b51ddc8eac6fc4b5ca8e447"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -522,7 +534,7 @@ dependencies = [
[[package]] [[package]]
name = "html5ever" name = "html5ever"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/html5ever#74dc5f5a36451cfbe789488b20d51bef97c63898" source = "git+https://github.com/servo/html5ever#7ddaa598b84e5e7fb9bf5313c02c1aaca970cb4b"
dependencies = [ dependencies = [
"html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)", "html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -537,10 +549,10 @@ dependencies = [
[[package]] [[package]]
name = "html5ever_macros" name = "html5ever_macros"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/html5ever#74dc5f5a36451cfbe789488b20d51bef97c63898" source = "git+https://github.com/servo/html5ever#7ddaa598b84e5e7fb9bf5313c02c1aaca970cb4b"
dependencies = [ dependencies = [
"mac 0.0.2 (git+https://github.com/reem/rust-mac)", "mac 0.0.2 (git+https://github.com/reem/rust-mac)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -548,42 +560,23 @@ name = "httparse"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -606,7 +599,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -637,7 +630,7 @@ dependencies = [
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)", "io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia)", "skia 0.0.20130412 (git+https://github.com/servo/skia)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
] ]
@ -649,11 +642,13 @@ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1",
"clock_ticks 0.0.5 (git+https://github.com/tomaka/clock_ticks)", "clock_ticks 0.0.5 (git+https://github.com/tomaka/clock_ticks)",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1",
"layout_traits 0.0.1", "layout_traits 0.0.1",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
@ -661,14 +656,14 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1", "script 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -676,12 +671,13 @@ dependencies = [
name = "layout_traits" name = "layout_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"msg 0.0.1", "msg 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -736,7 +732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "mime" name = "mime"
version = "0.0.10" version = "0.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -747,7 +743,7 @@ name = "miniz-sys"
version = "0.1.4" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -774,7 +770,7 @@ dependencies = [
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -783,19 +779,19 @@ dependencies = [
name = "net" name = "net"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net_traits 0.0.1", "net_traits 0.0.1",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -809,7 +805,7 @@ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -819,7 +815,7 @@ version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -832,7 +828,7 @@ dependencies = [
[[package]] [[package]]
name = "objc" name = "objc"
version = "0.1.4" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -842,13 +838,14 @@ dependencies = [
[[package]] [[package]]
name = "offscreen_gl_context" name = "offscreen_gl_context"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#c2b3dfd7fe344384e4206672b99c296141f5b4d6" source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#97eacf34b72f69b10130a0de016529e98ee32f04"
dependencies = [ dependencies = [
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)", "glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
@ -856,34 +853,33 @@ dependencies = [
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "osmesa-sys" name = "osmesa-sys"
version = "0.0.3" version = "0.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gl 0.0.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "shared_library 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -920,14 +916,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.3" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "plugins" name = "plugins"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", "tenacious 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -943,7 +939,7 @@ name = "png"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-png#34fca101357da41b2b8c95f3efe6cb88a2b36bca" source = "git+https://github.com/servo/rust-png#34fca101357da41b2b8c95f3efe6cb88a2b36bca"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"png-sys 1.6.16 (git+https://github.com/servo/rust-png)", "png-sys 1.6.16 (git+https://github.com/servo/rust-png)",
] ]
@ -970,7 +966,7 @@ name = "profile_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1001,7 +997,7 @@ dependencies = [
[[package]] [[package]]
name = "rustc-serialize" name = "rustc-serialize"
version = "0.3.13" version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -1010,6 +1006,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1025,7 +1022,7 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1", "script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
@ -1033,11 +1030,11 @@ dependencies = [
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
"websocket 0.11.10 (registry+https://github.com/rust-lang/crates.io-index)", "websocket 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1049,7 +1046,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -1088,11 +1085,20 @@ dependencies = [
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script 0.0.1", "script 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_server 0.0.1", "webdriver_server 0.0.1",
] ]
[[package]]
name = "shared_library"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "skia" name = "skia"
version = "0.0.20130412" version = "0.0.20130412"
@ -1156,11 +1162,11 @@ dependencies = [
"mod_path 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "mod_path 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -1178,15 +1184,15 @@ dependencies = [
[[package]] [[package]]
name = "tenacious" name = "tenacious"
version = "0.0.1" version = "0.0.3"
source = "git+https://github.com/Manishearth/rust-tenacious.git#5112359cd36682cd7df3a7bb9a963299890be26c" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.25" version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1207,11 +1213,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "url" name = "url"
version = "0.2.31" version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1238,13 +1244,13 @@ dependencies = [
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"smallvec 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1253,18 +1259,18 @@ version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "webdriver" name = "webdriver"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/jgraham/webdriver-rust.git#4065017191f1054b62f8c17c2b07c412111e0022" source = "git+https://github.com/jgraham/webdriver-rust.git#038c1828c5dd4ab7b8f70b3d859c0ff988e6ca25"
dependencies = [ dependencies = [
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1274,11 +1280,11 @@ version = "0.0.1"
dependencies = [ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver 0.1.0 (git+https://github.com/jgraham/webdriver-rust.git)", "webdriver 0.2.0 (git+https://github.com/jgraham/webdriver-rust.git)",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -1286,22 +1292,22 @@ dependencies = [
name = "webdriver_traits" name = "webdriver_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.11.10" version = "0.11.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1314,7 +1320,7 @@ dependencies = [
[[package]] [[package]]
name = "x11" name = "x11"
version = "0.0.32" version = "0.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1326,7 +1332,7 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]

View file

@ -32,8 +32,8 @@ pub enum ServoBrowser {
impl ServoBrowser { impl ServoBrowser {
fn handle_event(&mut self, event: WindowEvent) { fn handle_event(&mut self, event: WindowEvent) {
match *self { match *self {
ServoBrowser::OnScreen(ref mut browser) => { browser.handle_event(event); } ServoBrowser::OnScreen(ref mut browser) => { browser.handle_events(vec![event]); }
ServoBrowser::OffScreen(ref mut browser) => { browser.handle_event(event); } ServoBrowser::OffScreen(ref mut browser) => { browser.handle_events(vec![event]); }
ServoBrowser::Invalid => {} ServoBrowser::Invalid => {}
} }
} }

View file

@ -100,8 +100,8 @@ impl Window {
} }
/// Currently unimplemented. /// Currently unimplemented.
pub fn wait_events(&self) -> WindowEvent { pub fn wait_events(&self) -> Vec<WindowEvent> {
WindowEvent::Idle vec![WindowEvent::Idle]
} }
fn cursor_type_for_cursor(&self, cursor: Cursor) -> cef_cursor_type_t { fn cursor_type_for_cursor(&self, cursor: Cursor) -> cef_cursor_type_t {

View file

@ -14,13 +14,15 @@ use layers::geometry::DevicePixel;
use layers::platform::surface::NativeGraphicsMetadata; use layers::platform::surface::NativeGraphicsMetadata;
use msg::constellation_msg; use msg::constellation_msg;
use msg::constellation_msg::Key; use msg::constellation_msg::Key;
use NestedEventLoopListener; use std::mem;
use std::rc::Rc; use std::rc::Rc;
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::{channel, Sender};
use url::Url; use url::Url;
use util::cursor::Cursor; use util::cursor::Cursor;
use util::geometry::ScreenPx; use util::geometry::ScreenPx;
use NestedEventLoopListener;
#[cfg(feature = "window")] #[cfg(feature = "window")]
use compositing::windowing::{MouseWindowEvent, WindowNavigateMsg}; use compositing::windowing::{MouseWindowEvent, WindowNavigateMsg};
#[cfg(feature = "window")] #[cfg(feature = "window")]
@ -259,7 +261,16 @@ impl Window {
#[cfg(target_os="macos")] #[cfg(target_os="macos")]
fn handle_next_event(&self) -> bool { fn handle_next_event(&self) -> bool {
let event = self.window.wait_events().next().unwrap(); let event = self.window.wait_events().next().unwrap();
self.handle_window_event(event) let mut close = self.handle_window_event(event);
if !close {
while let Some(event) = self.window.poll_events().next() {
if self.handle_window_event(event) {
close = true;
break
}
}
}
close
} }
#[cfg(any(target_os="linux", target_os="android"))] #[cfg(any(target_os="linux", target_os="android"))]
@ -283,7 +294,9 @@ impl Window {
// //
// See https://github.com/servo/servo/issues/5780 // See https://github.com/servo/servo/issues/5780
// //
match self.window.poll_events().next() { let first_event = self.window.poll_events().next();
match first_event {
Some(event) => { Some(event) => {
self.handle_window_event(event) self.handle_window_event(event)
} }
@ -294,40 +307,27 @@ impl Window {
} }
} }
pub fn wait_events(&self) -> WindowEvent { pub fn wait_events(&self) -> Vec<WindowEvent> {
{ let mut events = mem::replace(&mut *self.event_queue.borrow_mut(), Vec::new());
let mut event_queue = self.event_queue.borrow_mut();
if !event_queue.is_empty() {
return event_queue.remove(0);
}
}
let mut close_event = false; let mut close_event = false;
// When writing to a file then exiting, use event // When writing to a file then exiting, use event
// polling so that we don't block on a GUI event // polling so that we don't block on a GUI event
// such as mouse click. // such as mouse click.
if opts::get().output_file.is_some() { if opts::get().output_file.is_some() {
for event in self.window.poll_events() { while let Some(event) = self.window.poll_events().next() {
close_event = self.handle_window_event(event); close_event = self.handle_window_event(event) || close_event;
if close_event {
break;
}
} }
} else { } else {
close_event = self.handle_next_event(); close_event = self.handle_next_event();
} }
if close_event || self.window.is_closed() { if close_event || self.window.is_closed() {
WindowEvent::Quit events.push(WindowEvent::Quit)
} else {
let mut event_queue = self.event_queue.borrow_mut();
if event_queue.is_empty() {
WindowEvent::Idle
} else {
event_queue.remove(0)
}
} }
events.extend(mem::replace(&mut *self.event_queue.borrow_mut(), Vec::new()).into_iter());
events
} }
pub unsafe fn set_nested_event_loop_listener( pub unsafe fn set_nested_event_loop_listener(
@ -634,8 +634,8 @@ impl Window {
Rc::new(window) Rc::new(window)
} }
pub fn wait_events(&self) -> WindowEvent { pub fn wait_events(&self) -> Vec<WindowEvent> {
WindowEvent::Idle vec![WindowEvent::Idle]
} }
pub unsafe fn set_nested_event_loop_listener( pub unsafe fn set_nested_event_loop_listener(

209
ports/gonk/Cargo.lock generated
View file

@ -20,7 +20,7 @@ dependencies = [
"script_traits 0.0.1", "script_traits 0.0.1",
"servo 0.0.1", "servo 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -55,15 +55,28 @@ name = "canvas"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx_traits 0.0.1",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.0.1 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.0.1 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "canvas_traits"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx_traits 0.0.1",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
]
[[package]] [[package]]
name = "cgl" name = "cgl"
version = "0.0.1" version = "0.0.1"
@ -101,6 +114,7 @@ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout_traits 0.0.1", "layout_traits 0.0.1",
@ -114,20 +128,20 @@ dependencies = [
"script_traits 0.0.1", "script_traits 0.0.1",
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
[[package]] [[package]]
name = "cookie" name = "cookie"
version = "0.1.19" version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -141,7 +155,7 @@ dependencies = [
[[package]] [[package]]
name = "core_graphics" name = "core_graphics"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-core-graphics#da0d2fe947412afea55b438454194b2183c21594" source = "git+https://github.com/servo/rust-core-graphics#2d8d665c5bdd116b4a1addbe5c415735fb78e1a9"
dependencies = [ dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -150,7 +164,7 @@ dependencies = [
[[package]] [[package]]
name = "core_text" name = "core_text"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-core-text#bc6994c3765f0660e9c04f5488ba194a9354e8fb" source = "git+https://github.com/servo/rust-core-text#2b4b546718310a9d3fe4273a1df092c79d9fb2c2"
dependencies = [ dependencies = [
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
@ -178,9 +192,9 @@ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -190,9 +204,9 @@ version = "0.0.1"
dependencies = [ dependencies = [
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -274,7 +288,7 @@ dependencies = [
[[package]] [[package]]
name = "expat-sys" name = "expat-sys"
version = "2.1.0" version = "2.1.0"
source = "git+https://github.com/servo/libexpat#5f798cfbb74650a5e1d95e4c03a9e41e55e28625" source = "git+https://github.com/servo/libexpat#91775ceb69adaea0ce903271b185079a2c484f57"
[[package]] [[package]]
name = "flate2" name = "flate2"
@ -323,7 +337,7 @@ source = "git+https://github.com/servo/libfreetype2#50c1cf412d87f20ccbb940e39a14
[[package]] [[package]]
name = "gcc" name = "gcc"
version = "0.3.4" version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -334,7 +348,7 @@ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -343,12 +357,14 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)", "core_graphics 0.1.0 (git+https://github.com/servo/rust-core-graphics)",
"core_text 0.1.0 (git+https://github.com/servo/rust-core-text)", "core_text 0.1.0 (git+https://github.com/servo/rust-core-text)",
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx_traits 0.0.1",
"harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)", "harfbuzz 0.1.0 (git+https://github.com/servo/rust-harfbuzz)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -358,17 +374,24 @@ dependencies = [
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1", "script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia)", "skia 0.0.20130412 (git+https://github.com/servo/skia)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
[[package]]
name = "gfx_traits"
version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
]
[[package]] [[package]]
name = "gl_common" name = "gl_common"
version = "0.0.4" version = "0.0.4"
@ -379,7 +402,7 @@ dependencies = [
[[package]] [[package]]
name = "gl_generator" name = "gl_generator"
version = "0.0.24" version = "0.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -393,7 +416,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/gleam#f2edabf2ef0474bb270b107e5e68c2727c4a422d" source = "git+https://github.com/servo/gleam#f2edabf2ef0474bb270b107e5e68c2727c4a422d"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -404,7 +427,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/rust-glx#60ac0aee2438eadb4b51ddc8eac6fc4b5ca8e447" source = "git+https://github.com/servo/rust-glx#60ac0aee2438eadb4b51ddc8eac6fc4b5ca8e447"
dependencies = [ dependencies = [
"gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "gl_common 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -420,7 +443,7 @@ dependencies = [
[[package]] [[package]]
name = "html5ever" name = "html5ever"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/html5ever#74dc5f5a36451cfbe789488b20d51bef97c63898" source = "git+https://github.com/servo/html5ever#7ddaa598b84e5e7fb9bf5313c02c1aaca970cb4b"
dependencies = [ dependencies = [
"html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)", "html5ever_macros 0.0.0 (git+https://github.com/servo/html5ever)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -435,10 +458,10 @@ dependencies = [
[[package]] [[package]]
name = "html5ever_macros" name = "html5ever_macros"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/html5ever#74dc5f5a36451cfbe789488b20d51bef97c63898" source = "git+https://github.com/servo/html5ever#7ddaa598b84e5e7fb9bf5313c02c1aaca970cb4b"
dependencies = [ dependencies = [
"mac 0.0.2 (git+https://github.com/reem/rust-mac)", "mac 0.0.2 (git+https://github.com/reem/rust-mac)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -446,42 +469,23 @@ name = "httparse"
version = "0.1.1" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "hyper" name = "hyper"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -504,7 +508,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -535,7 +539,7 @@ dependencies = [
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)", "io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"skia 0.0.20130412 (git+https://github.com/servo/skia)", "skia 0.0.20130412 (git+https://github.com/servo/skia)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
] ]
@ -547,11 +551,13 @@ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1",
"clock_ticks 0.0.5 (git+https://github.com/tomaka/clock_ticks)", "clock_ticks 0.0.5 (git+https://github.com/tomaka/clock_ticks)",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1",
"layout_traits 0.0.1", "layout_traits 0.0.1",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
@ -559,14 +565,14 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1", "script 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -574,12 +580,13 @@ dependencies = [
name = "layout_traits" name = "layout_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1", "gfx 0.0.1",
"msg 0.0.1", "msg 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -626,7 +633,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "mime" name = "mime"
version = "0.0.10" version = "0.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -637,7 +644,7 @@ name = "miniz-sys"
version = "0.1.4" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -664,7 +671,7 @@ dependencies = [
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"style 0.0.1", "style 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -673,19 +680,19 @@ dependencies = [
name = "net" name = "net"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net_traits 0.0.1", "net_traits 0.0.1",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "regex_macros 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -699,7 +706,7 @@ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)", "stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -709,7 +716,7 @@ version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -723,13 +730,14 @@ dependencies = [
[[package]] [[package]]
name = "offscreen_gl_context" name = "offscreen_gl_context"
version = "0.0.1" version = "0.0.1"
source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#c2b3dfd7fe344384e4206672b99c296141f5b4d6" source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#97eacf34b72f69b10130a0de016529e98ee32f04"
dependencies = [ dependencies = [
"cgl 0.0.1 (git+https://github.com/servo/rust-cgl)", "cgl 0.0.1 (git+https://github.com/servo/rust-cgl)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)", "core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)", "geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gleam 0.0.1 (git+https://github.com/servo/gleam)", "gleam 0.0.1 (git+https://github.com/servo/gleam)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)", "glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"xlib 0.1.0 (git+https://github.com/servo/rust-xlib)", "xlib 0.1.0 (git+https://github.com/servo/rust-xlib)",
@ -737,24 +745,24 @@ dependencies = [
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.6.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -791,14 +799,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.3" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "plugins" name = "plugins"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"tenacious 0.0.1 (git+https://github.com/Manishearth/rust-tenacious.git)", "tenacious 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -814,7 +822,7 @@ name = "png"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/servo/rust-png#34fca101357da41b2b8c95f3efe6cb88a2b36bca" source = "git+https://github.com/servo/rust-png#34fca101357da41b2b8c95f3efe6cb88a2b36bca"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"png-sys 1.6.16 (git+https://github.com/servo/rust-png)", "png-sys 1.6.16 (git+https://github.com/servo/rust-png)",
] ]
@ -841,7 +849,7 @@ name = "profile_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -872,7 +880,7 @@ dependencies = [
[[package]] [[package]]
name = "rustc-serialize" name = "rustc-serialize"
version = "0.3.13" version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
@ -881,6 +889,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1",
"cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
@ -896,7 +905,7 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1", "script_traits 0.0.1",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
@ -904,11 +913,11 @@ dependencies = [
"style 0.0.1", "style 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
"websocket 0.11.10 (registry+https://github.com/rust-lang/crates.io-index)", "websocket 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -920,7 +929,7 @@ dependencies = [
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -958,7 +967,7 @@ dependencies = [
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script 0.0.1", "script 0.0.1",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"webdriver_server 0.0.1", "webdriver_server 0.0.1",
] ]
@ -1026,11 +1035,11 @@ dependencies = [
"mod_path 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "mod_path 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
] ]
@ -1048,15 +1057,15 @@ dependencies = [
[[package]] [[package]]
name = "tenacious" name = "tenacious"
version = "0.0.1" version = "0.0.3"
source = "git+https://github.com/Manishearth/rust-tenacious.git#5112359cd36682cd7df3a7bb9a963299890be26c" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.25" version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"gcc 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1077,11 +1086,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "url" name = "url"
version = "0.2.31" version = "0.2.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1100,13 +1109,13 @@ dependencies = [
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"smallvec 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.1.0 (git+https://github.com/servo/string-cache)", "string_cache 0.1.0 (git+https://github.com/servo/string-cache)",
"string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)", "string_cache_plugin 0.1.1 (git+https://github.com/servo/string-cache)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -1115,18 +1124,18 @@ version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "webdriver" name = "webdriver"
version = "0.1.0" version = "0.2.0"
source = "git+https://github.com/jgraham/webdriver-rust.git#4065017191f1054b62f8c17c2b07c412111e0022" source = "git+https://github.com/jgraham/webdriver-rust.git#038c1828c5dd4ab7b8f70b3d859c0ff988e6ca25"
dependencies = [ dependencies = [
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1136,11 +1145,11 @@ version = "0.0.1"
dependencies = [ dependencies = [
"msg 0.0.1", "msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1", "util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver 0.1.0 (git+https://github.com/jgraham/webdriver-rust.git)", "webdriver 0.2.0 (git+https://github.com/jgraham/webdriver-rust.git)",
"webdriver_traits 0.0.1", "webdriver_traits 0.0.1",
] ]
@ -1148,22 +1157,22 @@ dependencies = [
name = "webdriver_traits" name = "webdriver_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "websocket" name = "websocket"
version = "0.11.10" version = "0.11.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]

Some files were not shown because too many files have changed in this diff Show more