Bug 1401317 - Make second pass sharing sensitive to DISABLE_STYLE_SHARING_CACHE. r=emilio

MozReview-Commit-ID: 8U0xekMHGg8
This commit is contained in:
Bobby Holley 2017-09-19 15:04:14 -07:00
parent 2a97b2cd7c
commit 4abe8002e9
2 changed files with 6 additions and 0 deletions

View file

@ -745,11 +745,16 @@ impl<E: TElement> StyleSharingCache<E> {
/// Attempts to find an element in the cache with the given primary rule node and parent.
pub fn lookup_by_rules(
&mut self,
shared_context: &SharedStyleContext,
inherited: &ComputedValues,
rules: &StrongRuleNode,
visited_rules: Option<&StrongRuleNode>,
target: E,
) -> Option<PrimaryStyle> {
if shared_context.options.disable_style_sharing_cache {
return None;
}
self.cache_mut().lookup(|candidate| {
debug_assert_ne!(candidate.element, target);
if !candidate.parent_style_identity().eq(inherited) {