mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Bug 1401317 - Make second pass sharing sensitive to DISABLE_STYLE_SHARING_CACHE. r=emilio
MozReview-Commit-ID: 8U0xekMHGg8
This commit is contained in:
parent
2a97b2cd7c
commit
4abe8002e9
2 changed files with 6 additions and 0 deletions
|
@ -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.
|
/// Attempts to find an element in the cache with the given primary rule node and parent.
|
||||||
pub fn lookup_by_rules(
|
pub fn lookup_by_rules(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
shared_context: &SharedStyleContext,
|
||||||
inherited: &ComputedValues,
|
inherited: &ComputedValues,
|
||||||
rules: &StrongRuleNode,
|
rules: &StrongRuleNode,
|
||||||
visited_rules: Option<&StrongRuleNode>,
|
visited_rules: Option<&StrongRuleNode>,
|
||||||
target: E,
|
target: E,
|
||||||
) -> Option<PrimaryStyle> {
|
) -> Option<PrimaryStyle> {
|
||||||
|
if shared_context.options.disable_style_sharing_cache {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
self.cache_mut().lookup(|candidate| {
|
self.cache_mut().lookup(|candidate| {
|
||||||
debug_assert_ne!(candidate.element, target);
|
debug_assert_ne!(candidate.element, target);
|
||||||
if !candidate.parent_style_identity().eq(inherited) {
|
if !candidate.parent_style_identity().eq(inherited) {
|
||||||
|
|
|
@ -195,6 +195,7 @@ where
|
||||||
|
|
||||||
if may_reuse {
|
if may_reuse {
|
||||||
let cached = self.context.thread_local.sharing_cache.lookup_by_rules(
|
let cached = self.context.thread_local.sharing_cache.lookup_by_rules(
|
||||||
|
self.context.shared,
|
||||||
parent_style.unwrap(),
|
parent_style.unwrap(),
|
||||||
inputs.rules.as_ref().unwrap(),
|
inputs.rules.as_ref().unwrap(),
|
||||||
inputs.visited_rules.as_ref(),
|
inputs.visited_rules.as_ref(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue