diff options
Diffstat (limited to 'components/layout_thread_2020/lib.rs')
-rw-r--r-- | components/layout_thread_2020/lib.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs index 65919dc76a3..cddb4ac04ed 100644 --- a/components/layout_thread_2020/lib.rs +++ b/components/layout_thread_2020/lib.rs @@ -84,13 +84,15 @@ use style::properties::PropertyId; use style::selector_parser::SnapshotMap; use style::shared_lock::{SharedRwLock, SharedRwLockReadGuard, StylesheetGuards}; use style::stylesheets::{ - DocumentStyleSheet, Origin, Stylesheet, StylesheetInDocument, UserAgentStylesheets, + DocumentStyleSheet, Origin, Stylesheet, StylesheetInDocument, UrlExtraData, + UserAgentStylesheets, }; use style::stylist::Stylist; use style::thread_state::{self, ThreadState}; use style::traversal::DomTraversal; use style::traversal_flags::TraversalFlags; use style_traits::{CSSPixel, DevicePixel, SpeculativePainter}; +use url::Url; use webrender_api::{units, HitTestFlags}; /// Information needed by the layout thread. @@ -1387,9 +1389,12 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> { filename: &str, content: &[u8], ) -> Result<DocumentStyleSheet, &'static str> { + let url = Url::parse(&format!("chrome://resources/{:?}", filename)) + .ok() + .unwrap(); Ok(DocumentStyleSheet(ServoArc::new(Stylesheet::from_bytes( content, - ServoUrl::parse(&format!("chrome://resources/{:?}", filename)).unwrap(), + url.into(), None, None, Origin::UserAgent, @@ -1427,7 +1432,7 @@ fn get_ua_stylesheets() -> Result<UserAgentStylesheets, &'static str> { user_or_user_agent_stylesheets.push(DocumentStyleSheet(ServoArc::new( Stylesheet::from_bytes( &contents, - url.clone(), + UrlExtraData(url.get_arc()), None, None, Origin::User, |