diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs
index f91e4339f1d..168c29cdb0b 100644
--- a/components/script/dom/htmlmetaelement.rs
+++ b/components/script/dom/htmlmetaelement.rs
@@ -21,7 +21,6 @@ use crate::dom::node::{
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix};
-use parking_lot::RwLock;
use servo_arc::Arc;
use servo_config::pref;
use std::sync::atomic::AtomicBool;
@@ -112,15 +111,12 @@ impl HTMLMetaElement {
let shared_lock = document.style_shared_lock();
let rule = CssRule::Viewport(Arc::new(shared_lock.wrap(translated_rule)));
let sheet = Arc::new(Stylesheet {
- contents: StylesheetContents {
- rules: CssRules::new(vec![rule], shared_lock),
- origin: Origin::Author,
- namespaces: Default::default(),
- quirks_mode: document.quirks_mode(),
- url_data: RwLock::new(window_from_node(self).get_url()),
- source_map_url: RwLock::new(None),
- source_url: RwLock::new(None),
- },
+ contents: StylesheetContents::from_shared_data(
+ CssRules::new(vec![rule], shared_lock),
+ Origin::Author,
+ window_from_node(self).get_url(),
+ document.quirks_mode(),
+ ),
media: Arc::new(shared_lock.wrap(MediaList::empty())),
shared_lock: shared_lock.clone(),
disabled: AtomicBool::new(false),
diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs
index 20fa6872e49..48e3016458e 100644
--- a/components/script/stylesheet_loader.rs
+++ b/components/script/stylesheet_loader.rs
@@ -29,7 +29,6 @@ use net_traits::{
FetchMetadata, FetchResponseListener, FilteredMetadata, Metadata, NetworkError, ReferrerPolicy,
};
use net_traits::{ResourceFetchTiming, ResourceTimingType};
-use parking_lot::RwLock;
use servo_arc::Arc;
use servo_url::ImmutableOrigin;
use servo_url::ServoUrl;
@@ -41,9 +40,7 @@ use style::parser::ParserContext;
use style::shared_lock::{Locked, SharedRwLock};
use style::stylesheets::import_rule::ImportSheet;
use style::stylesheets::StylesheetLoader as StyleStylesheetLoader;
-use style::stylesheets::{
- CssRules, ImportRule, Namespaces, Origin, Stylesheet, StylesheetContents,
-};
+use style::stylesheets::{CssRules, ImportRule, Origin, Stylesheet, StylesheetContents};
use style::values::CssUrl;
pub trait StylesheetOwner {
@@ -363,15 +360,12 @@ impl<'a> StyleStylesheetLoader for StylesheetLoader<'a> {
media: Arc>,
) -> Arc> {
let sheet = Arc::new(Stylesheet {
- contents: StylesheetContents {
- rules: CssRules::new(Vec::new(), lock),
- origin: context.stylesheet_origin,
- url_data: RwLock::new(context.url_data.clone()),
- quirks_mode: context.quirks_mode,
- namespaces: RwLock::new(Namespaces::default()),
- source_map_url: RwLock::new(None),
- source_url: RwLock::new(None),
- },
+ contents: StylesheetContents::from_shared_data(
+ CssRules::new(Vec::new(), lock),
+ context.stylesheet_origin,
+ context.url_data.clone(),
+ context.quirks_mode,
+ ),
media: media,
shared_lock: lock.clone(),
disabled: AtomicBool::new(false),