/* 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 https://mozilla.org/MPL/2.0/. */ use std::sync::Arc; use base::id::PipelineId; use fnv::FnvHashMap; use fonts::FontContext; use net_traits::image_cache::{ ImageCache, ImageCacheResult, ImageOrMetadataAvailable, UsePlaceholder, }; use parking_lot::{Mutex, RwLock}; use script_layout_interface::{IFrameSizes, PendingImage, PendingImageState}; use servo_url::{ImmutableOrigin, ServoUrl}; use style::context::SharedStyleContext; use style::dom::OpaqueNode; use crate::display_list::WebRenderImageInfo; pub struct LayoutContext<'a> { pub id: PipelineId, pub use_rayon: bool, pub origin: ImmutableOrigin, /// Bits shared by the layout and style system. pub style_context: SharedStyleContext<'a>, /// A FontContext to be used during layout. pub font_context: Arc, /// Reference to the script thread image cache. pub image_cache: Arc, /// A list of in-progress image loads to be shared with the script thread. pub pending_images: Mutex>, /// A collection of `