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 http://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 cssparser::SourceLocation;
9 use media_queries::MediaList;
10 use parser::ParserContext;
11 use servo_arc::Arc;
12 use shared_lock::{Locked, SharedRwLock};
13 use stylesheets::import_rule::ImportRule;
14 use values::CssUrl;
15 
16 /// The stylesheet loader is the abstraction used to trigger network requests
17 /// for `@import` rules.
18 pub trait StylesheetLoader {
19     /// Request a stylesheet after parsing a given `@import` rule, and return
20     /// the constructed `@import` rule.
request_stylesheet( &self, url: CssUrl, location: SourceLocation, context: &ParserContext, lock: &SharedRwLock, media: Arc<Locked<MediaList>>, ) -> Arc<Locked<ImportRule>>21     fn request_stylesheet(
22         &self,
23         url: CssUrl,
24         location: SourceLocation,
25         context: &ParserContext,
26         lock: &SharedRwLock,
27         media: Arc<Locked<MediaList>>,
28     ) -> Arc<Locked<ImportRule>>;
29 }
30