Merge branch 'master' into fix-local-urls-only-10147

This commit is contained in:
Stjepan Glavina 2016-03-24 13:45:25 +01:00
commit 4965c93d16
37 changed files with 193 additions and 165 deletions

View file

@ -1,5 +1,10 @@
version: 1.0.{build} version: 1.0.{build}
environment:
PATH: 'C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%'
MSYSTEM: 'MSYS'
MSYS: 'winsymlinks=lnk'
branches: branches:
only: only:
- master - master
@ -13,9 +18,6 @@ cache:
- .cargo - .cargo
install: install:
- set MSYSTEM=MSYS
- set MSYS="winsymlinks=lnk"
- PATH C:\msys64\mingw64\bin;C:\msys64\usr\bin\;%PATH%
- bash -lc "echo $MSYSTEM; pacman --needed --noconfirm -Sy pacman-mirrors" - bash -lc "echo $MSYSTEM; pacman --needed --noconfirm -Sy pacman-mirrors"
- bash -lc "pacman --noconfirm -Sy" - bash -lc "pacman --noconfirm -Sy"
- bash -lc "pacman -Sy --needed --noconfirm git mingw-w64-x86_64-toolchain mingw-w64-x86_64-freetype mingw-w64-x86_64-icu mingw-w64-x86_64-nspr mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-expat mingw-w64-x86_64-cmake tar diffutils patch patchutils make python2-setuptools" - bash -lc "pacman -Sy --needed --noconfirm git mingw-w64-x86_64-toolchain mingw-w64-x86_64-freetype mingw-w64-x86_64-icu mingw-w64-x86_64-nspr mingw-w64-x86_64-ca-certificates mingw-w64-x86_64-expat mingw-w64-x86_64-cmake tar diffutils patch patchutils make python2-setuptools"
@ -31,4 +33,4 @@ build_script:
bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./mach build -d -v" bash -lc "cd $APPVEYOR_BUILD_FOLDER; ./mach build -d -v"
test: off test: off

View file

@ -15,12 +15,11 @@ use gfx_traits::color;
use ipc_channel::ipc::IpcSharedMemory; use ipc_channel::ipc::IpcSharedMemory;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layers::platform::surface::NativeSurface;
use num::ToPrimitive; use num::ToPrimitive;
use premultiplytable::PREMULTIPLY_TABLE; use premultiplytable::PREMULTIPLY_TABLE;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::mem; use std::mem;
use std::sync::mpsc::{Sender, channel}; use std::sync::mpsc::channel;
use util::opts; use util::opts;
use util::thread::spawn_named; use util::thread::spawn_named;
use util::vec::byte_swap; use util::vec::byte_swap;
@ -205,13 +204,6 @@ impl<'a> CanvasPaintThread<'a> {
} }
} }
} }
CanvasMsg::FromPaint(message) => {
match message {
FromPaintMsg::SendNativeSurface(chan) => {
painter.send_native_surface(chan)
}
}
}
CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D thread"), CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D thread"),
} }
} }
@ -550,12 +542,6 @@ impl<'a> CanvasPaintThread<'a> {
}) })
} }
fn send_native_surface(&self, _chan: Sender<NativeSurface>) {
// FIXME(mrobinson): We need a handle on the NativeDisplay to create compatible
// NativeSurfaces for the compositor.
unimplemented!()
}
fn image_data(&self, fn image_data(&self,
dest_rect: Rect<i32>, dest_rect: Rect<i32>,
canvas_size: Size2D<f64>, canvas_size: Size2D<f64>,

View file

@ -2,16 +2,14 @@
* 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_traits::{CanvasCommonMsg, CanvasMsg, CanvasPixelData, CanvasData, CanvasWebGLMsg}; use canvas_traits::{CanvasCommonMsg, CanvasMsg, CanvasPixelData, CanvasData, CanvasWebGLMsg, FromLayoutMsg};
use canvas_traits::{FromLayoutMsg, FromPaintMsg};
use euclid::size::Size2D; use euclid::size::Size2D;
use gleam::gl; use gleam::gl;
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layers::platform::surface::NativeSurface;
use offscreen_gl_context::{ColorAttachmentType, GLContext, GLContextAttributes, NativeGLContext}; use offscreen_gl_context::{ColorAttachmentType, GLContext, GLContextAttributes, NativeGLContext};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::sync::mpsc::{Sender, channel}; use std::sync::mpsc::channel;
use util::thread::spawn_named; use util::thread::spawn_named;
use util::vec::byte_swap; use util::vec::byte_swap;
use webrender_traits; use webrender_traits;
@ -83,7 +81,7 @@ impl WebGLPaintThread {
CanvasMsg::Common(message) => { CanvasMsg::Common(message) => {
match message { match message {
CanvasCommonMsg::Close => break, CanvasCommonMsg::Close => break,
// TODO(ecoal95): handle error nicely // TODO(emilio): handle error nicely
CanvasCommonMsg::Recreate(size) => painter.recreate(size).unwrap(), CanvasCommonMsg::Recreate(size) => painter.recreate(size).unwrap(),
} }
}, },
@ -93,12 +91,6 @@ impl WebGLPaintThread {
painter.send_data(chan), painter.send_data(chan),
} }
} }
CanvasMsg::FromPaint(message) => {
match message {
FromPaintMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
}
}
CanvasMsg::Canvas2d(_) => panic!("Wrong message sent to WebGLThread"), CanvasMsg::Canvas2d(_) => panic!("Wrong message sent to WebGLThread"),
} }
} }
@ -147,12 +139,6 @@ impl WebGLPaintThread {
} }
} }
fn send_native_surface(&self, _: Sender<NativeSurface>) {
// FIXME(ecoal95): We need to make a clone of the surface in order to
// implement this
unimplemented!()
}
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn recreate(&mut self, size: Size2D<i32>) -> Result<(), &'static str> { fn recreate(&mut self, size: Size2D<i32>) -> Result<(), &'static str> {
match self.data { match self.data {

View file

@ -15,10 +15,6 @@ path = "../gfx_traits"
git = "https://github.com/servo/rust-azure" git = "https://github.com/servo/rust-azure"
features = ["plugins"] features = ["plugins"]
[dependencies.layers]
git = "https://github.com/servo/rust-layers"
features = ["plugins"]
[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"

View file

@ -17,7 +17,6 @@ extern crate euclid;
extern crate gfx_traits; extern crate gfx_traits;
extern crate heapsize; extern crate heapsize;
extern crate ipc_channel; extern crate ipc_channel;
extern crate layers;
extern crate offscreen_gl_context; extern crate offscreen_gl_context;
extern crate serde; extern crate serde;
extern crate util; extern crate util;
@ -35,11 +34,8 @@ use euclid::rect::Rect;
use euclid::size::Size2D; use euclid::size::Size2D;
use gfx_traits::color; use gfx_traits::color;
use ipc_channel::ipc::{IpcSender, IpcSharedMemory}; use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
use layers::platform::surface::NativeSurface;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::default::Default; use std::default::Default;
use std::str::FromStr; use std::str::FromStr;
use std::sync::mpsc::Sender;
pub use webrender_traits::{WebGLFramebufferBindingRequest, WebGLError, WebGLParameter, WebGLResult, WebGLContextId}; pub use webrender_traits::{WebGLFramebufferBindingRequest, WebGLError, WebGLParameter, WebGLResult, WebGLContextId};
pub use webrender_traits::WebGLCommand as CanvasWebGLMsg; pub use webrender_traits::WebGLCommand as CanvasWebGLMsg;
@ -55,7 +51,6 @@ pub enum CanvasMsg {
Canvas2d(Canvas2dMsg), Canvas2d(Canvas2dMsg),
Common(CanvasCommonMsg), Common(CanvasCommonMsg),
FromLayout(FromLayoutMsg), FromLayout(FromLayoutMsg),
FromPaint(FromPaintMsg),
WebGL(CanvasWebGLMsg), WebGL(CanvasWebGLMsg),
} }
@ -82,23 +77,6 @@ pub enum FromLayoutMsg {
SendData(IpcSender<CanvasData>), SendData(IpcSender<CanvasData>),
} }
#[derive(Clone)]
pub enum FromPaintMsg {
SendNativeSurface(Sender<NativeSurface>),
}
impl Serialize for FromPaintMsg {
fn serialize<S>(&self, _: &mut S) -> Result<(), S::Error> where S: Serializer {
panic!("can't serialize a `FromPaintMsg`!")
}
}
impl Deserialize for FromPaintMsg {
fn deserialize<D>(_: &mut D) -> Result<FromPaintMsg, D::Error> where D: Deserializer {
panic!("can't deserialize a `FromPaintMsg`!")
}
}
#[derive(Clone, Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize)]
pub enum Canvas2dMsg { pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool), Arc(Point2D<f32>, f32, f32, f32, bool),

View file

@ -1144,7 +1144,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
layer_id: LayerId, layer_id: LayerId,
point: Point2D<f32>) { point: Point2D<f32>) {
if self.move_layer(pipeline_id, layer_id, Point2D::from_untyped(&point)) { if self.move_layer(pipeline_id, layer_id, Point2D::from_untyped(&point)) {
self.perform_updates_after_scroll() self.perform_updates_after_scroll();
self.send_viewport_rects_for_all_layers()
} else { } else {
self.fragment_point = Some(point) self.fragment_point = Some(point)
} }

View file

@ -77,6 +77,12 @@ struct EvaluateJSReply {
helperResult: Json, helperResult: Json,
} }
#[derive(RustcEncodable)]
struct SetPreferencesReply {
from: String,
updated: Vec<String>,
}
pub struct ConsoleActor { pub struct ConsoleActor {
pub name: String, pub name: String,
pub pipeline: PipelineId, pub pipeline: PipelineId,
@ -237,6 +243,15 @@ impl Actor for ConsoleActor {
ActorMessageStatus::Processed ActorMessageStatus::Processed
} }
"setPreferences" => {
let msg = SetPreferencesReply {
from: self.name(),
updated: vec![],
};
stream.write_json_packet(&msg);
ActorMessageStatus::Processed
}
_ => ActorMessageStatus::Ignored _ => ActorMessageStatus::Ignored
}) })
} }

View file

@ -21,12 +21,14 @@ struct ActorTraits {
} }
#[derive(RustcEncodable)] #[derive(RustcEncodable)]
struct ErrorReply { struct ListAddonsReply {
from: String, from: String,
error: String, addons: Vec<AddonMsg>,
message: String,
} }
#[derive(RustcEncodable)]
enum AddonMsg {}
#[derive(RustcEncodable)] #[derive(RustcEncodable)]
struct ListTabsReply { struct ListTabsReply {
from: String, from: String,
@ -57,10 +59,9 @@ impl Actor for RootActor {
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> { stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type { Ok(match msg_type {
"listAddons" => { "listAddons" => {
let actor = ErrorReply { let actor = ListAddonsReply {
from: "root".to_owned(), from: "root".to_owned(),
error: "noAddons".to_owned(), addons: vec![],
message: "This root actor has no browser addons.".to_owned(),
}; };
stream.write_json_packet(&actor); stream.write_json_packet(&actor);
ActorMessageStatus::Processed ActorMessageStatus::Processed

View file

@ -74,6 +74,7 @@ pub struct TabActor {
pub timeline: String, pub timeline: String,
pub profiler: String, pub profiler: String,
pub performance: String, pub performance: String,
pub thread: String,
} }
impl Actor for TabActor { impl Actor for TabActor {
@ -98,7 +99,7 @@ impl Actor for TabActor {
let msg = TabAttachedReply { let msg = TabAttachedReply {
from: self.name(), from: self.name(),
__type__: "tabAttached".to_owned(), __type__: "tabAttached".to_owned(),
threadActor: self.name(), threadActor: self.thread.clone(),
cacheDisabled: false, cacheDisabled: false,
javascriptEnabled: true, javascriptEnabled: true,
traits: TabTraits, traits: TabTraits,

View file

@ -0,0 +1,90 @@
/* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
use protocol::JsonPacketStream;
use rustc_serialize::json;
use std::net::TcpStream;
#[derive(RustcEncodable)]
struct ThreadAttachedReply {
from: String,
__type__: String,
actor: String,
poppedFrames: Vec<PoppedFrameMsg>,
why: WhyMsg,
}
#[derive(RustcEncodable)]
enum PoppedFrameMsg {}
#[derive(RustcEncodable)]
struct WhyMsg {
__type__: String,
}
#[derive(RustcEncodable)]
struct ThreadResumedReply {
from: String,
__type__: String,
}
#[derive(RustcEncodable)]
struct ReconfigureReply {
from: String
}
pub struct ThreadActor {
name: String,
}
impl ThreadActor {
pub fn new(name: String) -> ThreadActor {
ThreadActor {
name: name,
}
}
}
impl Actor for ThreadActor {
fn name(&self) -> String {
self.name.clone()
}
fn handle_message(&self,
registry: &ActorRegistry,
msg_type: &str,
_msg: &json::Object,
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
"attach" => {
let msg = ThreadAttachedReply {
from: self.name(),
__type__: "paused".to_owned(),
actor: registry.new_name("pause"),
poppedFrames: vec![],
why: WhyMsg { __type__: "attached".to_owned() },
};
stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},
"resume" => {
let msg = ThreadResumedReply {
from: self.name(),
__type__: "resumed".to_owned(),
};
stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},
"reconfigure" => {
stream.write_json_packet(&ReconfigureReply { from: self.name() });
ActorMessageStatus::Processed
}
_ => ActorMessageStatus::Ignored,
})
}
}

View file

@ -42,6 +42,7 @@ use actors::performance::PerformanceActor;
use actors::profiler::ProfilerActor; use actors::profiler::ProfilerActor;
use actors::root::RootActor; use actors::root::RootActor;
use actors::tab::TabActor; use actors::tab::TabActor;
use actors::thread::ThreadActor;
use actors::timeline::TimelineActor; use actors::timeline::TimelineActor;
use actors::worker::WorkerActor; use actors::worker::WorkerActor;
use devtools_traits::{ChromeToDevtoolsControlMsg, ConsoleMessage, DevtoolsControlMsg}; use devtools_traits::{ChromeToDevtoolsControlMsg, ConsoleMessage, DevtoolsControlMsg};
@ -73,6 +74,7 @@ mod actors {
pub mod profiler; pub mod profiler;
pub mod root; pub mod root;
pub mod tab; pub mod tab;
pub mod thread;
pub mod timeline; pub mod timeline;
pub mod worker; pub mod worker;
} }
@ -248,7 +250,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
let (pipeline, worker_id) = ids; let (pipeline, worker_id) = ids;
//TODO: move all this actor creation into a constructor method on TabActor //TODO: move all this actor creation into a constructor method on TabActor
let (tab, console, inspector, timeline, profiler, performance) = { let (tab, console, inspector, timeline, profiler, performance, thread) = {
let console = ConsoleActor { let console = ConsoleActor {
name: actors.new_name("console"), name: actors.new_name("console"),
script_chan: script_sender.clone(), script_chan: script_sender.clone(),
@ -271,6 +273,8 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
let profiler = ProfilerActor::new(actors.new_name("profiler")); let profiler = ProfilerActor::new(actors.new_name("profiler"));
let performance = PerformanceActor::new(actors.new_name("performance")); let performance = PerformanceActor::new(actors.new_name("performance"));
let thread = ThreadActor::new(actors.new_name("context"));
let DevtoolsPageInfo { title, url } = page_info; let DevtoolsPageInfo { title, url } = page_info;
let tab = TabActor { let tab = TabActor {
name: actors.new_name("tab"), name: actors.new_name("tab"),
@ -281,12 +285,13 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
timeline: timeline.name(), timeline: timeline.name(),
profiler: profiler.name(), profiler: profiler.name(),
performance: performance.name(), performance: performance.name(),
thread: thread.name(),
}; };
let root = actors.find_mut::<RootActor>("root"); let root = actors.find_mut::<RootActor>("root");
root.tabs.push(tab.name.clone()); root.tabs.push(tab.name.clone());
(tab, console, inspector, timeline, profiler, performance) (tab, console, inspector, timeline, profiler, performance, thread)
}; };
if let Some(id) = worker_id { if let Some(id) = worker_id {
@ -306,6 +311,7 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
actors.register(box timeline); actors.register(box timeline);
actors.register(box profiler); actors.register(box profiler);
actors.register(box performance); actors.register(box performance);
actors.register(box thread);
} }
fn handle_console_message(actors: Arc<Mutex<ActorRegistry>>, fn handle_console_message(actors: Arc<Mutex<ActorRegistry>>,

View file

@ -41,9 +41,6 @@ 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

@ -25,7 +25,6 @@ extern crate app_units;
extern crate azure; extern crate azure;
#[macro_use] #[macro_use]
extern crate bitflags; extern crate bitflags;
extern crate canvas_traits;
// Mac OS-specific library dependencies // Mac OS-specific library dependencies
#[cfg(target_os = "macos")] extern crate core_foundation; #[cfg(target_os = "macos")] extern crate core_foundation;

View file

@ -7,7 +7,6 @@
use app_units::Au; use app_units::Au;
use azure::AzFloat; use azure::AzFloat;
use azure::azure_hl::{BackendType, Color, DrawTarget, SurfaceFormat}; use azure::azure_hl::{BackendType, Color, DrawTarget, SurfaceFormat};
use canvas_traits::CanvasMsg;
use display_list::{DisplayItem, DisplayList, DisplayListEntry, DisplayListTraversal}; use display_list::{DisplayItem, DisplayList, DisplayListEntry, DisplayListTraversal};
use display_list::{LayerInfo, StackingContext, StackingContextId, StackingContextType}; use display_list::{LayerInfo, StackingContext, StackingContextId, StackingContextType};
use euclid::Matrix4; use euclid::Matrix4;
@ -343,7 +342,6 @@ pub enum Msg {
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub enum LayoutToPaintMsg { pub enum LayoutToPaintMsg {
PaintInit(Epoch, Arc<DisplayList>), PaintInit(Epoch, Arc<DisplayList>),
CanvasLayer(LayerId, IpcSender<CanvasMsg>),
Exit(IpcSender<()>), Exit(IpcSender<()>),
} }
@ -379,9 +377,6 @@ pub struct PaintThread<C> {
/// Communication handles to each of the worker threads. /// Communication handles to each of the worker threads.
worker_threads: Vec<WorkerThreadProxy>, worker_threads: Vec<WorkerThreadProxy>,
/// A map to track the canvas specific layers
canvas_map: HashMap<LayerId, IpcSender<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
@ -431,7 +426,6 @@ impl<C> PaintThread<C> where C: PaintListener + Send + 'static {
paint_permission: false, paint_permission: false,
current_epoch: None, current_epoch: None,
worker_threads: worker_threads, worker_threads: worker_threads,
canvas_map: HashMap::new()
}; };
let reporter_name = format!("paint-reporter-{}", id); let reporter_name = format!("paint-reporter-{}", id);
@ -475,11 +469,6 @@ impl<C> PaintThread<C> where C: PaintListener + Send + 'static {
self.initialize_layers(); self.initialize_layers();
} }
} }
// Inserts a new canvas renderer to the layer map
Msg::FromLayout(LayoutToPaintMsg::CanvasLayer(layer_id, canvas_renderer)) => {
debug!("Renderer received for canvas with layer {:?}", layer_id);
self.canvas_map.insert(layer_id, canvas_renderer);
}
Msg::FromChrome(ChromeToPaintMsg::Paint(requests, frame_tree_id)) => { Msg::FromChrome(ChromeToPaintMsg::Paint(requests, frame_tree_id)) => {
if self.paint_permission && self.root_display_list.is_some() { if self.paint_permission && self.root_display_list.is_some() {
let mut replies = Vec::new(); let mut replies = Vec::new();

View file

@ -12,9 +12,6 @@ path = "lib.rs"
git = "https://github.com/servo/rust-azure" git = "https://github.com/servo/rust-azure"
features = ["plugins"] features = ["plugins"]
[dependencies.canvas]
path = "../canvas"
[dependencies.canvas_traits] [dependencies.canvas_traits]
path = "../canvas_traits" path = "../canvas_traits"

View file

@ -8,7 +8,6 @@
#![allow(unsafe_code)] #![allow(unsafe_code)]
use app_units::Au; use app_units::Au;
use canvas_traits::CanvasMsg;
use euclid::Rect; use euclid::Rect;
use fnv::FnvHasher; use fnv::FnvHasher;
use gfx::display_list::WebRenderImageInfo; use gfx::display_list::WebRenderImageInfo;
@ -16,7 +15,7 @@ use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext; use gfx::font_context::FontContext;
use gfx_traits::LayerId; use gfx_traits::LayerId;
use heapsize::HeapSizeOf; use heapsize::HeapSizeOf;
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; use ipc_channel::ipc::{self, IpcSharedMemory};
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResponse, ImageState}; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResponse, ImageState};
use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder}; use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
@ -24,7 +23,6 @@ use std::cell::{RefCell, RefMut};
use std::collections::HashMap; use std::collections::HashMap;
use std::hash::BuildHasherDefault; use std::hash::BuildHasherDefault;
use std::rc::Rc; use std::rc::Rc;
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex, RwLock}; use std::sync::{Arc, Mutex, RwLock};
use style::context::{LocalStyleContext, StyleContext}; use style::context::{LocalStyleContext, StyleContext};
use style::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache}; use style::matching::{ApplicableDeclarationsCache, StyleSharingCandidateCache};
@ -95,9 +93,6 @@ pub struct SharedLayoutContext {
/// The URL. /// The URL.
pub url: Url, pub url: Url,
/// A channel to send canvas renderers to paint thread, in order to correctly paint the layers
pub canvas_layers_sender: Mutex<Sender<(LayerId, IpcSender<CanvasMsg>)>>,
/// The visible rects for each layer, as reported to us by the compositor. /// The visible rects for each layer, as reported to us by the compositor.
pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, BuildHasherDefault<FnvHasher>>>, pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, BuildHasherDefault<FnvHasher>>>,

View file

@ -1197,13 +1197,7 @@ impl FragmentDisplayListBuilding for Fragment {
let (sender, receiver) = ipc::channel().unwrap(); let (sender, receiver) = ipc::channel().unwrap();
ipc_renderer.send(CanvasMsg::FromLayout( ipc_renderer.send(CanvasMsg::FromLayout(
FromLayoutMsg::SendData(sender))).unwrap(); FromLayoutMsg::SendData(sender))).unwrap();
let data = receiver.recv().unwrap(); receiver.recv().unwrap()
// Propagate the layer and the renderer to the paint task.
state.layout_context.shared.canvas_layers_sender.lock().unwrap().send(
(layer_id, (*ipc_renderer).clone())).unwrap();
data
}, },
None => CanvasData::Pixels(CanvasPixelData { None => CanvasData::Pixels(CanvasPixelData {
image_data: IpcSharedMemory::from_byte(0xFFu8, width * height * 4), image_data: IpcSharedMemory::from_byte(0xFFu8, width * height * 4),

View file

@ -10,7 +10,6 @@
use animation; use animation;
use app_units::Au; use app_units::Au;
use azure::azure::AzColor; use azure::azure::AzColor;
use canvas_traits::CanvasMsg;
use construct::ConstructionResult; use construct::ConstructionResult;
use context::{LayoutContext, SharedLayoutContext, heap_size_of_local_context}; use context::{LayoutContext, SharedLayoutContext, heap_size_of_local_context};
use display_list_builder::ToGfxColor; use display_list_builder::ToGfxColor;
@ -186,11 +185,6 @@ pub struct LayoutThread {
/// Is this the first reflow in this LayoutThread? /// Is this the first reflow in this LayoutThread?
first_reflow: bool, first_reflow: bool,
/// To receive a canvas renderer associated to a layer, this message is propagated
/// to the paint chan
canvas_layers_receiver: Receiver<(LayerId, IpcSender<CanvasMsg>)>,
canvas_layers_sender: Sender<(LayerId, IpcSender<CanvasMsg>)>,
/// The workers that we use for parallel operation. /// The workers that we use for parallel operation.
parallel_traversal: Option<WorkQueue<SharedLayoutContext, WorkQueueData>>, parallel_traversal: Option<WorkQueue<SharedLayoutContext, WorkQueueData>>,
@ -406,7 +400,6 @@ impl LayoutThread {
// 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 (canvas_layers_sender, canvas_layers_receiver) = channel();
// Proxy IPC messages from the pipeline to the layout thread. // Proxy IPC messages from the pipeline to the layout thread.
let pipeline_receiver = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(pipeline_port); let pipeline_receiver = ROUTER.route_ipc_receiver_to_new_mpsc_receiver(pipeline_port);
@ -449,8 +442,6 @@ impl LayoutThread {
image_cache_sender: ImageCacheChan(ipc_image_cache_sender), image_cache_sender: ImageCacheChan(ipc_image_cache_sender),
font_cache_receiver: font_cache_receiver, font_cache_receiver: font_cache_receiver,
font_cache_sender: ipc_font_cache_sender, font_cache_sender: ipc_font_cache_sender,
canvas_layers_receiver: canvas_layers_receiver,
canvas_layers_sender: canvas_layers_sender,
parallel_traversal: parallel_traversal, parallel_traversal: parallel_traversal,
generation: 0, generation: 0,
new_animations_sender: new_animations_sender, new_animations_sender: new_animations_sender,
@ -521,7 +512,6 @@ impl LayoutThread {
image_cache_thread: self.image_cache_thread.clone(), image_cache_thread: self.image_cache_thread.clone(),
image_cache_sender: Mutex::new(self.image_cache_sender.clone()), image_cache_sender: Mutex::new(self.image_cache_sender.clone()),
font_cache_thread: Mutex::new(self.font_cache_thread.clone()), font_cache_thread: Mutex::new(self.font_cache_thread.clone()),
canvas_layers_sender: Mutex::new(self.canvas_layers_sender.clone()),
url: (*url).clone(), url: (*url).clone(),
visible_rects: self.visible_rects.clone(), visible_rects: self.visible_rects.clone(),
webrender_image_cache: self.webrender_image_cache.clone(), webrender_image_cache: self.webrender_image_cache.clone(),
@ -1148,12 +1138,6 @@ impl LayoutThread {
self.root_flow = self.try_get_layout_root(node); self.root_flow = self.try_get_layout_root(node);
} }
// Send new canvas renderers to the paint thread
while let Ok((layer_id, renderer)) = self.canvas_layers_receiver.try_recv() {
// Just send if there's an actual renderer
self.paint_chan.send(LayoutToPaintMsg::CanvasLayer(layer_id, renderer)).unwrap();
}
// 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,

View file

@ -4,9 +4,6 @@
//! Traversals over the DOM and flow trees, running the layout computations. //! Traversals over the DOM and flow trees, running the layout computations.
// For thread_local.
#![allow(unsafe_code)]
use construct::FlowConstructor; use construct::FlowConstructor;
use context::{LayoutContext, SharedLayoutContext}; use context::{LayoutContext, SharedLayoutContext};
use display_list_builder::DisplayListBuildState; use display_list_builder::DisplayListBuildState;
@ -15,7 +12,7 @@ use flow::{self, Flow, CAN_BE_FRAGMENTED};
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
use incremental::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, RestyleDamage}; use incremental::{BUBBLE_ISIZES, REFLOW, REFLOW_OUT_OF_FLOW, REPAINT, RestyleDamage};
use std::mem; use std::mem;
use style::context::{StyleContext, ReflowGoal}; use style::context::StyleContext;
use style::matching::MatchMethods; use style::matching::MatchMethods;
use style::traversal::{DomTraversalContext, STYLE_BLOOM}; use style::traversal::{DomTraversalContext, STYLE_BLOOM};
use style::traversal::{put_thread_local_bloom_filter, recalc_style_at}; use style::traversal::{put_thread_local_bloom_filter, recalc_style_at};

View file

@ -186,6 +186,9 @@ pub enum Key {
RightAlt, RightAlt,
RightSuper, RightSuper,
Menu, Menu,
NavigateBackward,
NavigateForward,
} }
bitflags! { bitflags! {

View file

@ -294,6 +294,7 @@ fn basic_fetch(request: Rc<Request>) -> Response {
response.headers.set(ContentType(Mime( response.headers.set(ContentType(Mime(
TopLevel::Text, SubLevel::Html, TopLevel::Text, SubLevel::Html,
vec![(Attr::Charset, Value::Utf8)]))); vec![(Attr::Charset, Value::Utf8)])));
*response.body.lock().unwrap() = ResponseBody::Done(vec![]);
response response
}, },
_ => Response::network_error() _ => Response::network_error()

View file

@ -50,7 +50,7 @@ git = "https://github.com/servo/rust-mozjs"
git = "https://github.com/ecoal95/rust-offscreen-rendering-context" git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
[dependencies.angle] [dependencies.angle]
git = "https://github.com/ecoal95/angle" git = "https://github.com/emilio/angle"
branch = "servo" branch = "servo"
[dependencies.ipc-channel] [dependencies.ipc-channel]

View file

@ -5334,8 +5334,8 @@ class CGBindingRoot(CGThing):
# Do codegen for all the typdefs # Do codegen for all the typdefs
for t in typedefs: for t in typedefs:
if t.innerType.isUnion(): if t.innerType.isUnion():
cgthings.extend([CGGeneric("\npub type %s = %s;\n\n" % (t.identifier.name, cgthings.extend([CGGeneric("\npub use dom::bindings::codegen::UnionTypes::%s as %s;\n\n" %
"UnionTypes::" + str(t.innerType)))]) (t.innerType, t.identifier.name))])
else: else:
assert not typeNeedsRooting(t.innerType, config.getDescriptorProvider) assert not typeNeedsRooting(t.innerType, config.getDescriptorProvider)
cgthings.extend([CGGeneric("\npub type %s = " % (t.identifier.name)), cgthings.extend([CGGeneric("\npub type %s = " % (t.identifier.name)),

View file

@ -206,7 +206,7 @@ impl HTMLCanvasElement {
CanvasData::Pixels(pixel_data) CanvasData::Pixels(pixel_data)
=> pixel_data.image_data.to_vec(), => pixel_data.image_data.to_vec(),
CanvasData::WebGL(_) CanvasData::WebGL(_)
// TODO(ecoal95): Not sure if WebGL canvas is required for 2d spec, // TODO(emilio): Not sure if WebGL canvas is required for 2d spec,
// but I think it's not. // but I think it's not.
=> return None, => return None,
} }

View file

@ -148,7 +148,7 @@ impl KeyboardEvent {
} }
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3Events-key.html // https://w3c.github.io/uievents-key/#key-value-tables
pub fn key_value(key: Key, mods: KeyModifiers) -> &'static str { pub fn key_value(key: Key, mods: KeyModifiers) -> &'static str {
let shift = mods.contains(constellation_msg::SHIFT); let shift = mods.contains(constellation_msg::SHIFT);
match key { match key {
@ -319,6 +319,8 @@ pub fn key_value(key: Key, mods: KeyModifiers) -> &'static str {
Key::RightAlt => "Alt", Key::RightAlt => "Alt",
Key::RightSuper => "Super", Key::RightSuper => "Super",
Key::Menu => "ContextMenu", Key::Menu => "ContextMenu",
Key::NavigateForward => "BrowserForward",
Key::NavigateBackward => "BrowserBack",
} }
} }
@ -489,11 +491,13 @@ fn key_from_string(key_string: &str, location: u32) -> Option<Key> {
"Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightAlt), "Alt" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightAlt),
"Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightSuper), "Super" if location == KeyboardEventConstants::DOM_KEY_LOCATION_RIGHT => Some(Key::RightSuper),
"ContextMenu" => Some(Key::Menu), "ContextMenu" => Some(Key::Menu),
"BrowserForward" => Some(Key::NavigateForward),
"BrowserBack" => Some(Key::NavigateBackward),
_ => None _ => None
} }
} }
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3Events-code.html // https://w3c.github.io/uievents-code/#code-value-tables
fn code_value(key: Key) -> &'static str { fn code_value(key: Key) -> &'static str {
match key { match key {
Key::Space => "Space", Key::Space => "Space",
@ -613,7 +617,10 @@ fn code_value(key: Key) -> &'static str {
Key::LeftControl | Key::RightControl => "Control", Key::LeftControl | Key::RightControl => "Control",
Key::LeftAlt | Key::RightAlt => "Alt", Key::LeftAlt | Key::RightAlt => "Alt",
Key::LeftSuper | Key::RightSuper => "Super", Key::LeftSuper | Key::RightSuper => "Super",
Key::Menu => "Menu", Key::Menu => "ContextMenu",
Key::NavigateForward => "BrowserForward",
Key::NavigateBackward => "BrowserBackward",
} }
} }

View file

@ -96,7 +96,7 @@ impl WebGLProgram {
_ => return Err(WebGLError::InvalidOperation), _ => return Err(WebGLError::InvalidOperation),
}; };
// TODO(ecoal95): Differentiate between same shader already assigned and other previous // TODO(emilio): Differentiate between same shader already assigned and other previous
// shader. // shader.
if shader_slot.get().is_some() { if shader_slot.get().is_some() {
return Err(WebGLError::InvalidOperation); return Err(WebGLError::InvalidOperation);

View file

@ -610,7 +610,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
} }
} }
// TODO(ecoal95): Probably in the future we should keep track of the // TODO(emilio): Probably in the future we should keep track of the
// generated objects, either here or in the webgl thread // generated objects, either here or in the webgl thread
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
fn CreateBuffer(&self) -> Option<Root<WebGLBuffer>> { fn CreateBuffer(&self) -> Option<Root<WebGLBuffer>> {
@ -1116,8 +1116,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
if texture.is_none() { if texture.is_none() {
return self.webgl_error(InvalidOperation); return self.webgl_error(InvalidOperation);
} }
// TODO(ecoal95): Validate more parameters // TODO(emilio): Validate more parameters
let source = match source { let source = match source {
Some(s) => s, Some(s) => s,
None => return, None => return,
@ -1144,7 +1143,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}; };
let size = Size2D::new(img.width as i32, img.height as i32); let size = Size2D::new(img.width as i32, img.height as i32);
// TODO(ecoal95): Validate that the format argument is coherent with the image. // TODO(emilio): Validate that the format argument is coherent with the image.
// RGB8 should be easy to support too // RGB8 should be easy to support too
let mut data = match img.format { let mut data = match img.format {
PixelFormat::RGBA8 => img.bytes.to_vec(), PixelFormat::RGBA8 => img.bytes.to_vec(),
@ -1155,7 +1154,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
(data, size) (data, size)
}, },
// TODO(ecoal95): Getting canvas data is implemented in CanvasRenderingContext2D, but // TODO(emilio): Getting canvas data is implemented in CanvasRenderingContext2D, but
// we need to refactor it moving it to `HTMLCanvasElement` and supporting WebGLContext // we need to refactor it moving it to `HTMLCanvasElement` and supporting WebGLContext
ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement::HTMLCanvasElement(canvas) => { ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement::HTMLCanvasElement(canvas) => {
let canvas = canvas.r(); let canvas = canvas.r();
@ -1170,7 +1169,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
=> unimplemented!(), => unimplemented!(),
}; };
// TODO(ecoal95): Invert axis, convert colorspace, premultiply alpha if requested // TODO(emilio): Invert axis, convert colorspace, premultiply alpha if requested
let msg = CanvasWebGLMsg::TexImage2D(target, level, internal_format as i32, let msg = CanvasWebGLMsg::TexImage2D(target, level, internal_format as i32,
size.width, size.height, size.width, size.height,
format, data_type, pixels); format, data_type, pixels);

View file

@ -72,7 +72,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "angle" name = "angle"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/ecoal95/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64" source = "git+https://github.com/emilio/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64"
dependencies = [ dependencies = [
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -187,7 +187,6 @@ dependencies = [
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.1 (git+https://github.com/servo/ipc-channel)", "ipc-channel 0.2.1 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.4 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1", "plugins 0.0.1",
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -681,7 +680,6 @@ dependencies = [
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.3 (git+https://github.com/servo/rust-azure)", "azure 0.4.3 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1048,7 +1046,6 @@ dependencies = [
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.3 (git+https://github.com/servo/rust-azure)", "azure 0.4.3 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1689,7 +1686,7 @@ dependencies = [
name = "script" name = "script"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"angle 0.1.0 (git+https://github.com/ecoal95/angle?branch=servo)", "angle 0.1.0 (git+https://github.com/emilio/angle?branch=servo)",
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",

View file

@ -266,7 +266,7 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
let map = match pseudo_element { let map = match pseudo_element {
Some(ref pseudo) => match self.pseudos_map.get(pseudo) { Some(ref pseudo) => match self.pseudos_map.get(pseudo) {
Some(map) => map, Some(map) => map,
// TODO(ecoal95): get non eagerly-cascaded pseudo-element rules here. // TODO(emilio): get non eagerly-cascaded pseudo-element rules here.
// Actually assume there are no rules applicable. // Actually assume there are no rules applicable.
None => return true, None => return true,
}, },

7
ports/cef/Cargo.lock generated
View file

@ -57,7 +57,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "angle" name = "angle"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/ecoal95/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64" source = "git+https://github.com/emilio/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64"
dependencies = [ dependencies = [
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -172,7 +172,6 @@ dependencies = [
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.1 (git+https://github.com/servo/ipc-channel)", "ipc-channel 0.2.1 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.4 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1", "plugins 0.0.1",
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -610,7 +609,6 @@ dependencies = [
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.3 (git+https://github.com/servo/rust-azure)", "azure 0.4.3 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -968,7 +966,6 @@ dependencies = [
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.3 (git+https://github.com/servo/rust-azure)", "azure 0.4.3 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1564,7 +1561,7 @@ dependencies = [
name = "script" name = "script"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"angle 0.1.0 (git+https://github.com/ecoal95/angle?branch=servo)", "angle 0.1.0 (git+https://github.com/emilio/angle?branch=servo)",
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",

View file

@ -498,6 +498,8 @@ impl Window {
VirtualKeyCode::Tab => Ok(Key::Tab), VirtualKeyCode::Tab => Ok(Key::Tab),
VirtualKeyCode::Subtract => Ok(Key::Minus), VirtualKeyCode::Subtract => Ok(Key::Minus),
VirtualKeyCode::NavigateBackward => Ok(Key::NavigateBackward),
VirtualKeyCode::NavigateForward => Ok(Key::NavigateForward),
_ => Err(()), _ => Err(()),
} }
} }
@ -731,6 +733,12 @@ impl WindowMethods for Window {
(NONE, Key::Backspace) => { (NONE, Key::Backspace) => {
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back)); self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
} }
(SHIFT, Key::NavigateForward) => {
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Forward));
}
(NONE, Key::NavigateBackward) => {
self.event_queue.borrow_mut().push(WindowEvent::Navigation(WindowNavigateMsg::Back));
}
(NONE, Key::Escape) => { (NONE, Key::Escape) => {
self.event_queue.borrow_mut().push(WindowEvent::Quit); self.event_queue.borrow_mut().push(WindowEvent::Quit);

7
ports/gonk/Cargo.lock generated
View file

@ -50,7 +50,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "angle" name = "angle"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/ecoal95/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64" source = "git+https://github.com/emilio/angle?branch=servo#b31e70ef5cb675582de910d09b0c385ea2000a64"
dependencies = [ dependencies = [
"libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -165,7 +165,6 @@ dependencies = [
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_plugin 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.2.1 (git+https://github.com/servo/ipc-channel)", "ipc-channel 0.2.1 (git+https://github.com/servo/ipc-channel)",
"layers 0.2.4 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1", "plugins 0.0.1",
"serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -613,7 +612,6 @@ dependencies = [
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.3 (git+https://github.com/servo/rust-azure)", "azure 0.4.3 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -950,7 +948,6 @@ dependencies = [
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.3 (git+https://github.com/servo/rust-azure)", "azure 0.4.3 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1546,7 +1543,7 @@ dependencies = [
name = "script" name = "script"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"angle 0.1.0 (git+https://github.com/ecoal95/angle?branch=servo)", "angle 0.1.0 (git+https://github.com/emilio/angle?branch=servo)",
"app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "app_units 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",

View file

@ -270,15 +270,6 @@ class MachCommands(CommandBase):
if result != 0: if result != 0:
return result return result
@Command('test-ref',
description='Run the reference tests',
category='testing')
@CommandArgument('params', default=None, nargs=argparse.REMAINDER)
def test_ref(self, params=None):
print("Ref tests have been replaced by web-platform-tests under "
"tests/wpt/mozilla/.")
return 0
@Command('test-content', @Command('test-content',
description='Run the content tests', description='Run the content tests',
category='testing') category='testing')

View file

@ -94,6 +94,20 @@ fn test_fetch_response_body_matches_const_message() {
}; };
} }
#[test]
fn test_fetch_aboutblank() {
let url = Url::parse("about:blank").unwrap();
let origin = Origin::Origin(url.origin());
let mut request = Request::new(url, Some(origin), false);
request.referer = Referer::NoReferer;
let wrapped_request = Rc::new(request);
let fetch_response = fetch(wrapped_request);
assert!(!fetch_response.is_network_error());
assert!(*fetch_response.body.lock().unwrap() == ResponseBody::Done(vec![]));
}
#[test] #[test]
fn test_fetch_response_is_basic_filtered() { fn test_fetch_response_is_basic_filtered() {

View file

@ -14,6 +14,6 @@
</style> </style>
</head> </head>
<body> <body>
<img class="ex" src="rust.png"> <img class="ex" src="rust-0.png">
</body> </body>
</html> </html>

View file

@ -13,6 +13,6 @@
</style> </style>
</head> </head>
<body> <body>
<img class="ex" src="rust.png"> <img class="ex" src="rust-0.png">
</body> </body>
</html> </html>

View file

@ -1,4 +1,4 @@
@ecoal95 @emilio
@hallvors @hallvors
@kangxu @kangxu
@caitp @caitp