diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/compositing/compositor.rs | 5 | ||||
-rw-r--r-- | components/gfx/display_list/mod.rs | 10 | ||||
-rw-r--r-- | components/layout/webrender_helpers.rs | 5 |
3 files changed, 16 insertions, 4 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index cbe8e31667e..55c183da777 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -39,7 +39,7 @@ use style_traits::viewport::ViewportConstraints; use time::{precise_time_ns, precise_time_s}; use touch::{TouchHandler, TouchAction}; use webrender; -use webrender_traits::{self, ClipId, LayoutPoint, ScrollEventPhase, ScrollLocation}; +use webrender_traits::{self, ClipId, LayoutPoint, ScrollEventPhase, ScrollLocation, ScrollClamping}; use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg}; #[derive(Debug, PartialEq)] @@ -777,7 +777,8 @@ impl<Window: WindowMethods> IOCompositor<Window> { } fn scroll_fragment_to_point(&mut self, id: ClipId, point: Point2D<f32>) { - self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id); + self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id, + ScrollClamping::ToContentBounds); } fn handle_window_message(&mut self, event: WindowEvent) { diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index af5590bdad0..ac1db774f10 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -48,6 +48,16 @@ pub struct DisplayList { } impl DisplayList { + /// Return the bounds of this display list based on the dimensions of the root + /// stacking context. + pub fn bounds(&self) -> Rect<Au> { + match self.list.get(0) { + Some(&DisplayItem::PushStackingContext(ref item)) => item.stacking_context.bounds, + Some(_) => unreachable!("Root element of display list not stacking context."), + None => Rect::zero(), + } + } + // Returns the text index within a node for the point of interest. pub fn text_index(&self, node: OpaqueNode, diff --git a/components/layout/webrender_helpers.rs b/components/layout/webrender_helpers.rs index cd450bd273e..ca7cdb27a3f 100644 --- a/components/layout/webrender_helpers.rs +++ b/components/layout/webrender_helpers.rs @@ -215,7 +215,8 @@ impl WebRenderDisplayListConverter for DisplayList { fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder { let traversal = DisplayListTraversal::new(self); let webrender_pipeline_id = pipeline_id.to_webrender(); - let mut builder = DisplayListBuilder::new(webrender_pipeline_id); + let mut builder = DisplayListBuilder::new(webrender_pipeline_id, + self.bounds().size.to_sizef()); let mut current_scroll_root_id = ClipId::root_scroll_node(webrender_pipeline_id); builder.push_clip_id(current_scroll_root_id); @@ -280,7 +281,7 @@ impl WebRenderDisplayItemConverter for DisplayItem { item.text_run.font_key, item.text_color, item.text_run.actual_pt_size, - item.blur_radius, + item.blur_radius.to_f32_px(), None); } } |