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) |