Chromium Code Reviews| Index: Source/core/css/SelectorChecker.cpp |
| diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp |
| index b461ea062ef79cabda5eec1694b49b42c0f81521..099a94cd6a4073d6787053d246c48cf3df6305a2 100644 |
| --- a/Source/core/css/SelectorChecker.cpp |
| +++ b/Source/core/css/SelectorChecker.cpp |
| @@ -618,10 +618,8 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context, c |
| if (ContainerNode* parent = element.parentElementOrDocumentFragment()) { |
| bool result = siblingTraversalStrategy.isFirstChild(element); |
| if (m_mode == ResolvingStyle) { |
| - RenderStyle* childStyle = context.elementStyle ? context.elementStyle : element.renderStyle(); |
| parent->setChildrenAffectedByFirstChildRules(); |
| - if (result && childStyle) |
| - childStyle->setFirstChildState(); |
| + element.setAffectedByFirstChildRules(); |
| } |
| return result; |
| } |
| @@ -640,10 +638,8 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context, c |
| if (ContainerNode* parent = element.parentElementOrDocumentFragment()) { |
| bool result = parent->isFinishedParsingChildren() && siblingTraversalStrategy.isLastChild(element); |
| if (m_mode == ResolvingStyle) { |
| - RenderStyle* childStyle = context.elementStyle ? context.elementStyle : element.renderStyle(); |
| parent->setChildrenAffectedByLastChildRules(); |
| - if (result && childStyle) |
| - childStyle->setLastChildState(); |
| + element.setAffectedByLastChildRules(); |
| } |
| return result; |
| } |
| @@ -663,13 +659,10 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context, c |
| bool firstChild = siblingTraversalStrategy.isFirstChild(element); |
| bool onlyChild = firstChild && parent->isFinishedParsingChildren() && siblingTraversalStrategy.isLastChild(element); |
| if (m_mode == ResolvingStyle) { |
| - RenderStyle* childStyle = context.elementStyle ? context.elementStyle : element.renderStyle(); |
| parent->setChildrenAffectedByFirstChildRules(); |
| parent->setChildrenAffectedByLastChildRules(); |
| - if (firstChild && childStyle) |
| - childStyle->setFirstChildState(); |
| - if (onlyChild && childStyle) |
| - childStyle->setLastChildState(); |
| + element.setAffectedByFirstChildRules(); |
| + element.setAffectedByLastChildRules(); |
|
esprehn
2014/11/24 18:46:05
Why not check firstChild and onlyChild like before
|
| } |
| return onlyChild; |
| } |