Do a second pass on the sharing cache to reuse style by rule node identity.

MozReview-Commit-ID: H67j3Sbt3gr
This commit is contained in:
Bobby Holley 2017-09-08 16:03:24 -07:00
parent 7a7070e075
commit 1c9b39a8e8
6 changed files with 122 additions and 8 deletions

View file

@ -1997,6 +1997,13 @@ pub struct ComputedValues {
inner: ComputedValuesInner,
}
impl ComputedValues {
/// Returns the visited rules, if applicable.
pub fn visited_rules(&self) -> Option<<&StrongRuleNode> {
self.visited_style.as_ref().and_then(|s| s.rules.as_ref())
}
}
#[cfg(feature = "servo")]
impl ComputedValues {
/// Create a new refcounted `ComputedValues`