Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Unified Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 1503993002: Don't early return on SubtreeStyleChange for scheduling invalidations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-clear-invalidation-set-20151207
Patch Set: Rebased Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index 380860b6f13af335379ef04f5c2677be1af494f2..de447cf49e6a072830051524150db23d7e61591e 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -1079,14 +1079,12 @@ void ContainerNode::focusStateChanged()
if (!layoutObject())
return;
- if (styleChangeType() < SubtreeStyleChange) {
- if (computedStyle()->affectedByFocus() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
- setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
- else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus())
- toElement(this)->pseudoStateChanged(CSSSelector::PseudoFocus);
- else if (computedStyle()->affectedByFocus())
- setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
- }
+ if (computedStyle()->affectedByFocus() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
+ else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus())
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoFocus);
+ else if (computedStyle()->affectedByFocus())
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
LayoutTheme::theme().controlStateChanged(*layoutObject(), FocusControlState);
}
@@ -1134,14 +1132,12 @@ void ContainerNode::setActive(bool down)
// FIXME: Why does this not need to handle the display: none transition like :hover does?
if (layoutObject()) {
- if (styleChangeType() < SubtreeStyleChange) {
- if (computedStyle()->affectedByActive() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
- setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
- else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActive())
- toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive);
- else if (computedStyle()->affectedByActive())
- setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
- }
+ if (computedStyle()->affectedByActive() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
+ else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActive())
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive);
+ else if (computedStyle()->affectedByActive())
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControlState);
}
@@ -1165,14 +1161,12 @@ void ContainerNode::setHovered(bool over)
return;
}
- if (styleChangeType() < SubtreeStyleChange) {
- if (computedStyle()->affectedByHover() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
- setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
- else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover())
- toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover);
- else if (computedStyle()->affectedByHover())
- setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
- }
+ if (computedStyle()->affectedByHover() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
+ else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover())
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover);
+ else if (computedStyle()->affectedByHover())
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
LayoutTheme::theme().controlStateChanged(*layoutObject(), HoverControlState);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698