diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-09-13 15:48:34 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-09-13 16:01:35 +0200 |
commit | 02d1264047c9aee63ae93c5624c591c42394690c (patch) | |
tree | ebb632a3e785c24ee913805a4ef292e6fe061a43 /components/script/dom | |
parent | a373ed3f9def41f9b5cc4f2fd97bcf4eeb893b00 (diff) | |
download | servo-02d1264047c9aee63ae93c5624c591c42394690c.tar.gz servo-02d1264047c9aee63ae93c5624c591c42394690c.zip |
style: Store stylesheets per origin.
This will allow us to cache UA sheets across documents.
MozReview-Commit-ID: 5rYIKTmC6iw
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/document.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 886e392dee7..c20ab990561 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -141,7 +141,7 @@ use style::selector_parser::{RestyleDamage, Snapshot}; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, SharedRwLockReadGuard}; use style::str::{HTML_SPACE_CHARACTERS, split_html_space_chars, str_join}; use style::stylesheet_set::StylesheetSet; -use style::stylesheets::{Stylesheet, StylesheetContents, OriginSet}; +use style::stylesheets::{Stylesheet, StylesheetContents, Origin, OriginSet}; use task_source::TaskSource; use time; use timers::OneshotTimerCallback; @@ -2435,7 +2435,7 @@ impl Document { pub fn stylesheet_at(&self, index: usize) -> Option<Root<CSSStyleSheet>> { let stylesheets = self.stylesheets.borrow(); - stylesheets.get(index).and_then(|s| { + stylesheets.get(Origin::Author, index).and_then(|s| { s.owner.upcast::<Node>().get_cssom_stylesheet() }) } |