mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: Make XBL / Shadow DOM use something more light-weight than a Stylist.
It's just a struct aggregating stylesheets + CascadeData, with a quirks_mode parameter because XBL sucks so bad. Bug: 1436059 Reviewed-by: xidorn MozReview-Commit-ID: 7q99tSNXo0K
This commit is contained in:
parent
a6113af873
commit
5e64cb3516
9 changed files with 225 additions and 44 deletions
|
@ -583,6 +583,20 @@ impl<S> AuthorStylesheetSet<S>
|
|||
where
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
/// Create a new empty AuthorStylesheetSet.
|
||||
#[inline]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
collection: Default::default(),
|
||||
invalidations: StylesheetInvalidationSet::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether anything has changed since the last time this was flushed.
|
||||
pub fn dirty(&self) -> bool {
|
||||
self.collection.dirty
|
||||
}
|
||||
|
||||
fn collection_for(
|
||||
&mut self,
|
||||
_sheet: &S,
|
||||
|
@ -593,6 +607,17 @@ where
|
|||
|
||||
sheet_set_methods!("AuthorStylesheetSet");
|
||||
|
||||
/// Iterate over the list of stylesheets.
|
||||
pub fn iter(&self) -> StylesheetCollectionIterator<S> {
|
||||
self.collection.iter()
|
||||
}
|
||||
|
||||
/// Mark the sheet set dirty, as appropriate.
|
||||
pub fn force_dirty(&mut self) {
|
||||
self.invalidations.invalidate_fully();
|
||||
self.collection.set_data_validity_at_least(DataValidity::FullyInvalid);
|
||||
}
|
||||
|
||||
/// Flush the stylesheets for this author set.
|
||||
///
|
||||
/// `host` is the root of the affected subtree, like the shadow host, for
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue