mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
This patch is generated by running `cargo +nightly fmt` under `servo/components/style/` and `servo/ports/geckolib` against mozilla-central https://hg.mozilla.org/mozilla-central/rev/b193f2e7a6a5d1f042c957ea4acd5c89bf210512 My nightly version is: 1.58.0-nightly (c9c4b5d72 2021-11-17) Manually remove the redundant braces in author_styles.rs to fix a warning. Differential Revision: https://phabricator.services.mozilla.com/D131556
30 lines
1.1 KiB
Rust
30 lines
1.1 KiB
Rust
/* 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/. */
|
|
|
|
//! The stylesheet loader is the abstraction used to trigger network requests
|
|
//! for `@import` rules.
|
|
|
|
use crate::media_queries::MediaList;
|
|
use crate::parser::ParserContext;
|
|
use crate::shared_lock::{Locked, SharedRwLock};
|
|
use crate::stylesheets::import_rule::{ImportLayer, ImportRule};
|
|
use crate::values::CssUrl;
|
|
use cssparser::SourceLocation;
|
|
use servo_arc::Arc;
|
|
|
|
/// The stylesheet loader is the abstraction used to trigger network requests
|
|
/// for `@import` rules.
|
|
pub trait StylesheetLoader {
|
|
/// Request a stylesheet after parsing a given `@import` rule, and return
|
|
/// the constructed `@import` rule.
|
|
fn request_stylesheet(
|
|
&self,
|
|
url: CssUrl,
|
|
location: SourceLocation,
|
|
context: &ParserContext,
|
|
lock: &SharedRwLock,
|
|
media: Arc<Locked<MediaList>>,
|
|
layer: Option<ImportLayer>,
|
|
) -> Arc<Locked<ImportRule>>;
|
|
}
|