/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use cssparser::SourceLocation; use nsstring::nsCString; use servo_arc::Arc; use style::context::QuirksMode; use style::gecko::data::GeckoStyleSheet; use style::gecko_bindings::bindings; use style::gecko_bindings::bindings::Gecko_LoadStyleSheet; use style::gecko_bindings::structs::{Loader, LoaderReusableStyleSheets}; use style::gecko_bindings::structs::{
SheetLoadData, SheetLoadDataHolder, StyleSheet as DomStyleSheet,
}; use style::gecko_bindings::sugar::refptr::RefPtr; use style::global_style_data::GLOBAL_STYLE_DATA; use style::media_queries::MediaList; use style::shared_lock::{Locked, SharedRwLock}; use style::stylesheets::import_rule::{ImportLayer, ImportSheet, ImportSupportsCondition}; use style::stylesheets::AllowImportRules; use style::stylesheets::{ImportRule, Origin, StylesheetLoader as StyleStylesheetLoader}; use style::stylesheets::{StylesheetContents, UrlExtraData}; use style::values::CssUrl;
impl StyleStylesheetLoader for StylesheetLoader { fn request_stylesheet(
&self,
url: CssUrl,
source_location: SourceLocation,
lock: &SharedRwLock,
media: Arc<Locked<MediaList>>,
supports: Option<ImportSupportsCondition>,
layer: ImportLayer,
) -> Arc<Locked<ImportRule>> { // Ensure the supports conditions for this @import are true, if not, refuse to load if !supports.as_ref().map_or(true, |s| s.enabled) { return Arc::new(lock.wrap(ImportRule {
url,
stylesheet: ImportSheet::new_refused(),
supports,
layer,
source_location,
}));
}
// After we get this raw pointer ImportRule will be moved into a lock and Arc // and so the Arc<Url> pointer inside will also move, // but the Url it points to or the allocating backing the String inside that Url won’t, // so this raw pointer will still be valid.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.