diff options
76 files changed, 1263 insertions, 609 deletions
diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index 6e15a5ab489..1faf41a9aed 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -148,6 +148,12 @@ impl<'a> CanvasPaintThread<'a> { Canvas2dMsg::DrawImageSelf(image_size, dest_rect, source_rect, smoothing_enabled) => { painter.draw_image_self(image_size, dest_rect, source_rect, smoothing_enabled) } + Canvas2dMsg::DrawImageInOther( + renderer, image_size, dest_rect, source_rect, smoothing, sender + ) => { + painter.draw_image_in_other( + renderer, image_size, dest_rect, source_rect, smoothing, sender) + } Canvas2dMsg::MoveTo(ref point) => painter.move_to(point), Canvas2dMsg::LineTo(ref point) => painter.line_to(point), Canvas2dMsg::Rect(ref rect) => painter.rect(rect), @@ -371,6 +377,26 @@ impl<'a> CanvasPaintThread<'a> { } } + fn draw_image_in_other(&self, + renderer: IpcSender<CanvasMsg>, + image_size: Size2D<f64>, + dest_rect: Rect<f64>, + source_rect: Rect<f64>, + smoothing_enabled: bool, + sender: IpcSender<()>) { + let mut image_data = self.read_pixels(source_rect.to_i32(), image_size); + // TODO: avoid double byte_swap. + byte_swap(&mut image_data); + + let msg = CanvasMsg::Canvas2d(Canvas2dMsg::DrawImage( + image_data, source_rect.size, dest_rect, source_rect, smoothing_enabled)); + renderer.send(msg).unwrap(); + // We acknowledge to the caller here that the data was sent to the + // other canvas so that if JS immediately afterwards try to get the + // pixels of the other one, it won't retrieve the other values. + sender.send(()).unwrap(); + } + fn move_to(&self, point: &Point2D<AzFloat>) { self.path_builder.move_to(*point) } diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs index 8bf7fa0fba9..98eaa159077 100644 --- a/components/canvas_traits/lib.rs +++ b/components/canvas_traits/lib.rs @@ -79,6 +79,8 @@ pub enum Canvas2dMsg { ArcTo(Point2D<f32>, Point2D<f32>, f32), DrawImage(Vec<u8>, Size2D<f64>, Rect<f64>, Rect<f64>, bool), DrawImageSelf(Size2D<f64>, Rect<f64>, Rect<f64>, bool), + DrawImageInOther( + IpcSender<CanvasMsg>, Size2D<f64>, Rect<f64>, Rect<f64>, bool, IpcSender<()>), BeginPath, BezierCurveTo(Point2D<f32>, Point2D<f32>, Point2D<f32>), ClearRect(Rect<f32>), diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 7b476ab2f55..a987bd7bdd3 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -290,6 +290,9 @@ struct PipelineDetails { /// Whether there are animation callbacks animation_callbacks_running: bool, + + /// Whether this pipeline is visible + visible: bool, } impl PipelineDetails { @@ -299,6 +302,7 @@ impl PipelineDetails { current_epoch: Epoch(0), animations_running: false, animation_callbacks_running: false, + visible: true, } } } @@ -760,6 +764,13 @@ impl<Window: WindowMethods> IOCompositor<Window> { reports_chan.send(reports); } + (Msg::PipelineVisibilityChanged(pipeline_id, visible), ShutdownState::NotShuttingDown) => { + self.pipeline_details(pipeline_id).visible = visible; + if visible { + self.process_animations(); + } + } + (Msg::PipelineExited(pipeline_id, sender), _) => { debug!("Compositor got pipeline exited: {:?}", pipeline_id); self.pending_subpages.remove(&pipeline_id); @@ -795,13 +806,16 @@ impl<Window: WindowMethods> IOCompositor<Window> { animation_state: AnimationState) { match animation_state { AnimationState::AnimationsPresent => { + let visible = self.pipeline_details(pipeline_id).visible; self.pipeline_details(pipeline_id).animations_running = true; - self.composite_if_necessary(CompositingReason::Animation); + if visible { + self.composite_if_necessary(CompositingReason::Animation); + } } AnimationState::AnimationCallbacksPresent => { - if !self.pipeline_details(pipeline_id).animation_callbacks_running { - self.pipeline_details(pipeline_id).animation_callbacks_running = - true; + let visible = self.pipeline_details(pipeline_id).visible; + self.pipeline_details(pipeline_id).animation_callbacks_running = true; + if visible { self.tick_animations_for_pipeline(pipeline_id); } } @@ -1712,9 +1726,10 @@ impl<Window: WindowMethods> IOCompositor<Window> { fn process_animations(&mut self) { let mut pipeline_ids = vec![]; for (pipeline_id, pipeline_details) in &self.pipeline_details { - if pipeline_details.animations_running || - pipeline_details.animation_callbacks_running { - pipeline_ids.push(*pipeline_id); + if (pipeline_details.animations_running || + pipeline_details.animation_callbacks_running) && + pipeline_details.visible { + pipeline_ids.push(*pipeline_id); } } for pipeline_id in &pipeline_ids { diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index 325cdc3d104..d29235858b8 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -183,6 +183,8 @@ pub enum Msg { ResizeTo(Size2D<u32>), /// Get scroll offset of a layer GetScrollOffset(PipelineId, LayerId, IpcSender<Point2D<f32>>), + /// Pipeline visibility changed + PipelineVisibilityChanged(PipelineId, bool), /// A pipeline was shut down. // This message acts as a synchronization point between the constellation, // when it shuts down a pipeline, to the compositor; when the compositor @@ -223,6 +225,7 @@ impl Debug for Msg { Msg::GetClientWindow(..) => write!(f, "GetClientWindow"), Msg::MoveTo(..) => write!(f, "MoveTo"), Msg::ResizeTo(..) => write!(f, "ResizeTo"), + Msg::PipelineVisibilityChanged(..) => write!(f, "PipelineVisibilityChanged"), Msg::PipelineExited(..) => write!(f, "PipelineExited"), Msg::GetScrollOffset(..) => write!(f, "GetScrollOffset"), } diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index cdf66a006fb..5bef18b062b 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -407,6 +407,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> load_data: LoadData) { if self.shutting_down { return; } + let parent_visibility = if let Some((parent_pipeline_id, _, _)) = parent_info { + self.pipelines.get(&parent_pipeline_id).map(|pipeline| pipeline.visible) + } else { + None + }; + let result = Pipeline::spawn::<Message, LTF, STF>(InitialPipelineState { id: pipeline_id, parent_info: parent_info, @@ -427,6 +433,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> load_data: load_data, device_pixel_ratio: self.window_size.device_pixel_ratio, pipeline_namespace_id: self.next_pipeline_namespace_id(), + parent_visibility: parent_visibility, webrender_api_sender: self.webrender_api_sender.clone(), }); @@ -710,6 +717,14 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> } } } + FromScriptMsg::SetVisible(pipeline_id, visible) => { + debug!("constellation got set visible messsage"); + self.handle_set_visible_msg(pipeline_id, visible); + } + FromScriptMsg::VisibilityChangeComplete(pipeline_id, visible) => { + debug!("constellation got set visibility change complete message"); + self.handle_visibility_change_complete(pipeline_id, visible); + } FromScriptMsg::RemoveIFrame(pipeline_id, sender) => { debug!("constellation got remove iframe message"); self.handle_remove_iframe_msg(pipeline_id); @@ -907,6 +922,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> debug!("Panic handler for pipeline {:?}: {}.", pipeline_id, reason); if let Some(pipeline_id) = pipeline_id { + let pipeline_url = self.pipelines.get(&pipeline_id).map(|pipeline| pipeline.url.clone()); let parent_info = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.parent_info); let window_size = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.size); @@ -923,14 +939,19 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> self.close_pipeline(pending_pipeline_id, ExitPipelineMode::Force); } + let failure_url = Url::parse("about:failure").expect("infallible"); + + if let Some(pipeline_url) = pipeline_url { + if pipeline_url == failure_url { + return error!("about:failure failed"); + } + } + warn!("creating replacement pipeline for about:failure"); let new_pipeline_id = PipelineId::new(); - self.new_pipeline(new_pipeline_id, - parent_info, - window_size, - None, - LoadData::new(Url::parse("about:failure").expect("infallible"), None, None)); + let load_data = LoadData::new(failure_url, None, None); + self.new_pipeline(new_pipeline_id, parent_info, window_size, None, load_data); self.push_pending_frame(new_pipeline_id, Some(pipeline_id)); @@ -943,7 +964,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> let window_size = self.window_size.visible_viewport; let root_pipeline_id = PipelineId::new(); debug_assert!(PipelineId::fake_root_pipeline_id() == root_pipeline_id); - self.new_pipeline(root_pipeline_id, None, Some(window_size), None, LoadData::new(url.clone(), None, None)); + self.new_pipeline(root_pipeline_id, None, Some(window_size), None, + LoadData::new(url.clone(), None, None)); self.handle_load_start_msg(&root_pipeline_id); self.push_pending_frame(root_pipeline_id, None); self.compositor_proxy.send(ToCompositorMsg::ChangePageUrl(root_pipeline_id, url)); @@ -1482,6 +1504,35 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> } } + fn handle_set_visible_msg(&mut self, pipeline_id: PipelineId, visible: bool) { + let frame_id = self.pipeline_to_frame_map.get(&pipeline_id).map(|frame_id| *frame_id); + let child_pipeline_ids: Vec<PipelineId> = self.current_frame_tree_iter(frame_id) + .map(|frame| frame.current) + .collect(); + for id in child_pipeline_ids { + if let Some(pipeline) = self.pipelines.get_mut(&id) { + pipeline.change_visibility(visible); + } + } + } + + fn handle_visibility_change_complete(&mut self, pipeline_id: PipelineId, visibility: bool) { + let parent_pipeline_info = self.pipelines.get(&pipeline_id).and_then(|source| source.parent_info); + if let Some((parent_pipeline_id, _, _)) = parent_pipeline_info { + let visibility_msg = ConstellationControlMsg::NotifyVisibilityChange(parent_pipeline_id, + pipeline_id, + visibility); + let result = match self.pipelines.get(&parent_pipeline_id) { + None => return warn!("Parent pipeline {:?} closed", parent_pipeline_id), + Some(parent_pipeline) => parent_pipeline.script_chan.send(visibility_msg), + }; + + if let Err(e) = result { + self.handle_send_error(parent_pipeline_id, e); + } + } + } + fn handle_create_canvas_paint_thread_msg( &mut self, size: &Size2D<i32>, diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 578ccae0927..8a48108ca81 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -65,6 +65,9 @@ pub struct Pipeline { pub running_animations: bool, pub children: Vec<FrameId>, pub is_private: bool, + /// Whether this pipeline should be treated as visible for the purposes of scheduling and + /// resource management. + pub visible: bool, } /// Initial setup data needed to construct a pipeline. @@ -112,6 +115,8 @@ pub struct InitialPipelineState { pub load_data: LoadData, /// The ID of the pipeline namespace for this script thread. pub pipeline_namespace_id: PipelineNamespaceId, + /// Pipeline visibility is inherited from parent + pub parent_visibility: Option<bool>, /// Optional webrender api (if enabled). pub webrender_api_sender: Option<webrender_traits::RenderApiSender>, } @@ -250,7 +255,10 @@ impl Pipeline { state.compositor_proxy, chrome_to_paint_chan, state.load_data.url, - state.window_size); + state.window_size, + state.parent_visibility.unwrap_or(true)); + + pipeline.notify_visibility(); Ok((pipeline, child_process)) } @@ -262,7 +270,8 @@ impl Pipeline { compositor_proxy: Box<CompositorProxy + 'static + Send>, chrome_to_paint_chan: Sender<ChromeToPaintMsg>, url: Url, - size: Option<TypedSize2D<PagePx, f32>>) + size: Option<TypedSize2D<PagePx, f32>>, + visible: bool) -> Pipeline { Pipeline { id: id, @@ -277,6 +286,7 @@ impl Pipeline { size: size, running_animations: false, is_private: false, + visible: visible, } } @@ -367,6 +377,22 @@ impl Pipeline { warn!("Sending mozbrowser event to script failed ({}).", e); } } + + fn notify_visibility(&self) { + self.script_chan.send(ConstellationControlMsg::ChangeFrameVisibilityStatus(self.id, self.visible)) + .expect("Pipeline script chan"); + + self.compositor_proxy.send(CompositorMsg::PipelineVisibilityChanged(self.id, self.visible)); + } + + pub fn change_visibility(&mut self, visible: bool) { + if visible == self.visible { + return; + } + self.visible = visible; + self.notify_visibility(); + } + } #[derive(Deserialize, Serialize)] diff --git a/components/layout/block.rs b/components/layout/block.rs index 2e0794913d3..d74490f7734 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -2842,8 +2842,9 @@ impl ISizeAndMarginsComputer for AbsoluteReplaced { let opaque_block = OpaqueFlow::from_flow(block); let containing_block_inline_size = block.containing_block_size(&layout_context.shared_context().viewport_size, opaque_block).inline; + let container_block_size = block.explicit_block_containing_size(layout_context); let fragment = block.fragment(); - fragment.assign_replaced_inline_size_if_necessary(containing_block_inline_size); + fragment.assign_replaced_inline_size_if_necessary(containing_block_inline_size, container_block_size); // For replaced absolute flow, the rest of the constraint solving will // take inline-size to be specified as the value computed here. MaybeAuto::Specified(fragment.content_inline_size()) @@ -2898,10 +2899,11 @@ impl ISizeAndMarginsComputer for BlockReplaced { fn initial_computed_inline_size(&self, block: &mut BlockFlow, parent_flow_inline_size: Au, - _: &LayoutContext) + layout_context: &LayoutContext) -> MaybeAuto { + let container_block_size = block.explicit_block_containing_size(layout_context); let fragment = block.fragment(); - fragment.assign_replaced_inline_size_if_necessary(parent_flow_inline_size); + fragment.assign_replaced_inline_size_if_necessary(parent_flow_inline_size, container_block_size); // For replaced block flow, the rest of the constraint solving will // take inline-size to be specified as the value computed here. MaybeAuto::Specified(fragment.content_inline_size()) @@ -2955,10 +2957,11 @@ impl ISizeAndMarginsComputer for FloatReplaced { fn initial_computed_inline_size(&self, block: &mut BlockFlow, parent_flow_inline_size: Au, - _: &LayoutContext) + layout_context: &LayoutContext) -> MaybeAuto { + let container_block_size = block.explicit_block_containing_size(layout_context); let fragment = block.fragment(); - fragment.assign_replaced_inline_size_if_necessary(parent_flow_inline_size); + fragment.assign_replaced_inline_size_if_necessary(parent_flow_inline_size, container_block_size); // For replaced block flow, the rest of the constraint solving will // take inline-size to be specified as the value computed here. MaybeAuto::Specified(fragment.content_inline_size()) @@ -3042,10 +3045,11 @@ impl ISizeAndMarginsComputer for InlineBlockReplaced { fn initial_computed_inline_size(&self, block: &mut BlockFlow, parent_flow_inline_size: Au, - _: &LayoutContext) + layout_context: &LayoutContext) -> MaybeAuto { + let container_block_size = block.explicit_block_containing_size(layout_context); let fragment = block.fragment(); - fragment.assign_replaced_inline_size_if_necessary(parent_flow_inline_size); + fragment.assign_replaced_inline_size_if_necessary(parent_flow_inline_size, container_block_size); // For replaced block flow, the rest of the constraint solving will // take inline-size to be specified as the value computed here. MaybeAuto::Specified(fragment.content_inline_size()) diff --git a/components/layout/construct.rs b/components/layout/construct.rs index 3dfcfdf2689..49546fb2663 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -726,7 +726,6 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> return } - let selection = node.selection(); let mut style = (*style).clone(); properties::modify_style_for_text(&mut style); @@ -734,7 +733,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> match text_content { TextContent::Text(string) => { - let info = box UnscannedTextFragmentInfo::new(string, selection); + let info = box UnscannedTextFragmentInfo::new(string, node.selection()); let specific_fragment_info = SpecificFragmentInfo::UnscannedText(info); fragments.fragments.push_back(Fragment::from_opaque_node_and_style( node.opaque(), diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 640b7acce1a..27f08dfd5e5 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -488,6 +488,7 @@ impl ReplacedImageFragmentInfo { style: &ServoComputedValues, noncontent_inline_size: Au, container_inline_size: Au, + container_block_size: Option<Au>, fragment_inline_size: Au, fragment_block_size: Au) -> Au { @@ -515,7 +516,7 @@ impl ReplacedImageFragmentInfo { let specified_height = ReplacedImageFragmentInfo::style_length( style_block_size, - None); + container_block_size); let specified_height = match specified_height { MaybeAuto::Auto => intrinsic_height, MaybeAuto::Specified(h) => h, @@ -1767,7 +1768,9 @@ impl Fragment { /// Assigns replaced inline-size, padding, and margins for this fragment only if it is replaced /// content per CSS 2.1 § 10.3.2. - pub fn assign_replaced_inline_size_if_necessary(&mut self, container_inline_size: Au) { + pub fn assign_replaced_inline_size_if_necessary(&mut self, + container_inline_size: Au, + container_block_size: Option<Au>) { match self.specific { SpecificFragmentInfo::Generic | SpecificFragmentInfo::GeneratedContent(_) | @@ -1833,6 +1836,7 @@ impl Fragment { .calculate_replaced_inline_size(style, noncontent_inline_size, container_inline_size, + container_block_size, fragment_inline_size, fragment_block_size); } @@ -1844,6 +1848,7 @@ impl Fragment { .calculate_replaced_inline_size(style, noncontent_inline_size, container_inline_size, + container_block_size, fragment_inline_size, fragment_block_size); } diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 5ad86e54e05..5387f943070 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -1359,6 +1359,7 @@ impl Flow for InlineFlow { let inline_size = self.base.block_container_inline_size; let container_mode = self.base.block_container_writing_mode; + let container_block_size = self.base.block_container_explicit_block_size; self.base.position.size.inline = inline_size; { @@ -1368,7 +1369,7 @@ impl Flow for InlineFlow { fragment.compute_border_and_padding(inline_size, border_collapse); fragment.compute_block_direction_margins(inline_size); fragment.compute_inline_direction_margins(inline_size); - fragment.assign_replaced_inline_size_if_necessary(inline_size); + fragment.assign_replaced_inline_size_if_necessary(inline_size, container_block_size); } } diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs index d32c19d5c37..f12d290e9a3 100644 --- a/components/layout/list_item.rs +++ b/components/layout/list_item.rs @@ -88,7 +88,8 @@ impl Flow for ListItemFlow { for marker in self.marker_fragments.iter_mut().rev() { let containing_block_inline_size = self.block_flow.base.block_container_inline_size; - marker.assign_replaced_inline_size_if_necessary(containing_block_inline_size); + let container_block_size = self.block_flow.explicit_block_containing_size(layout_context); + marker.assign_replaced_inline_size_if_necessary(containing_block_inline_size, container_block_size); // Do this now. There's no need to do this in bubble-widths, since markers do not // contribute to the inline size of this flow. diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 692d956f000..bd07e1f72bb 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -65,7 +65,14 @@ impl<'lc, 'ln> DomTraversalContext<ServoLayoutNode<'ln>> for RecalcStyleAndConst } } - fn process_preorder(&self, node: ServoLayoutNode<'ln>) { recalc_style_at(&self.context, self.root, node); } + fn process_preorder(&self, node: ServoLayoutNode<'ln>) { + // FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML + // parser. + node.initialize_data(); + + recalc_style_at(&self.context, self.root, node); + } + fn process_postorder(&self, node: ServoLayoutNode<'ln>) { construct_flows_at(&self.context, self.root, node); } } diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index b6c5266c2cb..3c18e909bae 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -120,6 +120,19 @@ impl<'ln> ServoLayoutNode<'ln> { chain: self.chain, } } + + pub fn initialize_data(self) { + if unsafe { self.borrow_data_unchecked() }.is_none() { + let ptr: NonOpaqueStyleAndLayoutData = + Box::into_raw(box RefCell::new(PrivateLayoutData::new())); + let opaque = OpaqueStyleAndLayoutData { + ptr: unsafe { NonZero::new(ptr as *mut ()) } + }; + unsafe { + self.node.init_style_and_layout_data(opaque); + } + } + } } impl<'ln> TNode for ServoLayoutNode<'ln> { @@ -158,20 +171,6 @@ impl<'ln> TNode for ServoLayoutNode<'ln> { OpaqueNodeMethods::from_jsmanaged(unsafe { self.get_jsmanaged() }) } - fn initialize_data(self) { - let has_data = unsafe { self.borrow_data_unchecked().is_some() }; - if !has_data { - let ptr: NonOpaqueStyleAndLayoutData = - Box::into_raw(box RefCell::new(PrivateLayoutData::new())); - let opaque = OpaqueStyleAndLayoutData { - ptr: unsafe { NonZero::new(ptr as *mut ()) } - }; - unsafe { - self.node.init_style_and_layout_data(opaque); - } - } - } - fn layout_parent_node(self, reflow_root: OpaqueNode) -> Option<ServoLayoutNode<'ln>> { if self.opaque() == reflow_root { None @@ -233,11 +232,11 @@ impl<'ln> TNode for ServoLayoutNode<'ln> { } fn borrow_data(&self) -> Option<Ref<PrivateStyleData>> { - unsafe { self.borrow_layout_data().map(|d| transmute(d)) } + self.borrow_layout_data().map(|d| Ref::map(d, |d| &d.style_data)) } fn mutate_data(&self) -> Option<RefMut<PrivateStyleData>> { - unsafe { self.mutate_layout_data().map(|d| transmute(d)) } + self.mutate_layout_data().map(|d| RefMut::map(d, |d| &mut d.style_data)) } fn restyle_damage(self) -> RestyleDamage { diff --git a/components/net/filemanager_thread.rs b/components/net/filemanager_thread.rs index 5b18b332fdc..56cf0ca62c8 100644 --- a/components/net/filemanager_thread.rs +++ b/components/net/filemanager_thread.rs @@ -6,49 +6,89 @@ use blob_loader; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; use mime_classifier::MIMEClassifier; use mime_guess::guess_mime_type_opt; -use net_traits::blob_url_store::{BlobURLStoreEntry, BlobURLStoreError}; -use net_traits::filemanager_thread::{FileManagerThreadMsg, FileManagerResult}; +use net_traits::blob_url_store::{BlobURLStoreEntry, BlobURLStoreError, BlobURLStoreMsg}; +use net_traits::filemanager_thread::{FileManagerThreadMsg, FileManagerResult, FilterPattern}; use net_traits::filemanager_thread::{SelectedFile, FileManagerThreadError, SelectedFileId}; use std::collections::HashMap; use std::fs::File; use std::io::Read; use std::path::{Path, PathBuf}; use std::sync::{Arc, RwLock}; -use url::Origin; +#[cfg(any(target_os = "macos", target_os = "linux"))] +use tinyfiledialogs; +use url::{Url, Origin}; use util::thread::spawn_named; use uuid::Uuid; -pub trait FileManagerThreadFactory { - fn new() -> Self; +pub trait FileManagerThreadFactory<UI: 'static + UIProvider> { + fn new(&'static UI) -> Self; } -impl FileManagerThreadFactory for IpcSender<FileManagerThreadMsg> { +pub trait UIProvider where Self: Sync { + fn open_file_dialog(&self, path: &str, + filter: Option<(&[&str], &str)>) -> Option<String>; + + fn open_file_dialog_multi(&self, path: &str, + filter: Option<(&[&str], &str)>) -> Option<Vec<String>>; +} + +pub struct TFDProvider; + +impl UIProvider for TFDProvider { + #[cfg(any(target_os = "macos", target_os = "linux"))] + fn open_file_dialog(&self, path: &str, + filter: Option<(&[&str], &str)>) -> Option<String> { + tinyfiledialogs::open_file_dialog("Pick a file", path, filter) + } + + #[cfg(any(target_os = "macos", target_os = "linux"))] + fn open_file_dialog_multi(&self, path: &str, + filter: Option<(&[&str], &str)>) -> Option<Vec<String>> { + tinyfiledialogs::open_file_dialog_multi("Pick files", path, filter) + } + + #[cfg(not(any(target_os = "macos", target_os = "linux")))] + fn open_file_dialog(&self, path: &str, + filter: Option<(&[&str], &str)>) -> Option<String> { + None + } + + #[cfg(not(any(target_os = "macos", target_os = "linux")))] + fn open_file_dialog_multi(&self, path: &str, + filter: Option<(&[&str], &str)>) -> Option<Vec<String>> { + None + } +} + +impl<UI: 'static + UIProvider> FileManagerThreadFactory<UI> for IpcSender<FileManagerThreadMsg> { /// Create a FileManagerThread - fn new() -> IpcSender<FileManagerThreadMsg> { + fn new(ui: &'static UI) -> IpcSender<FileManagerThreadMsg> { let (chan, recv) = ipc::channel().unwrap(); spawn_named("FileManager".to_owned(), move || { - FileManager::new(recv).start(); + FileManager::new(recv, ui).start(); }); chan } } -struct FileManager { +struct FileManager<UI: 'static + UIProvider> { receiver: IpcReceiver<FileManagerThreadMsg>, idmap: HashMap<Uuid, PathBuf>, classifier: Arc<MIMEClassifier>, blob_url_store: Arc<RwLock<BlobURLStore>>, + ui: &'static UI, } -impl FileManager { - fn new(recv: IpcReceiver<FileManagerThreadMsg>) -> FileManager { +impl<UI: 'static + UIProvider> FileManager<UI> { + fn new(recv: IpcReceiver<FileManagerThreadMsg>, ui: &'static UI) -> FileManager<UI> { FileManager { receiver: recv, idmap: HashMap::new(), classifier: Arc::new(MIMEClassifier::new()), blob_url_store: Arc::new(RwLock::new(BlobURLStore::new())), + ui: ui } } @@ -56,8 +96,8 @@ impl FileManager { fn start(&mut self) { loop { match self.receiver.recv().unwrap() { - FileManagerThreadMsg::SelectFile(sender) => self.select_file(sender), - FileManagerThreadMsg::SelectFiles(sender) => self.select_files(sender), + FileManagerThreadMsg::SelectFile(filter, sender) => self.select_file(filter, sender), + FileManagerThreadMsg::SelectFiles(filter, sender) => self.select_files(filter, sender), FileManagerThreadMsg::ReadFile(sender, id) => { match self.try_read_file(id) { Ok(buffer) => { let _ = sender.send(Ok(buffer)); } @@ -65,6 +105,7 @@ impl FileManager { } } FileManagerThreadMsg::DeleteFileID(id) => self.delete_fileid(id), + FileManagerThreadMsg::BlobURLStoreMsg(msg) => self.blob_url_store.write().unwrap().process(msg), FileManagerThreadMsg::LoadBlob(load_data, consumer) => { blob_loader::load(load_data, consumer, self.blob_url_store.clone(), @@ -74,33 +115,51 @@ impl FileManager { }; } } -} -impl FileManager { - fn select_file(&mut self, sender: IpcSender<FileManagerResult<SelectedFile>>) { - // TODO: Pull the dialog UI in and get selected - // XXX: "test.txt" is "tests/unit/net/test.txt", for temporary testing purpose - let selected_path = Path::new("test.txt"); + fn select_file(&mut self, _filter: Vec<FilterPattern>, + sender: IpcSender<FileManagerResult<SelectedFile>>) { + match self.ui.open_file_dialog("", None) { + Some(s) => { + let selected_path = Path::new(&s); - match self.create_entry(selected_path) { - Some(triple) => { let _ = sender.send(Ok(triple)); } - None => { let _ = sender.send(Err(FileManagerThreadError::InvalidSelection)); } - }; + match self.create_entry(selected_path) { + Some(triple) => { let _ = sender.send(Ok(triple)); } + None => { let _ = sender.send(Err(FileManagerThreadError::InvalidSelection)); } + }; + } + None => { + let _ = sender.send(Err(FileManagerThreadError::UserCancelled)); + return; + } + } } - fn select_files(&mut self, sender: IpcSender<FileManagerResult<Vec<SelectedFile>>>) { - let selected_paths = vec![Path::new("test.txt")]; + fn select_files(&mut self, _filter: Vec<FilterPattern>, + sender: IpcSender<FileManagerResult<Vec<SelectedFile>>>) { + match self.ui.open_file_dialog_multi("", None) { + Some(v) => { + let mut selected_paths = vec![]; + + for s in &v { + selected_paths.push(Path::new(s)); + } - let mut replies = vec![]; + let mut replies = vec![]; - for path in selected_paths { - match self.create_entry(path) { - Some(triple) => replies.push(triple), - None => { let _ = sender.send(Err(FileManagerThreadError::InvalidSelection)); } - }; - } + for path in selected_paths { + match self.create_entry(path) { + Some(triple) => replies.push(triple), + None => { let _ = sender.send(Err(FileManagerThreadError::InvalidSelection)); } + }; + } - let _ = sender.send(Ok(replies)); + let _ = sender.send(Ok(replies)); + } + None => { + let _ = sender.send(Err(FileManagerThreadError::UserCancelled)); + return; + } + } } fn create_entry(&mut self, file_path: &Path) -> Option<SelectedFile> { @@ -174,6 +233,29 @@ impl BlobURLStore { } } + fn process(&mut self, msg: BlobURLStoreMsg) { + match msg { + BlobURLStoreMsg::AddEntry(entry, origin_str, sender) => { + match Url::parse(&origin_str) { + Ok(base_url) => { + let id = Uuid::new_v4(); + self.add_entry(id, base_url.origin(), entry); + + let _ = sender.send(Ok(id.simple().to_string())); + } + Err(_) => { + let _ = sender.send(Err(BlobURLStoreError::InvalidOrigin)); + } + } + } + BlobURLStoreMsg::DeleteEntry(id) => { + if let Ok(id) = Uuid::parse_str(&id) { + self.delete_entry(id); + } + }, + } + } + pub fn request(&self, id: Uuid, origin: &Origin) -> Result<&BlobURLStoreEntry, BlobURLStoreError> { match self.entries.get(&id) { Some(ref pair) => { @@ -195,4 +277,3 @@ impl BlobURLStore { self.entries.remove(&id); } } - diff --git a/components/net/resource_thread.rs b/components/net/resource_thread.rs index 6e94fd1cf03..dfcbf1eedd3 100644 --- a/components/net/resource_thread.rs +++ b/components/net/resource_thread.rs @@ -13,7 +13,7 @@ use data_loader; use devtools_traits::DevtoolsControlMsg; use fetch::methods::{fetch, FetchContext}; use file_loader; -use filemanager_thread::FileManagerThreadFactory; +use filemanager_thread::{FileManagerThreadFactory, TFDProvider}; use hsts::HstsList; use http_loader::{self, HttpState}; use hyper::client::pool::Pool; @@ -49,6 +49,8 @@ use util::prefs; use util::thread::spawn_named; use websocket_loader; +const TFD_PROVIDER: &'static TFDProvider = &TFDProvider; + pub enum ProgressSender { Channel(IpcSender<ProgressMsg>), Listener(AsyncResponseTarget), @@ -161,7 +163,7 @@ pub fn new_resource_threads(user_agent: String, profiler_chan: ProfilerChan) -> ResourceThreads { ResourceThreads::new(new_core_resource_thread(user_agent, devtools_chan, profiler_chan), StorageThreadFactory::new(), - FileManagerThreadFactory::new()) + FileManagerThreadFactory::new(TFD_PROVIDER)) } diff --git a/components/net_traits/blob_url_store.rs b/components/net_traits/blob_url_store.rs index 71d8c11b2de..34f609ab10e 100644 --- a/components/net_traits/blob_url_store.rs +++ b/components/net_traits/blob_url_store.rs @@ -2,6 +2,7 @@ * 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 ipc_channel::ipc::IpcSender; use std::str::FromStr; use url::Url; use uuid::Uuid; @@ -15,6 +16,16 @@ pub enum BlobURLStoreError { InvalidOrigin, } +#[derive(Serialize, Deserialize)] +pub enum BlobURLStoreMsg { + /// Add an entry and send back the associated uuid + /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround + /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722 + AddEntry(BlobURLStoreEntry, String, IpcSender<Result<String, BlobURLStoreError>>), + /// Delete an entry by uuid + DeleteEntry(String), +} + /// Blob URL store entry, a packaged form of Blob DOM object #[derive(Clone, Serialize, Deserialize)] pub struct BlobURLStoreEntry { diff --git a/components/net_traits/filemanager_thread.rs b/components/net_traits/filemanager_thread.rs index 3182161c9eb..e4d0cb591f2 100644 --- a/components/net_traits/filemanager_thread.rs +++ b/components/net_traits/filemanager_thread.rs @@ -2,6 +2,7 @@ * 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 blob_url_store::BlobURLStoreMsg; use ipc_channel::ipc::IpcSender; use std::path::PathBuf; use super::{LoadConsumer, LoadData}; @@ -18,13 +19,16 @@ pub struct SelectedFile { pub type_string: String, } +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct FilterPattern(pub String); + #[derive(Deserialize, Serialize)] pub enum FileManagerThreadMsg { /// Select a single file, return triple (FileID, FileName, lastModified) - SelectFile(IpcSender<FileManagerResult<SelectedFile>>), + SelectFile(Vec<FilterPattern>, IpcSender<FileManagerResult<SelectedFile>>), /// Select multiple files, return a vector of triples - SelectFiles(IpcSender<FileManagerResult<Vec<SelectedFile>>>), + SelectFiles(Vec<FilterPattern>, IpcSender<FileManagerResult<Vec<SelectedFile>>>), /// Read file, return the bytes ReadFile(IpcSender<FileManagerResult<Vec<u8>>>, SelectedFileId), @@ -32,6 +36,9 @@ pub enum FileManagerThreadMsg { /// Delete the FileID entry DeleteFileID(SelectedFileId), + // Blob URL message + BlobURLStoreMsg(BlobURLStoreMsg), + /// Load resource by Blob URL LoadBlob(LoadData, LoadConsumer), @@ -43,8 +50,10 @@ pub type FileManagerResult<T> = Result<T, FileManagerThreadError>; #[derive(Debug, Deserialize, Serialize)] pub enum FileManagerThreadError { - /// The selection action is invalid, nothing is selected + /// The selection action is invalid due to exceptional reason InvalidSelection, + /// The selection action is cancelled by user + UserCancelled, /// Failure to process file information such as file name, modified time etc. FileInfoProcessingError, /// Failure to read the file content diff --git a/components/net_traits/image/base.rs b/components/net_traits/image/base.rs index 90cd039dac3..815a276330f 100644 --- a/components/net_traits/image/base.rs +++ b/components/net_traits/image/base.rs @@ -91,7 +91,7 @@ pub fn detect_image_format(buffer: &[u8]) -> Result<ImageFormat, &str> { fn is_gif(buffer: &[u8]) -> bool { match buffer { - [b'G', b'I', b'F', b'8', n, b'a', ..] if n == b'7' || n == b'9' => true, + &[b'G', b'I', b'F', b'8', n, b'a', ..] if n == b'7' || n == b'9' => true, _ => false } } diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 95f1044fd36..9aa39fc12af 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -20,7 +20,6 @@ tinyfiledialogs = {git = "https://github.com/jdm/tinyfiledialogs"} angle = {git = "https://github.com/servo/angle", branch = "servo"} app_units = {version = "0.2.3", features = ["plugins"]} bitflags = "0.7" -canvas = {path = "../canvas"} canvas_traits = {path = "../canvas_traits"} caseless = "0.1.0" cssparser = {version = "0.5.4", features = ["heap_size", "serde-serialization"]} diff --git a/components/script/blob_url_store.rs b/components/script/blob_url_store.rs deleted file mode 100644 index 7f6f34ea406..00000000000 --- a/components/script/blob_url_store.rs +++ /dev/null @@ -1,59 +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/. */ - -#![allow(dead_code)] - -use dom::bindings::js::JS; -use dom::blob::Blob; -use origin::Origin; -use std::collections::HashMap; -use uuid::Uuid; - -#[must_root] -#[derive(JSTraceable, HeapSizeOf)] -struct EntryPair(Origin, JS<Blob>); - -// HACK: to work around the HeapSizeOf of Uuid -#[derive(PartialEq, HeapSizeOf, Eq, Hash, JSTraceable)] -struct BlobUrlId(#[ignore_heap_size_of = "defined in uuid"] Uuid); - -#[must_root] -#[derive(JSTraceable, HeapSizeOf)] -pub struct BlobURLStore { - entries: HashMap<BlobUrlId, EntryPair>, -} - -pub enum BlobURLStoreError { - InvalidKey, - InvalidOrigin, -} - -impl BlobURLStore { - pub fn new() -> BlobURLStore { - BlobURLStore { - entries: HashMap::new(), - } - } - - pub fn request(&self, id: Uuid, origin: &Origin) -> Result<&Blob, BlobURLStoreError> { - match self.entries.get(&BlobUrlId(id)) { - Some(ref pair) => { - if pair.0.same_origin(origin) { - Ok(&pair.1) - } else { - Err(BlobURLStoreError::InvalidOrigin) - } - } - None => Err(BlobURLStoreError::InvalidKey) - } - } - - pub fn add_entry(&mut self, id: Uuid, origin: Origin, blob: &Blob) { - self.entries.insert(BlobUrlId(id), EntryPair(origin, JS::from_ref(blob))); - } - - pub fn delete_entry(&mut self, id: Uuid) { - self.entries.remove(&BlobUrlId(id)); - } -} diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index cd3583edf4f..fc6afdc2b25 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -2,7 +2,6 @@ * 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::canvas_paint_thread::RectToi32; use canvas_traits::{Canvas2dMsg, CanvasCommonMsg, CanvasMsg}; use canvas_traits::{CompositionOrBlending, LineCapStyle, LineJoinStyle}; use canvas_traits::{FillOrStrokeStyle, FillRule, LinearGradientStyle, RadialGradientStyle, RepetitionStyle}; @@ -363,36 +362,30 @@ impl CanvasRenderingContext2D { let smoothing_enabled = self.state.borrow().image_smoothing_enabled; - // If the source and target canvas are the same - let msg = if &*self.canvas == canvas { - CanvasMsg::Canvas2d(Canvas2dMsg::DrawImageSelf(image_size, - dest_rect, - source_rect, - smoothing_enabled)) + if &*self.canvas == canvas { + let msg = CanvasMsg::Canvas2d(Canvas2dMsg::DrawImageSelf( + image_size, dest_rect, source_rect, smoothing_enabled)); + self.ipc_renderer.send(msg).unwrap(); } else { - // Source and target canvases are different let context = match canvas.get_or_init_2d_context() { Some(context) => context, None => return Err(Error::InvalidState), }; + let (sender, receiver) = ipc::channel().unwrap(); + let msg = CanvasMsg::Canvas2d(Canvas2dMsg::DrawImageInOther( + self.ipc_renderer.clone(), + image_size, + dest_rect, + source_rect, + smoothing_enabled, + sender)); + let renderer = context.get_ipc_renderer(); - let (sender, receiver) = ipc::channel::<Vec<u8>>().unwrap(); - // Reads pixels from source image - renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(source_rect.to_i32(), - image_size, - sender))) - .unwrap(); - let imagedata = receiver.recv().unwrap(); - // Writes pixels to destination canvas - CanvasMsg::Canvas2d(Canvas2dMsg::DrawImage(imagedata, - source_rect.size, - dest_rect, - source_rect, - smoothing_enabled)) + renderer.send(msg).unwrap(); + receiver.recv().unwrap(); }; - self.ipc_renderer.send(msg).unwrap(); self.mark_as_dirty(); Ok(()) } diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index fcc10e3d134..515d49c0f7c 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -6,6 +6,7 @@ use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::HTMLButtonElementBinding::HTMLButtonElementMethods; +use dom::bindings::codegen::Bindings::HTMLFormControlsCollectionBinding::HTMLFormControlsCollectionMethods; use dom::bindings::codegen::Bindings::HTMLFormElementBinding; use dom::bindings::codegen::Bindings::HTMLFormElementBinding::HTMLFormElementMethods; use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementMethods; @@ -229,6 +230,12 @@ impl HTMLFormElementMethods for HTMLFormElement { fn Length(&self) -> u32 { self.Elements().Length() as u32 } + + // https://html.spec.whatwg.org/multipage/#dom-form-item + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Root<Element>> { + let elements = self.Elements(); + elements.IndexedGetter(index, found) + } } #[derive(Copy, Clone, HeapSizeOf, PartialEq)] diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 57248c03e97..86146b8e915 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -11,12 +11,13 @@ use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementLocat use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementOpenTabEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementOpenWindowEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementSecurityChangeDetail; +use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementVisibilityChangeEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserShowModalPromptEventDetail; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding; use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::conversions::ToJSValConvertible; -use dom::bindings::error::{Error, ErrorResult}; +use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::{JS, MutNullableHeap, Root, LayoutJS}; @@ -68,6 +69,7 @@ pub struct HTMLIFrameElement { sandbox: MutNullableHeap<JS<DOMTokenList>>, sandbox_allowance: Cell<Option<u8>>, load_blocker: DOMRefCell<Option<LoadBlocker>>, + visibility: Cell<bool>, } impl HTMLIFrameElement { @@ -199,6 +201,7 @@ impl HTMLIFrameElement { sandbox: Default::default(), sandbox_allowance: Cell::new(None), load_blocker: DOMRefCell::new(None), + visibility: Cell::new(true), } } @@ -224,6 +227,26 @@ impl HTMLIFrameElement { self.pipeline_id.get() } + pub fn change_visibility_status(&self, visibility: bool) { + if self.visibility.get() != visibility { + self.visibility.set(visibility); + + // Visibility changes are only exposed to Mozbrowser iframes + if self.Mozbrowser() { + self.dispatch_mozbrowser_event(MozBrowserEvent::VisibilityChange(visibility)); + } + } + } + + pub fn set_visible(&self, visible: bool) { + if let Some(pipeline_id) = self.pipeline_id.get() { + let window = window_from_node(self); + let window = window.r(); + let msg = ConstellationMsg::SetVisible(pipeline_id, visible); + window.constellation_chan().send(msg).unwrap(); + } + } + /// https://html.spec.whatwg.org/multipage/#iframe-load-event-steps steps 1-4 pub fn iframe_load_event_steps(&self, loaded_pipeline: PipelineId) { // TODO(#9592): assert that the load blocker is present at all times when we @@ -390,6 +413,11 @@ impl MozBrowserEventDetailBuilder for HTMLIFrameElement { returnValue: Some(DOMString::from(return_value)), }.to_jsval(cx, rval) } + MozBrowserEvent::VisibilityChange(visibility) => { + BrowserElementVisibilityChangeEventDetail { + visible: Some(visibility), + }.to_jsval(cx, rval); + } } } } @@ -496,6 +524,30 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement { } } + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/setVisible + fn SetVisible(&self, visible: bool) -> ErrorResult { + if self.Mozbrowser() { + self.set_visible(visible); + Ok(()) + } else { + debug!("this frame is not mozbrowser: mozbrowser attribute missing, or not a top + level window, or mozbrowser preference not set (use --pref dom.mozbrowser.enabled)"); + Err(Error::NotSupported) + } + } + + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/getVisible + fn GetVisible(&self) -> Fallible<bool> { + if self.Mozbrowser() { + Ok(self.visibility.get()) + } else { + debug!("this frame is not mozbrowser: mozbrowser attribute missing, or not a top + level window, or mozbrowser preference not set (use --pref dom.mozbrowser.enabled)"); + Err(Error::NotSupported) + } + } + + // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/stop fn Stop(&self) -> ErrorResult { Err(Error::NotSupported) diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 4c164f2c819..561ccc647f2 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -33,7 +33,7 @@ use dom::validation::Validatable; use dom::virtualmethods::VirtualMethods; use ipc_channel::ipc::{self, IpcSender}; use net_traits::IpcSend; -use net_traits::filemanager_thread::FileManagerThreadMsg; +use net_traits::filemanager_thread::{FileManagerThreadMsg, FilterPattern}; use script_traits::ScriptMsg as ConstellationMsg; use std::borrow::ToOwned; use std::cell::Cell; @@ -993,7 +993,7 @@ impl Activatable for HTMLInputElement { // https://html.spec.whatwg.org/multipage/#reset-button-state-%28type=reset%29:activation-behaviour-2 // https://html.spec.whatwg.org/multipage/#checkbox-state-%28type=checkbox%29:activation-behaviour-2 // https://html.spec.whatwg.org/multipage/#radio-button-state-%28type=radio%29:activation-behaviour-2 - InputType::InputSubmit | InputType::InputReset + InputType::InputSubmit | InputType::InputReset | InputType::InputFile | InputType::InputCheckbox | InputType::InputRadio => self.is_mutable(), _ => false } @@ -1140,9 +1140,11 @@ impl Activatable for HTMLInputElement { let mut files: Vec<Root<File>> = vec![]; let mut error = None; + let filter = filter_from_accept(self.Accept()); + if self.Multiple() { let (chan, recv) = ipc::channel().expect("Error initializing channel"); - let msg = FileManagerThreadMsg::SelectFiles(chan); + let msg = FileManagerThreadMsg::SelectFiles(filter, chan); let _ = filemanager.send(msg).unwrap(); match recv.recv().expect("IpcSender side error") { @@ -1155,7 +1157,7 @@ impl Activatable for HTMLInputElement { }; } else { let (chan, recv) = ipc::channel().expect("Error initializing channel"); - let msg = FileManagerThreadMsg::SelectFile(chan); + let msg = FileManagerThreadMsg::SelectFile(filter, chan); let _ = filemanager.send(msg).unwrap(); match recv.recv().expect("IpcSender side error") { @@ -1228,3 +1230,10 @@ impl Activatable for HTMLInputElement { } } } + +fn filter_from_accept(_s: DOMString) -> Vec<FilterPattern> { + /// TODO: it means not pattern restriction now + /// Blocked by https://github.com/cybergeek94/mime_guess/issues/19 + vec![] +} + diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs index fc4e13d6fbe..2503378187e 100644 --- a/components/script/dom/nodelist.rs +++ b/components/script/dom/nodelist.rs @@ -217,9 +217,9 @@ impl ChildrenList { // by ChildrenMutation::replace(). unreachable!() }, - (_, [node, ..], _) => node, - (_, [], Some(next)) => next, - (Some(prev), [], None) => { + (_, &[node, ..], _) => node, + (_, &[], Some(next)) => next, + (Some(prev), &[], None) => { list.last_index.set(index - 1u32); prev }, diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index 8ecffe60b33..c6d23bd7d4c 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -3,18 +3,25 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::cell::DOMRefCell; +use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::URLBinding::{self, URLMethods}; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JS, MutNullableHeap, Root}; use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::str::{DOMString, USVString}; +use dom::blob::Blob; use dom::urlhelper::UrlHelper; use dom::urlsearchparams::URLSearchParams; +use ipc_channel::ipc; +use net_traits::IpcSend; +use net_traits::blob_url_store::{BlobURLStoreEntry, BlobURLStoreMsg, parse_blob_url}; +use net_traits::filemanager_thread::FileManagerThreadMsg; use std::borrow::ToOwned; use std::default::Default; use url::quirks::domain_to_unicode; use url::{Host, Url}; +use uuid::Uuid; // https://url.spec.whatwg.org/#url #[dom_struct] @@ -105,6 +112,90 @@ impl URL { pub fn DomainToUnicode(_: GlobalRef, origin: USVString) -> USVString { USVString(domain_to_unicode(&origin.0)) } + + // https://w3c.github.io/FileAPI/#dfn-createObjectURL + pub fn CreateObjectURL(global: GlobalRef, blob: &Blob) -> DOMString { + /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround + /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722 + let origin = global.get_url().origin().unicode_serialization(); + + if blob.IsClosed() { + // Generate a dummy id + let id = Uuid::new_v4().simple().to_string(); + return DOMString::from(URL::unicode_serialization_blob_url(&origin, &id)); + } + + let filemanager = global.resource_threads().sender(); + + let slice = blob.get_slice_or_empty(); + let bytes = slice.get_bytes(); + + let entry = BlobURLStoreEntry { + type_string: blob.Type().to_string(), + filename: None, // XXX: the filename is currently only in File object now + size: blob.Size(), + bytes: bytes.to_vec(), + }; + + let (tx, rx) = ipc::channel().unwrap(); + + let msg = BlobURLStoreMsg::AddEntry(entry, origin.clone(), tx); + + let _ = filemanager.send(FileManagerThreadMsg::BlobURLStoreMsg(msg)); + + match rx.recv().unwrap() { + Ok(id) => { + DOMString::from(URL::unicode_serialization_blob_url(&origin, &id)) + } + Err(_) => { + // Generate a dummy id + let id = Uuid::new_v4().simple().to_string(); + DOMString::from(URL::unicode_serialization_blob_url(&origin, &id)) + } + } + } + + // https://w3c.github.io/FileAPI/#dfn-revokeObjectURL + pub fn RevokeObjectURL(global: GlobalRef, url: DOMString) { + /* + If the url refers to a Blob that has a readability state of CLOSED OR + if the value provided for the url argument is not a Blob URL, OR + if the value provided for the url argument does not have an entry in the Blob URL Store, + + this method call does nothing. User agents may display a message on the error console. + + NOTE: The first step is unnecessary, since closed blobs do not exist in the store + */ + + match Url::parse(&url) { + Ok(url) => match parse_blob_url(&url) { + Some((id, _)) => { + let filemanager = global.resource_threads().sender(); + let msg = BlobURLStoreMsg::DeleteEntry(id.simple().to_string()); + let _ = filemanager.send(FileManagerThreadMsg::BlobURLStoreMsg(msg)); + } + None => {} + }, + Err(_) => {} + } + } + + // https://w3c.github.io/FileAPI/#unicodeSerializationOfBlobURL + fn unicode_serialization_blob_url(origin: &str, id: &str) -> String { + // Step 1, 2 + let mut result = "blob:".to_string(); + + // Step 3 + result.push_str(origin); + + // Step 4 + result.push('/'); + + // Step 5 + result.push_str(id); + + result + } } impl URLMethods for URL { diff --git a/components/script/dom/webidls/BrowserElement.webidl b/components/script/dom/webidls/BrowserElement.webidl index 9351cc9377a..f183b5cf813 100644 --- a/components/script/dom/webidls/BrowserElement.webidl +++ b/components/script/dom/webidls/BrowserElement.webidl @@ -96,20 +96,24 @@ dictionary BrowserElementOpenWindowEventDetail { // Element frameElement; }; +dictionary BrowserElementVisibilityChangeEventDetail { + boolean visible; +}; + BrowserElement implements BrowserElementCommon; BrowserElement implements BrowserElementPrivileged; [NoInterfaceObject] interface BrowserElementCommon { - //[Throws, - // Pref="dom.mozBrowserFramesEnabled", - // CheckAnyPermissions="browser embed-widgets"] - //void setVisible(boolean visible); - - //[Throws, - // Pref="dom.mozBrowserFramesEnabled", - // CheckAnyPermissions="browser embed-widgets"] - //DOMRequest getVisible(); + [Throws, + Pref="dom.mozbrowser.enabled", + CheckAnyPermissions="browser embed-widgets"] + void setVisible(boolean visible); + + [Throws, + Pref="dom.mozbrowser.enabled", + CheckAnyPermissions="browser embed-widgets"] + boolean getVisible(); //[Throws, // Pref="dom.mozBrowserFramesEnabled", diff --git a/components/script/dom/webidls/HTMLFormElement.webidl b/components/script/dom/webidls/HTMLFormElement.webidl index a56b83235b6..fba10d25509 100644 --- a/components/script/dom/webidls/HTMLFormElement.webidl +++ b/components/script/dom/webidls/HTMLFormElement.webidl @@ -17,7 +17,7 @@ interface HTMLFormElement : HTMLElement { [SameObject] readonly attribute HTMLFormControlsCollection elements; readonly attribute unsigned long length; - //getter Element (unsigned long index); + getter Element? (unsigned long index); //getter (RadioNodeList or Element) (DOMString name); void submit(); diff --git a/components/script/dom/webidls/URL.webidl b/components/script/dom/webidls/URL.webidl index dc4c71f512e..88f8704ef93 100644 --- a/components/script/dom/webidls/URL.webidl +++ b/components/script/dom/webidls/URL.webidl @@ -23,6 +23,11 @@ interface URL { readonly attribute URLSearchParams searchParams; attribute USVString hash; + // https://w3c.github.io/FileAPI/#creating-revoking + static DOMString createObjectURL(Blob blob); + // static DOMString createFor(Blob blob); + static void revokeObjectURL(DOMString url); + // This is only doing as well as gecko right now. // https://github.com/servo/servo/issues/7590 is on file for // adding attribute stringifier support. diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 34f7c1acdb0..03fbe2b2a2b 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use app_units::Au; -use blob_url_store::BlobURLStore; use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType, WorkerId}; use dom::bindings::callback::ExceptionHandling; use dom::bindings::cell::DOMRefCell; @@ -167,9 +166,6 @@ pub struct Window { scheduler_chan: IpcSender<TimerEventRequest>, timers: OneshotTimers, - /// Blob URL store - blob_url_store: DOMRefCell<BlobURLStore>, - next_worker_id: Cell<WorkerId>, /// For sending messages to the memory profiler. @@ -1509,6 +1505,14 @@ impl Window { self.timers.suspend(); } + pub fn slow_down_timers(&self) { + self.timers.slow_down(); + } + + pub fn speed_up_timers(&self) { + self.timers.speed_up(); + } + pub fn need_emit_timeline_marker(&self, timeline_type: TimelineMarkerType) -> bool { let markers = self.devtools_markers.borrow(); markers.contains(&timeline_type) @@ -1633,7 +1637,6 @@ impl Window { console: Default::default(), crypto: Default::default(), navigator: Default::default(), - blob_url_store: DOMRefCell::new(BlobURLStore::new()), image_cache_thread: image_cache_thread, mem_profiler_chan: mem_profiler_chan, time_profiler_chan: time_profiler_chan, diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs index 5762e2aa63f..a136f4ec8ca 100644 --- a/components/script/dom/worker.rs +++ b/components/script/dom/worker.rs @@ -147,7 +147,10 @@ impl WorkerMethods for Worker { fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult { let data = try!(StructuredCloneData::write(cx, message)); let address = Trusted::new(self); - self.sender.send((address, WorkerScriptMsg::DOMMessage(data))).unwrap(); + + // NOTE: step 9 of https://html.spec.whatwg.org/multipage/#dom-messageport-postmessage + // indicates that a nonexistent communication channel should result in a silent error. + let _ = self.sender.send((address, WorkerScriptMsg::DOMMessage(data))); Ok(()) } diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs index b10916a4b6e..0ca45c509b7 100644 --- a/components/script/dom/workerglobalscope.rs +++ b/components/script/dom/workerglobalscope.rs @@ -2,9 +2,7 @@ * 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 blob_url_store::BlobURLStore; use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId, DevtoolsPageInfo}; -use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods; use dom::bindings::error::{Error, ErrorResult, Fallible, report_pending_exception}; @@ -115,8 +113,6 @@ pub struct WorkerGlobalScope { console: MutNullableHeap<JS<Console>>, crypto: MutNullableHeap<JS<Crypto>>, timers: OneshotTimers, - /// Blob URL store - blob_url_store: DOMRefCell<BlobURLStore>, #[ignore_heap_size_of = "Defined in std"] mem_profiler_chan: mem::ProfilerChan, @@ -177,7 +173,6 @@ impl WorkerGlobalScope { console: Default::default(), crypto: Default::default(), timers: OneshotTimers::new(timer_event_chan, init.scheduler_chan.clone()), - blob_url_store: DOMRefCell::new(BlobURLStore::new()), mem_profiler_chan: init.mem_profiler_chan, time_profiler_chan: init.time_profiler_chan, to_devtools_sender: init.to_devtools_sender, diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 785a5928c9f..edae06fe66c 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -1041,12 +1041,6 @@ impl XMLHttpRequest { self.response_status.set(Ok(())); } - fn insert_trusted_header(&self, name: String, value: String) { - // Insert a header without checking spec-compliance - // Use for hardcoded headers - self.request_headers.borrow_mut().set_raw(name, vec![value.into_bytes()]); - } - fn dispatch_progress_event(&self, upload: bool, type_: Atom, loaded: u64, total: Option<u64>) { let global = self.global(); let progressevent = ProgressEvent::new(global.r(), diff --git a/components/script/lib.rs b/components/script/lib.rs index 2f76a112c0a..307376854ca 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -34,7 +34,6 @@ extern crate app_units; #[allow(unused_extern_crates)] #[macro_use] extern crate bitflags; -extern crate canvas; extern crate canvas_traits; extern crate caseless; extern crate core; @@ -87,7 +86,6 @@ extern crate webrender_traits; extern crate websocket; extern crate xml5ever; -mod blob_url_store; pub mod bluetooth_blacklist; pub mod clipboard_provider; mod devtools; diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 4750a8d6390..3459e5ddcfa 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -140,6 +140,8 @@ struct InProgressLoad { clip_rect: Option<Rect<f32>>, /// Window is frozen (navigated away while loading for example). is_frozen: bool, + /// Window is visible. + is_visible: bool, /// The requested URL of the load. url: Url, } @@ -158,6 +160,7 @@ impl InProgressLoad { window_size: window_size, clip_rect: None, is_frozen: false, + is_visible: true, url: url, } } @@ -919,6 +922,10 @@ impl ScriptThread { self.handle_freeze_msg(pipeline_id), ConstellationControlMsg::Thaw(pipeline_id) => self.handle_thaw_msg(pipeline_id), + ConstellationControlMsg::ChangeFrameVisibilityStatus(pipeline_id, visible) => + self.handle_visibility_change_msg(pipeline_id, visible), + ConstellationControlMsg::NotifyVisibilityChange(containing_id, pipeline_id, visible) => + self.handle_visibility_change_complete_msg(containing_id, pipeline_id, visible), ConstellationControlMsg::MozBrowserEvent(parent_pipeline_id, subpage_id, event) => @@ -1232,6 +1239,55 @@ impl ScriptThread { reports_chan.send(reports); } + /// To slow/speed up timers and manage any other script thread resource based on visibility. + /// Returns true if successful. + fn alter_resource_utilization(&self, id: PipelineId, visible: bool) -> bool { + if let Some(root_context) = self.browsing_context.get() { + if let Some(ref inner_context) = root_context.find(id) { + let window = inner_context.active_window(); + if visible { + window.speed_up_timers(); + } else { + window.slow_down_timers(); + } + return true; + } + } + false + } + + /// Updates iframe element after a change in visibility + fn handle_visibility_change_complete_msg(&self, containing_id: PipelineId, id: PipelineId, visible: bool) { + if let Some(root_context) = self.browsing_context.get() { + if let Some(ref inner_context) = root_context.find(containing_id) { + if let Some(iframe) = inner_context.active_document().find_iframe_by_pipeline(id) { + iframe.change_visibility_status(visible); + } + } + } + } + + /// Handle visibility change message + fn handle_visibility_change_msg(&self, id: PipelineId, visible: bool) { + let resources_altered = self.alter_resource_utilization(id, visible); + + // Separate message sent since parent script thread could be different (Iframe of different + // domain) + self.constellation_chan.send(ConstellationMsg::VisibilityChangeComplete(id, visible)).unwrap(); + + if !resources_altered { + let mut loads = self.incomplete_loads.borrow_mut(); + if let Some(ref mut load) = loads.iter_mut().find(|load| load.pipeline_id == id) { + load.is_visible = visible; + return; + } + } else { + return; + } + + warn!("change visibility message sent to nonexistent pipeline"); + } + /// Handles freeze message fn handle_freeze_msg(&self, id: PipelineId) { if let Some(root_context) = self.browsing_context.get() { @@ -1707,6 +1763,10 @@ impl ScriptThread { window.freeze(); } + if !incomplete.is_visible { + self.alter_resource_utilization(browsing_context.pipeline(), false); + } + context_remover.neuter(); document.get_current_parser().unwrap() diff --git a/components/script/timers.rs b/components/script/timers.rs index 504dbb8aaaf..989382e80fe 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -22,6 +22,7 @@ use std::cmp::{self, Ord, Ordering}; use std::collections::HashMap; use std::default::Default; use std::rc::Rc; +use util::prefs::get_pref; #[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)] pub struct OneshotTimerHandle(i32); @@ -212,6 +213,15 @@ impl OneshotTimers { } } + pub fn slow_down(&self) { + let duration = get_pref("js.timers.minimum_duration").as_u64().unwrap_or(1000); + self.js_timers.set_min_duration(MsDuration::new(duration)); + } + + pub fn speed_up(&self) { + self.js_timers.remove_min_duration(); + } + pub fn suspend(&self) { assert!(self.suspended_since.get().is_none()); @@ -290,6 +300,8 @@ pub struct JsTimers { active_timers: DOMRefCell<HashMap<JsTimerHandle, JsTimerEntry>>, /// The nesting level of the currently executing timer task or 0. nesting_level: Cell<u32>, + /// Used to introduce a minimum delay in event intervals + min_duration: Cell<Option<MsDuration>>, } #[derive(JSTraceable, HeapSizeOf)] @@ -344,6 +356,7 @@ impl JsTimers { next_timer_handle: Cell::new(JsTimerHandle(1)), active_timers: DOMRefCell::new(HashMap::new()), nesting_level: Cell::new(0), + min_duration: Cell::new(None), } } @@ -407,6 +420,24 @@ impl JsTimers { } } + pub fn set_min_duration(&self, duration: MsDuration) { + self.min_duration.set(Some(duration)); + } + + pub fn remove_min_duration(&self) { + self.min_duration.set(None); + } + + // see step 13 of https://html.spec.whatwg.org/multipage/#timer-initialisation-steps + fn user_agent_pad(&self, current_duration: MsDuration) -> MsDuration { + match self.min_duration.get() { + Some(min_duration) => { + cmp::max(min_duration, current_duration) + }, + None => current_duration + } + } + // see https://html.spec.whatwg.org/multipage/#timer-initialisation-steps fn initialize_and_schedule(&self, global: GlobalRef, mut task: JsTimerTask) { let handle = task.handle; @@ -415,13 +446,12 @@ impl JsTimers { // step 6 let nesting_level = self.nesting_level.get(); - // step 7 - let duration = clamp_duration(nesting_level, task.duration); - + // step 7, 13 + let duration = self.user_agent_pad(clamp_duration(nesting_level, task.duration)); // step 8, 9 task.nesting_level = nesting_level + 1; - // essentially step 11-14 + // essentially step 11, 12, and 14 let callback = OneshotTimerCallback::JsTimer(task); let oneshot_handle = global.schedule_callback(callback, duration); diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 07cfaccb84c..cc8a06bf18e 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -163,6 +163,10 @@ pub enum ConstellationControlMsg { Freeze(PipelineId), /// Notifies script thread to resume all its timers Thaw(PipelineId), + /// Notifies script thread whether frame is visible + ChangeFrameVisibilityStatus(PipelineId, bool), + /// Notifies script thread that frame visibility change is complete + NotifyVisibilityChange(PipelineId, PipelineId, bool), /// Notifies script thread that a url should be loaded in this iframe. Navigate(PipelineId, SubpageId, LoadData), /// Requests the script thread forward a mozbrowser event to an iframe it owns @@ -451,6 +455,8 @@ pub enum MozBrowserEvent { UsernameAndPasswordRequired, /// Sent when a link to a search engine is found. OpenSearch, + /// Sent when visibility state changes. + VisibilityChange(bool), } impl MozBrowserEvent { @@ -472,7 +478,8 @@ impl MozBrowserEvent { MozBrowserEvent::ShowModalPrompt(_, _, _, _) => "mozbrowsershowmodalprompt", MozBrowserEvent::TitleChange(_) => "mozbrowsertitlechange", MozBrowserEvent::UsernameAndPasswordRequired => "mozbrowserusernameandpasswordrequired", - MozBrowserEvent::OpenSearch => "mozbrowseropensearch" + MozBrowserEvent::OpenSearch => "mozbrowseropensearch", + MozBrowserEvent::VisibilityChange(_) => "mozbrowservisibilitychange", } } } diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 241833bc13f..7fc871eb4cc 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -81,6 +81,10 @@ pub enum ScriptMsg { NodeStatus(Option<String>), /// Notification that this iframe should be removed. RemoveIFrame(PipelineId, Option<IpcSender<()>>), + /// Change pipeline visibility + SetVisible(PipelineId, bool), + /// Notifies constellation that an iframe's visibility has been changed. + VisibilityChangeComplete(PipelineId, bool), /// A load has been requested in an IFrame. ScriptLoadedURLInIFrame(IFrameLoadInfo), /// Requests that the constellation set the contents of the clipboard diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 91fa8562c38..b973dc19cbd 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -75,8 +75,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -90,7 +90,7 @@ dependencies = [ [[package]] name = "aster" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -106,8 +106,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 2.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "servo-skia 0.20130412.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -145,7 +145,7 @@ dependencies = [ "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -194,7 +194,7 @@ dependencies = [ "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "util 0.0.1", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", @@ -212,8 +212,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", ] @@ -321,8 +321,8 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "script_traits 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -350,13 +350,13 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "profile_traits 0.0.1", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -408,7 +408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -435,8 +435,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -491,9 +491,9 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] @@ -508,8 +508,8 @@ dependencies = [ "hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "msg 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -664,8 +664,8 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -778,8 +778,8 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "range 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "simd 0.1.0 (git+https://github.com/huonw/simd)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -814,8 +814,8 @@ dependencies = [ "layers 0.2.5 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -986,7 +986,7 @@ dependencies = [ "openssl 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1058,8 +1058,8 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1158,7 +1158,7 @@ dependencies = [ "script_traits 0.0.1", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", @@ -1307,7 +1307,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1353,8 +1353,8 @@ dependencies = [ "layers 0.2.5 (git+https://github.com/servo/rust-layers)", "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", @@ -1443,8 +1443,8 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1561,7 +1561,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "offscreen_gl_context" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1571,8 +1571,7 @@ dependencies = [ "gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1728,9 +1727,9 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "task_info 0.0.1", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -1753,30 +1752,30 @@ dependencies = [ "energymon 0.2.0 (git+https://github.com/energymon/energymon-rust.git)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quasi" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quasi_codegen" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aster 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quasi_macros" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quasi_codegen 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_codegen 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1804,8 +1803,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1875,7 +1874,6 @@ dependencies = [ "angle 0.1.0 (git+https://github.com/servo/angle?branch=servo)", "app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "canvas 0.0.1", "canvas_traits 0.0.1", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1897,7 +1895,7 @@ dependencies = [ "msg 0.0.1", "net_traits 0.0.1", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "open 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_macros 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1910,7 +1908,7 @@ dependencies = [ "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", @@ -1949,11 +1947,11 @@ dependencies = [ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "profile_traits 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1983,17 +1981,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_codegen" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi_macros 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aster 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_macros 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2002,15 +2000,15 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_macros" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_codegen 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2144,7 +2142,7 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "phf_generator 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2166,8 +2164,8 @@ dependencies = [ "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", @@ -2203,8 +2201,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] @@ -2350,7 +2348,7 @@ dependencies = [ "idna 0.1.0 (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.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2397,8 +2395,8 @@ dependencies = [ "plugins 0.0.1", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2417,7 +2415,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2534,7 +2532,7 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", @@ -2551,9 +2549,9 @@ dependencies = [ "euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/components/style/dom.rs b/components/style/dom.rs index badd4f31065..7d10b394989 100644 --- a/components/style/dom.rs +++ b/components/style/dom.rs @@ -86,12 +86,6 @@ pub trait TNode : Sized + Copy + Clone { /// Converts self into an `OpaqueNode`. fn opaque(&self) -> OpaqueNode; - /// Initializes style and layout data for the node. No-op if the data is already - /// initialized. - /// - /// FIXME(pcwalton): Do this as part of fragment building instead of in a traversal. - fn initialize_data(self); - /// While doing a reflow, the node at the root has no parent, as far as we're /// concerned. This method returns `None` at the reflow root. fn layout_parent_node(self, reflow_root: OpaqueNode) -> Option<Self>; diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index d2e6a090a3b..77be57aa097 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -184,7 +184,7 @@ ${helpers.predefined_type( ${helpers.single_keyword("background-repeat", "repeat repeat-x repeat-y no-repeat")} -${helpers.single_keyword("background-attachment", "scroll fixed")} +${helpers.single_keyword("background-attachment", "scroll fixed" + (" local" if product == "gecko" else ""))} ${helpers.single_keyword("background-clip", "border-box padding-box content-box")} diff --git a/components/style/traversal.rs b/components/style/traversal.rs index 386af02e5ef..1afdcbb34c7 100644 --- a/components/style/traversal.rs +++ b/components/style/traversal.rs @@ -125,12 +125,6 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C, where N: TNode, C: StyleContext<'a, <N::ConcreteElement as Element>::Impl>, <N::ConcreteElement as Element>::Impl: SelectorImplExt<ComputedValues=N::ConcreteComputedValues> + 'a { - // Initialize layout data. - // - // FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML - // parser. - node.initialize_data(); - // Get the parent node. let parent_opt = match node.parent_node() { Some(parent) if parent.is_element() => Some(parent), diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index d2e0cdc5ac1..04f738380f0 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -53,8 +53,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -68,7 +68,7 @@ dependencies = [ [[package]] name = "aster" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -84,8 +84,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 2.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "servo-skia 0.20130412.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -123,7 +123,7 @@ dependencies = [ "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -172,7 +172,7 @@ dependencies = [ "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "util 0.0.1", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", @@ -190,8 +190,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", ] @@ -284,8 +284,8 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "script_traits 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -313,13 +313,13 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "profile_traits 0.0.1", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -371,7 +371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -398,8 +398,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -454,9 +454,9 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] @@ -471,8 +471,8 @@ dependencies = [ "hyper 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "msg 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -586,8 +586,8 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -700,8 +700,8 @@ dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "range 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "simd 0.1.0 (git+https://github.com/huonw/simd)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -727,8 +727,8 @@ dependencies = [ "layers 0.2.5 (git+https://github.com/servo/rust-layers)", "msg 0.0.1", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -899,7 +899,7 @@ dependencies = [ "openssl 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -971,8 +971,8 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1071,7 +1071,7 @@ dependencies = [ "script_traits 0.0.1", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", @@ -1213,7 +1213,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1259,8 +1259,8 @@ dependencies = [ "layers 0.2.5 (git+https://github.com/servo/rust-layers)", "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", @@ -1328,8 +1328,8 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1439,7 +1439,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "offscreen_gl_context" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1449,8 +1449,7 @@ dependencies = [ "gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1597,9 +1596,9 @@ dependencies = [ "plugins 0.0.1", "profile_traits 0.0.1", "regex 0.1.71 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "task_info 0.0.1", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", @@ -1611,30 +1610,30 @@ version = "0.0.1" dependencies = [ "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", "plugins 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quasi" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quasi_codegen" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aster 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quasi_macros" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quasi_codegen 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_codegen 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1662,8 +1661,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1733,7 +1732,6 @@ dependencies = [ "angle 0.1.0 (git+https://github.com/servo/angle?branch=servo)", "app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "canvas 0.0.1", "canvas_traits 0.0.1", "caseless 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1755,7 +1753,7 @@ dependencies = [ "msg 0.0.1", "net_traits 0.0.1", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "open 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_macros 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1768,7 +1766,7 @@ dependencies = [ "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "script_traits 0.0.1", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", @@ -1797,11 +1795,11 @@ dependencies = [ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "msg 0.0.1", "net_traits 0.0.1", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "profile_traits 0.0.1", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1831,17 +1829,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_codegen" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi_macros 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aster 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_macros 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1850,15 +1848,15 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_macros" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_codegen 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2029,7 +2027,7 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "phf_generator 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", "phf_shared 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2051,8 +2049,8 @@ dependencies = [ "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", @@ -2072,8 +2070,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] @@ -2219,7 +2217,7 @@ dependencies = [ "idna 0.1.0 (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.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2266,8 +2264,8 @@ dependencies = [ "plugins 0.0.1", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2279,7 +2277,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2396,7 +2394,7 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "scoped_threadpool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", @@ -2413,9 +2411,9 @@ dependencies = [ "euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)", - "offscreen_gl_context 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "offscreen_gl_context 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ports/geckolib/Cargo.lock b/ports/geckolib/Cargo.lock index f57f2332eea..0391485d536 100644 --- a/ports/geckolib/Cargo.lock +++ b/ports/geckolib/Cargo.lock @@ -42,13 +42,13 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "aster" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -82,7 +82,7 @@ dependencies = [ "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -109,8 +109,8 @@ dependencies = [ "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -206,8 +206,8 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -264,8 +264,8 @@ dependencies = [ "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -328,23 +328,23 @@ dependencies = [ [[package]] name = "quasi" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quasi_codegen" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aster 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quasi_macros" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quasi_codegen 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_codegen 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -409,25 +409,25 @@ dependencies = [ [[package]] name = "serde" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_codegen" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aster 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "quasi_macros 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "aster 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_macros 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_macros" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_codegen 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -442,7 +442,7 @@ dependencies = [ "gecko_bindings 0.0.1", "heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -471,8 +471,8 @@ dependencies = [ "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "style_traits 0.0.1", @@ -492,8 +492,8 @@ dependencies = [ "heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "plugins 0.0.1", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", ] @@ -562,7 +562,7 @@ dependencies = [ "idna 0.1.0 (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.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -592,8 +592,8 @@ dependencies = [ "plugins 0.0.1", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_macros 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -605,7 +605,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index 3444403271f..a49eeb5ab16 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -384,8 +384,6 @@ impl Debug for ${style_struct.gecko_struct_name} { force_stub = []; # These are currently being shuffled to a different style struct on the gecko side. force_stub += ["backface-visibility", "transform-box", "transform-style"] - # These live in nsStyleImageLayers in gecko. Need to figure out what to do about that. - force_stub += ["background-attachment", "background-clip", "background-origin"]; # These live in an nsFont member in Gecko. Should be straightforward to do manually. force_stub += ["font-kerning", "font-stretch", "font-variant"] # These have unusual representations in gecko. @@ -746,31 +744,37 @@ fn static_assert() { } </%self:impl_trait> +// TODO: Gecko accepts lists in most background-related properties. We just use +// the first element (which is the common case), but at some point we want to +// add support for parsing these lists in servo and pushing to nsTArray's. +<% skip_background_longhands = """background-color background-repeat + background-image background-clip + background-origin background-attachment""" %> <%self:impl_trait style_struct_name="Background" - skip_longhands="background-color background-repeat background-image" + skip_longhands="${skip_background_longhands}" skip_additionals="*"> <% impl_color("background_color", "mBackgroundColor") %> fn copy_background_repeat_from(&mut self, other: &Self) { - self.gecko.mImage.mRepeatCount = other.gecko.mImage.mRepeatCount; + self.gecko.mImage.mRepeatCount = cmp::min(1, other.gecko.mImage.mRepeatCount); self.gecko.mImage.mLayers.mFirstElement.mRepeat = other.gecko.mImage.mLayers.mFirstElement.mRepeat; } fn set_background_repeat(&mut self, v: longhands::background_repeat::computed_value::T) { - use style::properties::longhands::background_repeat::computed_value::T as Computed; + use style::properties::longhands::background_repeat::computed_value::T; use gecko_bindings::structs::{NS_STYLE_IMAGELAYER_REPEAT_REPEAT, NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT}; use gecko_bindings::structs::nsStyleImageLayers_Repeat; let (repeat_x, repeat_y) = match v { - Computed::repeat_x => (NS_STYLE_IMAGELAYER_REPEAT_REPEAT, - NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT), - Computed::repeat_y => (NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT, - NS_STYLE_IMAGELAYER_REPEAT_REPEAT), - Computed::repeat => (NS_STYLE_IMAGELAYER_REPEAT_REPEAT, - NS_STYLE_IMAGELAYER_REPEAT_REPEAT), - Computed::no_repeat => (NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT, - NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT), + T::repeat_x => (NS_STYLE_IMAGELAYER_REPEAT_REPEAT, + NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT), + T::repeat_y => (NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT, + NS_STYLE_IMAGELAYER_REPEAT_REPEAT), + T::repeat => (NS_STYLE_IMAGELAYER_REPEAT_REPEAT, + NS_STYLE_IMAGELAYER_REPEAT_REPEAT), + T::no_repeat => (NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT, + NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT), }; self.gecko.mImage.mRepeatCount = 1; @@ -780,6 +784,59 @@ fn static_assert() { }; } + fn copy_background_clip_from(&mut self, other: &Self) { + self.gecko.mImage.mClipCount = cmp::min(1, other.gecko.mImage.mClipCount); + self.gecko.mImage.mLayers.mFirstElement.mClip = + other.gecko.mImage.mLayers.mFirstElement.mClip; + } + + fn set_background_clip(&mut self, v: longhands::background_clip::computed_value::T) { + use style::properties::longhands::background_clip::computed_value::T; + self.gecko.mImage.mClipCount = 1; + + // TODO: Gecko supports background-clip: text, but just on -webkit- + // prefixed properties. + self.gecko.mImage.mLayers.mFirstElement.mClip = match v { + T::border_box => structs::NS_STYLE_IMAGELAYER_CLIP_BORDER as u8, + T::padding_box => structs::NS_STYLE_IMAGELAYER_CLIP_PADDING as u8, + T::content_box => structs::NS_STYLE_IMAGELAYER_CLIP_CONTENT as u8, + }; + } + + fn copy_background_origin_from(&mut self, other: &Self) { + self.gecko.mImage.mOriginCount = cmp::min(1, other.gecko.mImage.mOriginCount); + self.gecko.mImage.mLayers.mFirstElement.mOrigin = + other.gecko.mImage.mLayers.mFirstElement.mOrigin; + } + + fn set_background_origin(&mut self, v: longhands::background_origin::computed_value::T) { + use style::properties::longhands::background_origin::computed_value::T; + + self.gecko.mImage.mOriginCount = 1; + self.gecko.mImage.mLayers.mFirstElement.mOrigin = match v { + T::border_box => structs::NS_STYLE_IMAGELAYER_ORIGIN_BORDER as u8, + T::padding_box => structs::NS_STYLE_IMAGELAYER_ORIGIN_PADDING as u8, + T::content_box => structs::NS_STYLE_IMAGELAYER_ORIGIN_CONTENT as u8, + }; + } + + fn copy_background_attachment_from(&mut self, other: &Self) { + self.gecko.mImage.mAttachmentCount = cmp::min(1, other.gecko.mImage.mAttachmentCount); + self.gecko.mImage.mLayers.mFirstElement.mAttachment = + other.gecko.mImage.mLayers.mFirstElement.mAttachment; + } + + fn set_background_attachment(&mut self, v: longhands::background_attachment::computed_value::T) { + use style::properties::longhands::background_attachment::computed_value::T; + + self.gecko.mImage.mAttachmentCount = 1; + self.gecko.mImage.mLayers.mFirstElement.mAttachment = match v { + T::scroll => structs::NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL as u8, + T::fixed => structs::NS_STYLE_IMAGELAYER_ATTACHMENT_FIXED as u8, + T::local => structs::NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL as u8, + }; + } + fn copy_background_image_from(&mut self, other: &Self) { unsafe { Gecko_CopyImageValueFrom(&mut self.gecko.mImage.mLayers.mFirstElement.mImage, diff --git a/ports/geckolib/traversal.rs b/ports/geckolib/traversal.rs index 4e10d8c8fc8..f400377aeca 100644 --- a/ports/geckolib/traversal.rs +++ b/ports/geckolib/traversal.rs @@ -80,7 +80,14 @@ impl<'lc, 'ln> DomTraversalContext<GeckoNode<'ln>> for RecalcStyleOnly<'lc> { } } - fn process_preorder(&self, node: GeckoNode<'ln>) { recalc_style_at(&self.context, self.root, node); } + fn process_preorder(&self, node: GeckoNode<'ln>) { + // FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML + // parser. + node.initialize_data(); + + recalc_style_at(&self.context, self.root, node); + } + fn process_postorder(&self, _: GeckoNode<'ln>) {} } diff --git a/ports/geckolib/wrapper.rs b/ports/geckolib/wrapper.rs index b36e8fd7463..7a4125717c5 100644 --- a/ports/geckolib/wrapper.rs +++ b/ports/geckolib/wrapper.rs @@ -81,6 +81,15 @@ impl<'ln> GeckoNode<'ln> { Gecko_GetNodeData(self.node) as NonOpaqueStyleData } } + + pub fn initialize_data(self) { + unsafe { + if self.get_node_data().is_null() { + let ptr: NonOpaqueStyleData = Box::into_raw(box RefCell::new(PrivateStyleData::new())); + Gecko_SetNodeData(self.node, ptr as *mut ServoNodeData); + } + } + } } #[derive(Clone, Copy)] @@ -132,15 +141,6 @@ impl<'ln> TNode for GeckoNode<'ln> { OpaqueNode(ptr) } - fn initialize_data(self) { - unsafe { - if self.get_node_data().is_null() { - let ptr: NonOpaqueStyleData = Box::into_raw(box RefCell::new(PrivateStyleData::new())); - Gecko_SetNodeData(self.node, ptr as *mut ServoNodeData); - } - } - } - fn layout_parent_node(self, reflow_root: OpaqueNode) -> Option<GeckoNode<'ln>> { if self.opaque() == reflow_root { None diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 5bc64956a15..1bd0c528b7e 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -19,19 +19,21 @@ import subprocess import sys from licenseck import licenses +# License and header checks +EMACS_HEADER = "/* -*- Mode:" +VIM_HEADER = "/* vim:" +MAX_LICENSE_LINESPAN = max(len(license.splitlines()) for license in licenses) + # File patterns to include in the non-WPT tidy check. -file_patterns_to_check = ["*.rs", "*.rc", "*.cpp", "*.c", +FILE_PATTERNS_TO_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c", "*.h", "Cargo.lock", "*.py", "*.toml", "*.webidl", "*.json"] # File patterns that are ignored for all tidy and lint checks. -file_patterns_to_ignore = [ - "*.#*", - "*.pyc", -] +FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc"] # Files that are ignored for all tidy and lint checks. -ignored_files = [ +IGNORED_FILES = [ # Generated and upstream code combined with our own. Could use cleanup os.path.join(".", "ports", "geckolib", "gecko_bindings", "bindings.rs"), os.path.join(".", "ports", "geckolib", "gecko_bindings", "structs_debug.rs"), @@ -49,7 +51,7 @@ ignored_files = [ ] # Directories that are ignored for the non-WPT tidy check. -ignored_dirs = [ +IGNORED_DIRS = [ # Upstream os.path.join(".", "support", "android", "apk"), os.path.join(".", "support", "rust-task_info"), @@ -74,7 +76,31 @@ ignored_dirs = [ os.path.join(".", "."), ] -spec_base_path = "components/script/dom/" +SPEC_BASE_PATH = "components/script/dom/" + +WEBIDL_STANDARDS = [ + "//www.khronos.org/registry/webgl/specs", + "//developer.mozilla.org/en-US/docs/Web/API", + "//dev.w3.org/2006/webapi", + "//dev.w3.org/csswg", + "//dev.w3.org/fxtf", + "//dvcs.w3.org/hg", + "//dom.spec.whatwg.org", + "//domparsing.spec.whatwg.org", + "//drafts.csswg.org/cssom", + "//drafts.fxtf.org", + "//encoding.spec.whatwg.org", + "//html.spec.whatwg.org", + "//url.spec.whatwg.org", + "//xhr.spec.whatwg.org", + "//w3c.github.io", + "//heycam.github.io/webidl", + "//webbluetoothcg.github.io/web-bluetooth/", + "//slightlyoff.github.io/ServiceWorker/spec/service_worker/", + # Not a URL + "// This interface is entirely internal to Servo, and should not be" + + " accessible to\n// web pages." +] def is_iter_empty(iterator): @@ -97,16 +123,16 @@ def progress_wrapper(iterator): def filter_file(file_name): - if any(file_name.startswith(ignored_file) for ignored_file in ignored_files): + if any(file_name.startswith(ignored_file) for ignored_file in IGNORED_FILES): return False base_name = os.path.basename(file_name) - if any(fnmatch.fnmatch(base_name, pattern) for pattern in file_patterns_to_ignore): + if any(fnmatch.fnmatch(base_name, pattern) for pattern in FILE_PATTERNS_TO_IGNORE): return False return True def filter_files(start_dir, only_changed_files, progress): - file_iter = get_file_list(start_dir, only_changed_files, ignored_dirs) + file_iter = get_file_list(start_dir, only_changed_files, IGNORED_DIRS) (has_element, file_iter) = is_iter_empty(file_iter) if not has_element: raise StopIteration @@ -114,18 +140,13 @@ def filter_files(start_dir, only_changed_files, progress): file_iter = progress_wrapper(file_iter) for file_name in file_iter: base_name = os.path.basename(file_name) - if not any(fnmatch.fnmatch(base_name, pattern) for pattern in file_patterns_to_check): + if not any(fnmatch.fnmatch(base_name, pattern) for pattern in FILE_PATTERNS_TO_CHECK): continue if not filter_file(file_name): continue yield file_name -EMACS_HEADER = "/* -*- Mode:" -VIM_HEADER = "/* vim:" -MAX_LICENSE_LINESPAN = max(len(license.splitlines()) for license in licenses) - - def check_license(file_name, lines): if any(file_name.endswith(ext) for ext in (".toml", ".lock", ".json")): raise StopIteration @@ -273,13 +294,6 @@ duplicate versions for package "{package}" yield (1, message) -def maybe_int(value): - try: - return int(value) - except ValueError: - return value - - def check_toml(file_name, lines): if not file_name.endswith(".toml"): raise StopIteration @@ -295,9 +309,9 @@ def check_rust(file_name, lines): file_name.endswith(os.path.join("geckolib", "build.rs")) or \ file_name.endswith(os.path.join("unit", "style", "stylesheets.rs")): raise StopIteration + comment_depth = 0 merged_lines = '' - import_block = False whitespace = False @@ -314,6 +328,8 @@ def check_rust(file_name, lines): for idx, original_line in enumerate(lines): # simplify the analysis line = original_line.strip() + is_attribute = re.search(r"#\[.*\]", line) + is_comment = re.search(r"^//|^/\*|^\*", line) # Simple heuristic to avoid common case of no comments. if '/' in line: @@ -331,17 +347,17 @@ def check_rust(file_name, lines): merged_lines = '' # Keep track of whitespace to enable checking for a merged import block - # + # Ignore attributes, comments, and imports if import_block: - if not (line_is_comment(line) or line_is_attribute(line) or line.startswith("use ")): + if not (is_comment or is_attribute or line.startswith("use ")): whitespace = line == "" if not whitespace: import_block = False # get rid of strings and chars because cases like regex expression, keep attributes - if not line_is_attribute(line): + if not is_attribute: line = re.sub(r'"(\\.|[^\\"])*?"', '""', line) line = re.sub(r"'(\\.|[^\\'])*?'", "''", line) @@ -355,21 +371,22 @@ def check_rust(file_name, lines): # tuple format: (pattern, format_message, filter_function(match, line)) no_filter = lambda match, line: True regex_rules = [ - (r",[^\s]", "missing space after ,", lambda match, line: '$' not in line), + (r",[^\s]", "missing space after ,", + lambda match, line: '$' not in line and not is_attribute), (r"[A-Za-z0-9\"]=", "missing space before =", - lambda match, line: line_is_attribute(line)), + lambda match, line: is_attribute), (r"=[A-Za-z0-9\"]", "missing space after =", - lambda match, line: line_is_attribute(line)), + lambda match, line: is_attribute), # ignore scientific notation patterns like 1e-6 (r"[A-DF-Za-df-z0-9]-", "missing space before -", - lambda match, line: not line_is_attribute(line)), + lambda match, line: not is_attribute), (r"[A-Za-z0-9]([\+/\*%=])", "missing space before {0}", - lambda match, line: (not line_is_attribute(line) and + lambda match, line: (not is_attribute and not is_associated_type(match, line))), # * not included because of dereferencing and casting # - not included because of unary negation (r'([\+/\%=])[A-Za-z0-9"]', "missing space after {0}", - lambda match, line: (not line_is_attribute(line) and + lambda match, line: (not is_attribute and not is_associated_type(match, line))), (r"\)->", "missing space before ->", no_filter), (r"->[A-Za-z]", "missing space after ->", no_filter), @@ -402,10 +419,8 @@ def check_rust(file_name, lines): for pattern, message, filter_func in regex_rules: for match in re.finditer(pattern, line): - if not filter_func(match, line): - continue - - yield (idx + 1, message.format(*match.groups(), **match.groupdict())) + if filter_func(match, line): + yield (idx + 1, message.format(*match.groups(), **match.groupdict())) if prev_open_brace and not line: yield (idx + 1, "found an empty line following a {") @@ -481,14 +496,6 @@ def is_associated_type(match, line): return generic_open and generic_close -def line_is_attribute(line): - return re.search(r"#\[.*\]", line) - - -def line_is_comment(line): - return re.search(r"^//|^/\*|^\*", line) - - def check_webidl_spec(file_name, contents): # Sorted by this function (in pseudo-Rust). The idea is to group the same # organization together. @@ -508,35 +515,14 @@ def check_webidl_spec(file_name, contents): # } # a_domain.path().cmp(b_domain.path()) # } + if not file_name.endswith(".webidl"): raise StopIteration - standards = [ - "//www.khronos.org/registry/webgl/specs", - "//developer.mozilla.org/en-US/docs/Web/API", - "//dev.w3.org/2006/webapi", - "//dev.w3.org/csswg", - "//dev.w3.org/fxtf", - "//dvcs.w3.org/hg", - "//dom.spec.whatwg.org", - "//domparsing.spec.whatwg.org", - "//drafts.csswg.org/cssom", - "//drafts.fxtf.org", - "//encoding.spec.whatwg.org", - "//html.spec.whatwg.org", - "//url.spec.whatwg.org", - "//xhr.spec.whatwg.org", - "//w3c.github.io", - "//heycam.github.io/webidl", - "//webbluetoothcg.github.io/web-bluetooth/", - "//slightlyoff.github.io/ServiceWorker/spec/service_worker/", - # Not a URL - "// This interface is entirely internal to Servo, and should not be" + - " accessible to\n// web pages." - ] - for i in standards: + + for i in WEBIDL_STANDARDS: if contents.find(i) != -1: raise StopIteration - yield 0, "No specification link found." + yield (0, "No specification link found.") def check_json(filename, contents): @@ -552,9 +538,9 @@ def check_json(filename, contents): def check_spec(file_name, lines): - if spec_base_path not in file_name: + if SPEC_BASE_PATH not in file_name: raise StopIteration - file_name = os.path.relpath(os.path.splitext(file_name)[0], spec_base_path) + file_name = os.path.relpath(os.path.splitext(file_name)[0], SPEC_BASE_PATH) patt = re.compile("^\s*\/\/.+") # Pattern representing a line with a macro @@ -566,9 +552,10 @@ def check_spec(file_name, lines): # Pattern representing a line with comment comment_patt = re.compile("^\s*///?.+$") - pattern = "impl {}Methods for {} {{".format(file_name, file_name) brace_count = 0 in_impl = False + pattern = "impl {}Methods for {} {{".format(file_name, file_name) + for idx, line in enumerate(lines): if "// check-tidy: no specs after this line" in line: break @@ -599,10 +586,10 @@ def collect_errors_for_files(files_to_check, checking_functions, line_checking_f raise StopIteration if print_text: print '\rChecking files for tidiness...' + for filename in files_to_check: if not os.path.exists(filename): continue - with open(filename, "r") as f: contents = f.read() for check in checking_functions: @@ -650,11 +637,12 @@ def get_file_list(directory, only_changed_files=False, exclude_dirs=[]): args = ["git", "ls-files", "--others", "--exclude-standard", directory] file_list += subprocess.check_output(args) for f in file_list.splitlines(): - yield os.path.join('.', f) + if os.path.join('.', os.path.dirname(f)) not in exclude_dirs: + yield os.path.join('.', f) elif exclude_dirs: for root, dirs, files in os.walk(directory, topdown=True): # modify 'dirs' in-place so that we don't do unwanted traversals in excluded directories - dirs[:] = [d for d in dirs if not any(os.path.join(root, d).startswith(name) for name in ignored_dirs)] + dirs[:] = [d for d in dirs if not any(os.path.join(root, d).startswith(name) for name in exclude_dirs)] for rel_path in files: yield os.path.join(root, rel_path) else: diff --git a/python/tidy/servo_tidy_tests/rust_tidy.rs b/python/tidy/servo_tidy_tests/rust_tidy.rs index bf6437f806d..2b9dd343f2d 100644 --- a/python/tidy/servo_tidy_tests/rust_tidy.rs +++ b/python/tidy/servo_tidy_tests/rust_tidy.rs @@ -19,6 +19,7 @@ mod test::{ extern crate webrender_traits; extern crate style_traits; +#[foo = "bar,baz"] impl test { fn test_fun(y:f32)->f32{ diff --git a/python/tidy/servo_tidy_tests/test_ignored/whee/test.rs b/python/tidy/servo_tidy_tests/test_ignored/whee/test.rs new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/python/tidy/servo_tidy_tests/test_ignored/whee/test.rs diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index a50532fbade..dbbc77c9e23 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -79,7 +79,7 @@ class CheckTidiness(unittest.TestCase): self.assertNoMoreErrors(errors) def test_spec_link(self): - tidy.spec_base_path = base_path + tidy.SPEC_BASE_PATH = base_path errors = tidy.collect_errors_for_files(iterFile('speclink.rs'), [], [tidy.check_spec], print_text=False) self.assertEqual('method declared in webidl is missing a comment with a specification link', errors.next()[2]) self.assertNoMoreErrors(errors) @@ -114,6 +114,16 @@ class CheckTidiness(unittest.TestCase): self.assertEqual(msg, errors.next()[2]) self.assertNoMoreErrors(errors) + def test_file_list(self): + base_path='./python/tidy/servo_tidy_tests/test_ignored' + file_list = tidy.get_file_list(base_path, only_changed_files=False, + exclude_dirs=[]) + lst = list(file_list) + self.assertEqual([os.path.join(base_path, 'whee', 'test.rs')], lst) + file_list = tidy.get_file_list(base_path, only_changed_files=False, + exclude_dirs=[os.path.join(base_path,'whee')]) + lst = list(file_list) + self.assertEqual([], lst) def do_tests(): suite = unittest.TestLoader().loadTestsFromTestCase(CheckTidiness) diff --git a/rust-nightly-date b/rust-nightly-date index d4bf67eb681..65457dabdd4 100644 --- a/rust-nightly-date +++ b/rust-nightly-date @@ -1 +1 @@ -2016-06-09 +2016-06-14 diff --git a/tests/unit/net/filemanager_thread.rs b/tests/unit/net/filemanager_thread.rs index fe03bdc401e..43cda6b8244 100644 --- a/tests/unit/net/filemanager_thread.rs +++ b/tests/unit/net/filemanager_thread.rs @@ -3,15 +3,29 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use ipc_channel::ipc::{self, IpcSender}; -use net::filemanager_thread::FileManagerThreadFactory; -use net_traits::filemanager_thread::{FileManagerThreadMsg, FileManagerThreadError}; +use net::filemanager_thread::{FileManagerThreadFactory, UIProvider}; +use net_traits::filemanager_thread::{FilterPattern, FileManagerThreadMsg, FileManagerThreadError}; use std::fs::File; use std::io::Read; use std::path::PathBuf; +const TEST_PROVIDER: &'static TestProvider = &TestProvider; + +struct TestProvider; + +impl UIProvider for TestProvider { + fn open_file_dialog(&self, _: &str, _: Option<(&[&str], &str)>) -> Option<String> { + Some("test.txt".to_string()) + } + + fn open_file_dialog_multi(&self, _: &str, _: Option<(&[&str], &str)>) -> Option<Vec<String>> { + Some(vec!["test.txt".to_string()]) + } +} + #[test] fn test_filemanager() { - let chan: IpcSender<FileManagerThreadMsg> = FileManagerThreadFactory::new(); + let chan: IpcSender<FileManagerThreadMsg> = FileManagerThreadFactory::new(TEST_PROVIDER); // Try to open a dummy file "tests/unit/net/test.txt" in tree let mut handler = File::open("test.txt").expect("test.txt is stolen"); @@ -20,11 +34,13 @@ fn test_filemanager() { handler.read_to_end(&mut test_file_content) .expect("Read tests/unit/net/test.txt error"); + let patterns = vec![FilterPattern(".txt".to_string())]; + { // Try to select a dummy file "tests/unit/net/test.txt" let (tx, rx) = ipc::channel().unwrap(); - chan.send(FileManagerThreadMsg::SelectFile(tx)).unwrap(); + chan.send(FileManagerThreadMsg::SelectFile(patterns.clone(), tx)).unwrap(); let selected = rx.recv().expect("File manager channel is broken") .expect("The file manager failed to find test.txt"); @@ -66,7 +82,7 @@ fn test_filemanager() { { let (tx, rx) = ipc::channel().unwrap(); - let _ = chan.send(FileManagerThreadMsg::SelectFile(tx)); + let _ = chan.send(FileManagerThreadMsg::SelectFile(patterns.clone(), tx)); assert!(rx.try_recv().is_err(), "The thread should not respond normally after exited"); } diff --git a/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-abspos-002.htm.ini b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-abspos-002.htm.ini new file mode 100644 index 00000000000..834651c26b3 --- /dev/null +++ b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-abspos-002.htm.ini @@ -0,0 +1,3 @@ +[transform-abspos-002.htm] + type: reftest + disabled: https://github.com/servo/servo/issues/11561 diff --git a/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-abspos-007.htm.ini b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-abspos-007.htm.ini new file mode 100644 index 00000000000..d3924d64958 --- /dev/null +++ b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-abspos-007.htm.ini @@ -0,0 +1,3 @@ +[transform-abspos-007.htm] + type: reftest + disabled: https://github.com/servo/servo/issues/11561 diff --git a/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini b/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini index 7f8f06ca7c2..2bcc5e92f62 100644 --- a/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini +++ b/tests/wpt/metadata/FileAPI/blob/Blob-XHR-revoke.html.ini @@ -1,5 +1,6 @@ [Blob-XHR-revoke.html] type: testharness + expected: TIMEOUT [Revoking blob URL used with XMLHttpRequest] - expected: FAIL - + expected: TIMEOUT + bug: https://github.com/servo/servo/issues/10539 diff --git a/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini b/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini index 8376e85656c..9f6700111c5 100644 --- a/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini +++ b/tests/wpt/metadata/FileAPI/blob/Blob-constructor.html.ini @@ -2,28 +2,37 @@ type: testharness [Passing non-objects, Dates and RegExps for blobParts should throw a TypeError.] expected: FAIL + bug: https://github.com/servo/rust-mozjs/issues/269 [ArrayBuffer elements of the blobParts array should be supported.] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Passing typed arrays as elements of the blobParts array should work.] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Passing a Float64Array as element of the blobParts array should work.] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Passing an platform object that supports indexed properties as the blobParts array should work (select).] expected: FAIL + bug: https://github.com/servo/servo/issues/11763 - [Passing a platform array object as the blobParts array should work (MessagePort[\]).] + [Passing a FrozenArray as the blobParts array should work (FrozenArray<MessagePort>).] expected: FAIL + bug: https://github.com/servo/servo/issues/7457 [Array with two buffers] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Array with two bufferviews] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Array with mixed types] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 diff --git a/tests/wpt/metadata/FileAPI/blob/Blob-slice.html.ini b/tests/wpt/metadata/FileAPI/blob/Blob-slice.html.ini index 171f532e60d..25aa6248cf4 100644 --- a/tests/wpt/metadata/FileAPI/blob/Blob-slice.html.ini +++ b/tests/wpt/metadata/FileAPI/blob/Blob-slice.html.ini @@ -2,100 +2,61 @@ type: testharness [Slicing test: slice (5,0).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (5,1).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (5,2).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (5,3).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (6,0).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (6,1).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (6,2).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (7,0).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (7,1).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (7,2).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (7,3).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (8,0).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (8,1).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (8,2).] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Slicing test: slice (8,3).] expected: FAIL - - [Invalid contentType ("te(xt/plain")] - expected: FAIL - - [Invalid contentType ("te)xt/plain")] - expected: FAIL - - [Invalid contentType ("te<xt/plain")] - expected: FAIL - - [Invalid contentType ("te>xt/plain")] - expected: FAIL - - [Invalid contentType ("te@xt/plain")] - expected: FAIL - - [Invalid contentType ("te,xt/plain")] - expected: FAIL - - [Invalid contentType ("te;xt/plain")] - expected: FAIL - - [Invalid contentType ("te:xt/plain")] - expected: FAIL - - [Invalid contentType ("te\\\\xt/plain")] - expected: FAIL - - [Invalid contentType ("te\\"xt/plain")] - expected: FAIL - - [Invalid contentType ("te/xt/plain")] - expected: FAIL - - [Invalid contentType ("te[xt/plain")] - expected: FAIL - - [Invalid contentType ("te\]xt/plain")] - expected: FAIL - - [Invalid contentType ("te?xt/plain")] - expected: FAIL - - [Invalid contentType ("te=xt/plain")] - expected: FAIL - - [Invalid contentType ("te{xt/plain")] - expected: FAIL - - [Invalid contentType ("te}xt/plain")] - expected: FAIL - - [Invalid contentType ("te xt/plain")] - expected: FAIL + bug: https://github.com/servo/servo/issues/10911 diff --git a/tests/wpt/metadata/FileAPI/file/File-constructor.html.ini b/tests/wpt/metadata/FileAPI/file/File-constructor.html.ini index 7087a621261..d9c18b41655 100644 --- a/tests/wpt/metadata/FileAPI/file/File-constructor.html.ini +++ b/tests/wpt/metadata/FileAPI/file/File-constructor.html.ini @@ -2,13 +2,17 @@ type: testharness [ArrayBuffer fileBits] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Typed array fileBits] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Various fileBits] expected: FAIL + bug: https://github.com/servo/servo/issues/10911 [Using special character in fileName] expected: FAIL + bug: https://github.com/w3c/FileAPI/issues/41 diff --git a/tests/wpt/metadata/FileAPI/idlharness.html.ini b/tests/wpt/metadata/FileAPI/idlharness.html.ini index 33a274d116f..c3099e70f38 100644 --- a/tests/wpt/metadata/FileAPI/idlharness.html.ini +++ b/tests/wpt/metadata/FileAPI/idlharness.html.ini @@ -1,14 +1,8 @@ [idlharness.html] type: testharness - [URL interface: operation createObjectURL(Blob)] - expected: FAIL - [URL interface: operation createFor(Blob)] expected: FAIL - [URL interface: operation revokeObjectURL(DOMString)] - expected: FAIL - [FileList must be primary interface of file_input.files] expected: FAIL diff --git a/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini b/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini index d9f9c83bdc3..81fe170337c 100644 --- a/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini +++ b/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini @@ -1,14 +1,8 @@ [idlharness.worker] type: testharness - [URL interface: operation createObjectURL(Blob)] - expected: FAIL - [URL interface: operation createFor(Blob)] expected: FAIL - [URL interface: operation revokeObjectURL(DOMString)] - expected: FAIL - [FileReader interface: operation readAsArrayBuffer(Blob)] expected: FAIL diff --git a/tests/wpt/metadata/FileAPI/url/url_createobjecturl_blob.html.ini b/tests/wpt/metadata/FileAPI/url/url_createobjecturl_blob.html.ini index 41a3e116aa7..92400cd1d65 100644 --- a/tests/wpt/metadata/FileAPI/url/url_createobjecturl_blob.html.ini +++ b/tests/wpt/metadata/FileAPI/url/url_createobjecturl_blob.html.ini @@ -1,8 +1,5 @@ [url_createobjecturl_blob.html] type: testharness - [Check if the Blob URI starts with 'blob' using createObjectURL()] - expected: FAIL - [Check if the Blob URI starts with 'blob' using createFor()] expected: FAIL diff --git a/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest.html.ini b/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest.html.ini deleted file mode 100644 index 8a6122281e3..00000000000 --- a/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[url_xmlhttprequest.html] - type: testharness - [FileAPI Test: Creating Blob URL via XMLHttpRequest] - expected: FAIL - diff --git a/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest_img.html.ini b/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest_img.html.ini index a8ff6da101c..08c0d4d0d67 100644 --- a/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest_img.html.ini +++ b/tests/wpt/metadata/FileAPI/url/url_xmlhttprequest_img.html.ini @@ -2,4 +2,4 @@ type: reftest reftype: == refurl: /FileAPI/url/url_xmlhttprequest_img-ref.html - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index cf86aac2955..b97ed7da68b 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -36064,6 +36064,12 @@ "url": "/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html" } ], + "html/semantics/forms/the-form-element/form-indexed-element.html": [ + { + "path": "html/semantics/forms/the-form-element/form-indexed-element.html", + "url": "/html/semantics/forms/the-form-element/form-indexed-element.html" + } + ], "url/url-domainToUnicode.html": [ { "path": "url/url-domainToUnicode.html", diff --git a/tests/wpt/metadata/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html.ini b/tests/wpt/metadata/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html.ini index 7b7d271bb4a..68013761645 100644 --- a/tests/wpt/metadata/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html.ini +++ b/tests/wpt/metadata/html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html.ini @@ -2,13 +2,17 @@ type: testharness [On getting, the length attribute must return the number of nodes represented by the collection.] expected: FAIL + bug: https://github.com/servo/servo/issues/11763 [Changing the length adds new nodes; The number of new nodes = new length minus old length] expected: FAIL + bug: https://github.com/servo/servo/issues/11763 [New nodes have no value] expected: FAIL + bug: https://github.com/servo/servo/issues/11763 [Setting a length equal to existing length changes nothing] expected: FAIL + bug: https://github.com/servo/servo/issues/11763 diff --git a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/031.html.ini b/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/031.html.ini deleted file mode 100644 index 3a3b16289bd..00000000000 --- a/tests/wpt/metadata/old-tests/submission/Opera/script_scheduling/031.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[031.html] - type: testharness - [ scheduler: focus and blur events] - expected: FAIL - diff --git a/tests/wpt/metadata/workers/constructors/Worker/Blob-url.html.ini b/tests/wpt/metadata/workers/constructors/Worker/Blob-url.html.ini index 9c856b7f6ac..498c1c7498c 100644 --- a/tests/wpt/metadata/workers/constructors/Worker/Blob-url.html.ini +++ b/tests/wpt/metadata/workers/constructors/Worker/Blob-url.html.ini @@ -1,5 +1,6 @@ [Blob-url.html] type: testharness + expected: TIMEOUT [Worker supports Blob url] - expected: FAIL + expected: TIMEOUT diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 24af8aa6f41..60c7ad1009a 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -2040,6 +2040,18 @@ "url": "/_mozilla/css/image_percentage_dimen.html" } ], + "css/image_percentage_height.html": [ + { + "path": "css/image_percentage_height.html", + "references": [ + [ + "/_mozilla/css/image_percentage_height_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/image_percentage_height.html" + } + ], "css/image_rendering_auto_a.html": [ { "path": "css/image_rendering_auto_a.html", @@ -6538,6 +6550,12 @@ "url": "/_mozilla/mozilla/mozbrowser/iframe_reload_twice.html" } ], + "mozilla/mozbrowser/iframe_visibility.html": [ + { + "path": "mozilla/mozbrowser/iframe_visibility.html", + "url": "/_mozilla/mozilla/mozbrowser/iframe_visibility.html" + } + ], "mozilla/mozbrowser/mozbrowser_click_fires_openwindow.html": [ { "path": "mozilla/mozbrowser/mozbrowser_click_fires_openwindow.html", @@ -9080,6 +9098,18 @@ "url": "/_mozilla/css/image_percentage_dimen.html" } ], + "css/image_percentage_height.html": [ + { + "path": "css/image_percentage_height.html", + "references": [ + [ + "/_mozilla/css/image_percentage_height_ref.html", + "==" + ] + ], + "url": "/_mozilla/css/image_percentage_height.html" + } + ], "css/image_rendering_auto_a.html": [ { "path": "css/image_rendering_auto_a.html", diff --git a/tests/wpt/mozilla/tests/css/car.jpg b/tests/wpt/mozilla/tests/css/car.jpg Binary files differnew file mode 100644 index 00000000000..ef09b796c63 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/car.jpg diff --git a/tests/wpt/mozilla/tests/css/image_percentage_height.html b/tests/wpt/mozilla/tests/css/image_percentage_height.html new file mode 100644 index 00000000000..cf37e873b44 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/image_percentage_height.html @@ -0,0 +1,23 @@ +<!doctype html> +<html> +<head> +<meta charset="utf-8"> +<title></title> +<!-- Tests that image resizes properly with height specified as a percentage. --> +<link rel="match" href="image_percentage_height_ref.html"> +<style> +div { + height: 100px; +} + +img { + height: 100%; +} +</style> +</head> +<body> +<div> +<img src="car.jpg" alt="Car"> +</div> +</body> +</html> diff --git a/tests/wpt/mozilla/tests/css/image_percentage_height_ref.html b/tests/wpt/mozilla/tests/css/image_percentage_height_ref.html new file mode 100644 index 00000000000..f3d201f6951 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/image_percentage_height_ref.html @@ -0,0 +1,14 @@ +<!doctype html> +<html> +<head> +<!-- Tests that image resizes properly with height specified as a percentage. --> +<style> +img { + height: 100px; +} +</style> +</head> +<body> +<img src="car.jpg" alt="Car"> +</body> +</html> diff --git a/tests/wpt/mozilla/tests/mozilla/mozbrowser/helper.html b/tests/wpt/mozilla/tests/mozilla/mozbrowser/helper.html new file mode 100644 index 00000000000..dee1ea597e5 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/mozbrowser/helper.html @@ -0,0 +1,6 @@ +<!doctype html> +<html> +<body> + <p>test</p> +</body> +</html> diff --git a/tests/wpt/mozilla/tests/mozilla/mozbrowser/iframe_visibility.html b/tests/wpt/mozilla/tests/mozilla/mozbrowser/iframe_visibility.html new file mode 100644 index 00000000000..4681f5db25a --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/mozbrowser/iframe_visibility.html @@ -0,0 +1,92 @@ +<!doctype html> +<meta charset="utf-8"> +<head> +<title>Iframe visibility tests</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> + <script> + async_test(function(t) { + var expectedVisibilities = [false, true]; + var receivedVisibilities = []; + + var iframe = document.createElement("iframe"); + iframe.mozbrowser = true; + iframe.src = "helper.html"; + + //Alternate the iframe's visibility and fire mozbrowservisibilitychange + iframe.onload = t.step_func(function() { + iframe.setVisible(false); + iframe.setVisible(true); + }); + + iframe.addEventListener("mozbrowservisibilitychange", t.step_func(e => { + assert_equals(iframe.getVisible(), e.detail.visible); + receivedVisibilities.push(e.detail.visible); + if (receivedVisibilities.length == expectedVisibilities.length) { + assert_array_equals(receivedVisibilities, expectedVisibilities); + t.done(); + } + })); + + document.body.appendChild(iframe); + }, "Iframe visibility setter/getter"); + + async_test(function(t) { + var iframe = document.createElement("iframe"); + iframe.mozbrowser = true; + iframe.src = "helper.html"; + var start = null; + document.body.appendChild(iframe); + iframe.onload = t.step_func(function() { + var element = iframe.contentWindow.document.querySelector("p"); + var animationCompletesAfterResumingVisibility = false; + var nonVisibleAnimationStopped = false; + element.style.position = 'relative'; + element.style.right = "0px"; + var step = t.step_func(function(timestamp) { + if (!start) start = timestamp; + var progress = timestamp - start; + element.style.right = Math.min(progress/5, 100) + "px"; + if (progress < 500) { + iframe.contentWindow.requestAnimationFrame(step); + } + }); + + iframe.setVisible(false); + + iframe.contentWindow.setTimeout(t.step_func(function(){ + nonVisibleAnimationStopped = element.style.right === '0px'; + iframe.setVisible(true); + }),1000); + + iframe.contentWindow.setTimeout(t.step_func(function(){ + animationCompletesAfterResumingVisibility = element.style.right === '100px'; + assert_true(nonVisibleAnimationStopped); + assert_true(animationCompletesAfterResumingVisibility); + t.done(); + }),2000); + + iframe.contentWindow.requestAnimationFrame(step); + }); + }, 'Requesting animation frame composites only when frame is visible'); + + async_test(function(t) { + var iframe = document.createElement("iframe"); + iframe.src = "http://web-platform.test:8000/common/blank.html"; + iframe.mozbrowser = true; + iframe.onload = t.step_func(function() { + iframe.addEventListener("mozbrowservisibilitychange", t.step_func(function() { + var startTime = Date.now(); + iframe.contentWindow.setTimeout(t.step_func(function() { + assert_true(Date.now() - startTime >= 1000); + t.done(); + }), 1); + })); + iframe.setVisible(false); + }); + document.body.appendChild(iframe); + }, 'Minimum setTimeout of 1s when pipeline is invisible'); + </script> +</body> diff --git a/tests/wpt/web-platform-tests/FileAPI/blob/Blob-constructor.html b/tests/wpt/web-platform-tests/FileAPI/blob/Blob-constructor.html index 9c2b0a138c9..d8375c2a6e8 100644 --- a/tests/wpt/web-platform-tests/FileAPI/blob/Blob-constructor.html +++ b/tests/wpt/web-platform-tests/FileAPI/blob/Blob-constructor.html @@ -330,7 +330,17 @@ test_blob(function() { desc: "Passing an platform object that supports indexed properties as the blobParts array should work (select)." }); -var t_ports = async_test("Passing a platform array object as the blobParts array should work (MessagePort[])."); +test_blob(function() { + var elm = document.createElement("div"); + elm.setAttribute("foo", "bar"); + return new Blob(elm.attributes); +}, { + expected: "[object Attr]", + type: "", + desc: "Passing an platform object that supports indexed properties as the blobParts array should work (attributes)." +}); + +var t_ports = async_test("Passing a FrozenArray as the blobParts array should work (FrozenArray<MessagePort>)."); t_ports.step(function() { var channel = new MessageChannel(); channel.port2.onmessage = this.step_func(function(e) { @@ -343,16 +353,6 @@ t_ports.step(function() { }); test_blob(function() { - var elm = document.createElement("div"); - elm.setAttribute("foo", "bar"); - return new Blob(elm.attributes); -}, { - expected: "[object Attr]", - type: "", - desc: "Passing a platform array object as the blobParts array should work (Attr[])." -}); - -test_blob(function() { var blob = new Blob(['foo']); return new Blob([blob, blob]); }, { diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html new file mode 100644 index 00000000000..44471aa8ca3 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-form-element/form-indexed-element.html @@ -0,0 +1,22 @@ +<!doctype html> +<meta charset="utf-8"> +<title>form.elements: indexed</title> +<link rel="author" title="Ivan.Yang" href="mailto:jsyangwenjie@gmail.com"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<div id="test"> +<form id=form> +<input type="radio" name="radio1" id="r1" value=1> +<input type="radio" name="radio2" id="r2" value=2> +</form> +</div> +<script> +test(function() { + var form = document.getElementById("form"); + assert_equals(form[0], document.getElementById("r1")); + assert_equals(form[1], document.getElementById("r2")); + assert_equals(form[2], undefined); + assert_equals(form[-1], undefined); + }, "form.elements should be accessed correctly by index") +</script> |