diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-03-01 11:43:45 +0100 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-04-26 11:31:18 +0200 |
commit | 8b353ee3ced609d2de688a93dcfd825c3cef3eae (patch) | |
tree | 7e453077082bee0f1f77b5ff2d3202ae6324e64d /components/script/dom/shadowroot.rs | |
parent | 3e53962b2502cdb19790519c7ec82c499d248cc1 (diff) | |
download | servo-8b353ee3ced609d2de688a93dcfd825c3cef3eae.tar.gz servo-8b353ee3ced609d2de688a93dcfd825c3cef3eae.zip |
Make StylesheetSet an enum instead of a trait object
Diffstat (limited to 'components/script/dom/shadowroot.rs')
-rw-r--r-- | components/script/dom/shadowroot.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/shadowroot.rs b/components/script/dom/shadowroot.rs index d99a5f3b3d7..5233e7b4143 100644 --- a/components/script/dom/shadowroot.rs +++ b/components/script/dom/shadowroot.rs @@ -24,6 +24,7 @@ use style::author_styles::AuthorStyles; use style::dom::TElement; use style::media_queries::Device; use style::shared_lock::SharedRwLockReadGuard; +use style::stylesheet_set::StylesheetSet; use style::stylesheets::Stylesheet; // https://dom.spec.whatwg.org/#interface-shadowroot @@ -219,9 +220,9 @@ impl StyleSheetListOwner for Dom<ShadowRoot> { .is_before(sheet_in_shadow.owner.upcast()) }) .cloned(); - self.document_or_shadow_root.add_stylesheet( + DocumentOrShadowRoot::add_stylesheet( owner, - stylesheets, + StylesheetSet::Author(stylesheets), sheet, insertion_point, self.document.style_shared_lock(), @@ -231,10 +232,10 @@ impl StyleSheetListOwner for Dom<ShadowRoot> { /// Remove a stylesheet owned by `owner` from the list of shadow root sheets. #[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily. fn remove_stylesheet(&self, owner: &Element, s: &Arc<Stylesheet>) { - self.document_or_shadow_root.remove_stylesheet( + DocumentOrShadowRoot::remove_stylesheet( owner, s, - &mut self.author_styles.borrow_mut().stylesheets, + StylesheetSet::Author(&mut self.author_styles.borrow_mut().stylesheets), ) } |