Commit 036eb567 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Remove SetUnique() for style sharing from SelectorChecker.

Style sharing is removed and we should not need to avoid caching of
matched properties in these cases.

Change-Id: I5f6edee0ccd8da16f3361e17077b9b448a978f33
Reviewed-on: https://chromium-review.googlesource.com/c/1264638Reviewed-by: default avatarAnders Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597103}
parent d6bf5e89
...@@ -911,34 +911,26 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context, ...@@ -911,34 +911,26 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context,
context.visited_match_type == kVisitedMatchEnabled; context.visited_match_type == kVisitedMatchEnabled;
case CSSSelector::kPseudoDrag: case CSSSelector::kPseudoDrag:
if (mode_ == kResolvingStyle) { if (mode_ == kResolvingStyle) {
if (context.in_rightmost_compound) { if (context.in_rightmost_compound)
element_style_->SetAffectedByDrag(); element_style_->SetAffectedByDrag();
} else { else
element_style_->SetUnique();
element.SetChildrenOrSiblingsAffectedByDrag(); element.SetChildrenOrSiblingsAffectedByDrag();
}
} }
return element.IsDragged(); return element.IsDragged();
case CSSSelector::kPseudoFocus: case CSSSelector::kPseudoFocus:
if (mode_ == kResolvingStyle && !context.in_rightmost_compound) { if (mode_ == kResolvingStyle && !context.in_rightmost_compound)
element_style_->SetUnique();
element.SetChildrenOrSiblingsAffectedByFocus(); element.SetChildrenOrSiblingsAffectedByFocus();
}
return MatchesFocusPseudoClass(element); return MatchesFocusPseudoClass(element);
case CSSSelector::kPseudoFocusVisible: case CSSSelector::kPseudoFocusVisible:
if (mode_ == kResolvingStyle && !context.in_rightmost_compound) { if (mode_ == kResolvingStyle && !context.in_rightmost_compound)
element_style_->SetUnique();
element.SetChildrenOrSiblingsAffectedByFocusVisible(); element.SetChildrenOrSiblingsAffectedByFocusVisible();
}
return MatchesFocusVisiblePseudoClass(element); return MatchesFocusVisiblePseudoClass(element);
case CSSSelector::kPseudoFocusWithin: case CSSSelector::kPseudoFocusWithin:
if (mode_ == kResolvingStyle) { if (mode_ == kResolvingStyle) {
if (context.in_rightmost_compound) { if (context.in_rightmost_compound)
element_style_->SetAffectedByFocusWithin(); element_style_->SetAffectedByFocusWithin();
} else { else
element_style_->SetUnique();
element.SetChildrenOrSiblingsAffectedByFocusWithin(); element.SetChildrenOrSiblingsAffectedByFocusWithin();
}
} }
probe::forcePseudoState(&element, CSSSelector::kPseudoFocusWithin, probe::forcePseudoState(&element, CSSSelector::kPseudoFocusWithin,
&force_pseudo_state); &force_pseudo_state);
...@@ -947,12 +939,10 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context, ...@@ -947,12 +939,10 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context,
return element.HasFocusWithin(); return element.HasFocusWithin();
case CSSSelector::kPseudoHover: case CSSSelector::kPseudoHover:
if (mode_ == kResolvingStyle) { if (mode_ == kResolvingStyle) {
if (context.in_rightmost_compound) { if (context.in_rightmost_compound)
element_style_->SetAffectedByHover(); element_style_->SetAffectedByHover();
} else { else
element_style_->SetUnique();
element.SetChildrenOrSiblingsAffectedByHover(); element.SetChildrenOrSiblingsAffectedByHover();
}
} }
if (!ShouldMatchHoverOrActive(context)) if (!ShouldMatchHoverOrActive(context))
return false; return false;
...@@ -963,12 +953,10 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context, ...@@ -963,12 +953,10 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context,
return element.IsHovered(); return element.IsHovered();
case CSSSelector::kPseudoActive: case CSSSelector::kPseudoActive:
if (mode_ == kResolvingStyle) { if (mode_ == kResolvingStyle) {
if (context.in_rightmost_compound) { if (context.in_rightmost_compound)
element_style_->SetAffectedByActive(); element_style_->SetAffectedByActive();
} else { else
element_style_->SetUnique();
element.SetChildrenOrSiblingsAffectedByActive(); element.SetChildrenOrSiblingsAffectedByActive();
}
} }
if (!ShouldMatchHoverOrActive(context)) if (!ShouldMatchHoverOrActive(context))
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment