loader.rs (1094B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 //! The stylesheet loader is the abstraction used to trigger network requests 6 //! for `@import` rules. 7 8 use crate::media_queries::MediaList; 9 use crate::shared_lock::{Locked, SharedRwLock}; 10 use crate::stylesheets::import_rule::{ImportLayer, ImportRule, ImportSupportsCondition}; 11 use crate::values::CssUrl; 12 use cssparser::SourceLocation; 13 use servo_arc::Arc; 14 15 /// The stylesheet loader is the abstraction used to trigger network requests 16 /// for `@import` rules. 17 pub trait StylesheetLoader { 18 /// Request a stylesheet after parsing a given `@import` rule, and return 19 /// the constructed `@import` rule. 20 fn request_stylesheet( 21 &self, 22 url: CssUrl, 23 location: SourceLocation, 24 lock: &SharedRwLock, 25 media: Arc<Locked<MediaList>>, 26 supports: Option<ImportSupportsCondition>, 27 layer: ImportLayer, 28 ) -> Arc<Locked<ImportRule>>; 29 }