Pass SharedLayoutContext to ImageFragmentInfo::new.

This commit is contained in:
Ms2ger 2016-08-23 17:32:06 +02:00
parent 7524e5549f
commit 938569e3c7
2 changed files with 8 additions and 7 deletions

View file

@ -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<N: ThreadSafeLayoutNode>(node: &N, url: Option<Url>,
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,
}