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

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

Issue 1491183007: Call pseudoStateChangedForElement from Element::pseudoStateChanged only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 82cb94ca00c6813c593ae0c902711d08160aef2b..c4a830152f1d1f594e390a7ab0d84617c23fdcbe 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -1082,7 +1082,7 @@ void ContainerNode::focusStateChanged()
if (computedStyle()->affectedByFocus() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus())
- document().styleEngine().pseudoStateChangedForElement(CSSSelector::PseudoFocus, *toElement(this));
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoFocus);
else if (computedStyle()->affectedByFocus())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
}
@@ -1118,8 +1118,8 @@ void ContainerNode::setFocus(bool received)
return;
// If :focus sets display: none, we lose focus but still need to recalc our style.
- if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus() && styleChangeType() < SubtreeStyleChange)
- document().styleEngine().pseudoStateChangedForElement(CSSSelector::PseudoFocus, *toElement(this));
+ if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus())
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoFocus);
else
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Focus));
}
@@ -1137,7 +1137,7 @@ void ContainerNode::setActive(bool down)
if (computedStyle()->affectedByActive() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActive())
- document().styleEngine().pseudoStateChangedForElement(CSSSelector::PseudoActive, *toElement(this));
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive);
else if (computedStyle()->affectedByActive())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
}
@@ -1157,8 +1157,8 @@ void ContainerNode::setHovered(bool over)
if (!layoutObject()) {
if (over)
return;
- if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover() && styleChangeType() < SubtreeStyleChange)
- document().styleEngine().pseudoStateChangedForElement(CSSSelector::PseudoHover, *toElement(this));
+ if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover())
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover);
else
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
return;
@@ -1168,7 +1168,7 @@ void ContainerNode::setHovered(bool over)
if (computedStyle()->affectedByHover() && computedStyle()->hasPseudoStyle(FIRST_LETTER))
setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHover())
- document().styleEngine().pseudoStateChangedForElement(CSSSelector::PseudoHover, *toElement(this));
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoHover);
else if (computedStyle()->affectedByHover())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Hover));
}
« 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