Index: Source/WebCore/css/SelectorChecker.cpp |
=================================================================== |
--- Source/WebCore/css/SelectorChecker.cpp (revision 98492) |
+++ Source/WebCore/css/SelectorChecker.cpp (working copy) |
@@ -483,10 +483,10 @@ |
} |
case CSSSelector::DirectAdjacent: |
{ |
- if (!m_isCollectingRulesOnly) { |
- RenderStyle* currentStyle = elementStyle ? elementStyle : e->renderStyle(); |
- if (currentStyle) |
- currentStyle->setAffectedByDirectAdjacentRules(); |
+ if (!m_isCollectingRulesOnly && e->parentNode() && e->parentNode()->isElementNode()) { |
+ RenderStyle* parentStyle = elementStyle ? elementParentStyle : e->parentNode()->renderStyle(); |
+ if (parentStyle) |
+ parentStyle->setChildrenAffectedByDirectAdjacentRules(); |
} |
Node* n = e->previousSibling(); |
while (n && !n->isElementNode()) |