style: Unify how servo and Gecko handle UA sheets.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-14 13:10:29 +02:00
parent 2cbd27c83a
commit 0a9309aa96
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
11 changed files with 122 additions and 161 deletions

View file

@ -655,7 +655,7 @@ where
S: JSTraceable + ::style::stylesheets::StylesheetInDocument + PartialEq + 'static,
{
unsafe fn trace(&self, tracer: *mut JSTracer) {
for s in self.iter() {
for (s, _origin) in self.iter() {
s.trace(tracer)
}
}

View file

@ -2397,9 +2397,13 @@ impl Document {
owner.is::<HTMLMetaElement>(), "Wat");
let mut stylesheets = self.stylesheets.borrow_mut();
let insertion_point = stylesheets.iter().find(|sheet_in_doc| {
owner.upcast::<Node>().is_before(sheet_in_doc.owner.upcast())
}).cloned();
let insertion_point =
stylesheets
.iter()
.map(|(sheet, _origin)| sheet)
.find(|sheet_in_doc| {
owner.upcast::<Node>().is_before(sheet_in_doc.owner.upcast())
}).cloned();
self.window()
.layout_chan()