Expose a way to flush shadow root stylesheets from layout

This commit is contained in:
Fernando Jiménez Moreno 2019-02-12 10:38:29 +01:00
parent e9f0e76d3c
commit cd07574235
2 changed files with 21 additions and 7 deletions

View file

@ -86,7 +86,9 @@ use style::font_metrics::ServoMetricsProvider;
use style::properties::{ComputedValues, PropertyDeclarationBlock};
use style::selector_parser::{extended_filtering, PseudoElement, SelectorImpl};
use style::selector_parser::{AttrValue as SelectorAttrValue, Lang, NonTSPseudoClass};
use style::shared_lock::{Locked as StyleLocked, SharedRwLock as StyleSharedRwLock};
use style::shared_lock::{
Locked as StyleLocked, SharedRwLock as StyleSharedRwLock, SharedRwLockReadGuard,
};
use style::str::is_whitespace;
use style::stylist::CascadeData;
use style::CaseSensitivityExt;
@ -216,6 +218,14 @@ impl<'sr> ServoShadowRoot<'sr> {
chain: PhantomData,
}
}
pub fn flush_stylesheets(&self, guard: &SharedRwLockReadGuard) {
unsafe {
&self
.shadow_root
.flush_stylesheets::<ServoLayoutElement>(guard)
};
}
}
impl<'ln> TNode for ServoLayoutNode<'ln> {