style: Move the StyleSheetSet into the Stylist.

This will allow tracking whether there have been only additions to the
stylesheet set, and in that case don't destroy and completely rebuild the
invalidation map.
This commit is contained in:
Emilio Cobos Álvarez 2017-08-21 15:13:06 +02:00
parent 02b203891f
commit cbf388a5fd
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 399 additions and 316 deletions

View file

@ -106,9 +106,6 @@ where
}
/// Appends a new stylesheet to the current set.
///
/// FIXME(emilio): `device` shouldn't be optional, but a bunch of work needs
/// to happen to make the invalidations work properly in servo.
pub fn append_stylesheet(
&mut self,
device: Option<&Device>,
@ -122,9 +119,6 @@ where
}
/// Prepend a new stylesheet to the current set.
///
/// FIXME(emilio): `device` shouldn't be optional, but a bunch of work needs
/// to happen to make the invalidations work properly in servo.
pub fn prepend_stylesheet(
&mut self,
device: Option<&Device>,
@ -138,15 +132,12 @@ where
}
/// Insert a given stylesheet before another stylesheet in the document.
///
/// FIXME(emilio): `device` shouldn't be optional, but a bunch of work needs
/// to happen to make the invalidations work properly in servo.
pub fn insert_stylesheet_before(
&mut self,
device: Option<&Device>,
sheet: S,
before_sheet: S,
guard: &SharedRwLockReadGuard
guard: &SharedRwLockReadGuard,
) {
debug!("StylesheetSet::insert_stylesheet_before");
self.remove_stylesheet_if_present(&sheet);
@ -158,9 +149,6 @@ where
}
/// Remove a given stylesheet from the set.
///
/// FIXME(emilio): `device` shouldn't be optional, but a bunch of work needs
/// to happen to make the invalidations work properly in servo.
pub fn remove_stylesheet(
&mut self,
device: Option<&Device>,