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

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

Issue 2095833003: :active pseudo class is not applied for element with display none. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test case which require LocalStyleChange calculation from both setActive and setHover Created 4 years, 6 months 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 | « third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none-expected.html ('k') | no next file » | 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 c84626d91ccac8d02a52fa3d09eb7c94405555da..23b2ee1b1138c1b3c9d480e1b605bce558ad7478 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -1026,17 +1026,22 @@ void ContainerNode::setActive(bool down)
Node::setActive(down);
- // FIXME: Why does this not need to handle the display: none transition like :hover does?
- if (layoutObject()) {
- if (computedStyle()->affectedByActive()) {
- StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoIdFirstLetter) ? SubtreeStyleChange : LocalStyleChange;
- setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
- }
+ if (!layoutObject()) {
if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActive())
toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive);
+ else
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
+ return;
+ }
- LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControlState);
+ if (computedStyle()->affectedByActive()) {
+ StyleChangeType changeType = computedStyle()->hasPseudoStyle(PseudoIdFirstLetter) ? SubtreeStyleChange : LocalStyleChange;
+ setNeedsStyleRecalc(changeType, StyleChangeReasonForTracing::createWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Active));
}
+ if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByActive())
+ toElement(this)->pseudoStateChanged(CSSSelector::PseudoActive);
+
+ LayoutTheme::theme().controlStateChanged(*layoutObject(), PressedControlState);
}
void ContainerNode::setHovered(bool over)
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/pseudo-hover-active-display-none-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698