diff --git a/components/layout/construct.rs b/components/layout/construct.rs index cf8d69cbbf3..9d4b28b42f4 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -308,13 +308,13 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> Some(LayoutNodeType::Element(LayoutElementType::HTMLImageElement)) => { let image_info = box ImageFragmentInfo::new(node, node.image_url(), - &self.layout_context); + &self.layout_context.shared); SpecificFragmentInfo::Image(image_info) } Some(LayoutNodeType::Element(LayoutElementType::HTMLObjectElement)) => { let image_info = box ImageFragmentInfo::new(node, node.object_data(), - &self.layout_context); + &self.layout_context.shared); SpecificFragmentInfo::Image(image_info) } Some(LayoutNodeType::Element(LayoutElementType::HTMLTableElement)) => { @@ -1267,7 +1267,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> Some(ref url) => { let image_info = box ImageFragmentInfo::new(node, Some((*url).clone()), - &self.layout_context); + &self.layout_context.shared); vec![Fragment::new(node, SpecificFragmentInfo::Image(image_info), self.layout_context)] } None => { diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index 0626ed76867..40364a67905 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -8,7 +8,7 @@ use app_units::Au; use canvas_traits::CanvasMsg; -use context::LayoutContext; +use context::{LayoutContext, SharedLayoutContext}; use euclid::{Point2D, Rect, Size2D}; use floats::ClearType; use flow::{self, ImmutableFlowUtils}; @@ -372,9 +372,10 @@ impl ImageFragmentInfo { /// FIXME(pcwalton): The fact that image fragments store the cache in the fragment makes little /// sense to me. pub fn new(node: &N, url: Option, - layout_context: &LayoutContext) -> ImageFragmentInfo { + shared_layout_context: &SharedLayoutContext) + -> ImageFragmentInfo { let image_or_metadata = url.and_then(|url| { - layout_context.shared.get_or_request_image_or_meta(url, UsePlaceholder::Yes) + shared_layout_context.get_or_request_image_or_meta(url, UsePlaceholder::Yes) }); let (image, metadata) = match image_or_metadata { @@ -390,7 +391,7 @@ impl ImageFragmentInfo { }; ImageFragmentInfo { - replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node, layout_context.style_context()), + replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node, &shared_layout_context.style_context), image: image, metadata: metadata, }