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

Unified Diff: Source/core/css/SelectorChecker.cpp

Issue 16629006: Revert 151996 "Avoid N^2 walk placing renderers when building th..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Update to head Created 7 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 | « Source/core/css/SelectorChecker.h ('k') | Source/core/css/SiblingTraversalStrategies.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 3d83e5c8664a5af17b3fc1272c7758be917dca02..5b4798a0735825fc8b2e6e7dc388f97706b96daf 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -494,8 +494,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
if (!selector->parseNth())
break;
if (Element* parentElement = element->parentElement()) {
- // FIXME: We should always have the index passed in to avoid needing countElementsBefore.
- int count = context.childIndex ? context.childIndex : 1 + siblingTraversalStrategy.countElementsBefore(element);
+ int count = 1 + siblingTraversalStrategy.countElementsBefore(element);
if (m_mode == ResolvingStyle) {
RenderStyle* childStyle = context.elementStyle ? context.elementStyle : element->renderStyle();
element->setChildIndex(count);
@@ -528,8 +527,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
parentElement->setChildrenAffectedByBackwardPositionalRules();
if (!parentElement->isFinishedParsingChildren())
return false;
- // FIXME: We should always have the index passed in to avoid needing countElementsAfter.
- int count = context.childIndex ? context.childIndex : 1 + siblingTraversalStrategy.countElementsAfter(element);
+ int count = 1 + siblingTraversalStrategy.countElementsAfter(element);
if (selector->matchNth(count))
return true;
}
« no previous file with comments | « Source/core/css/SelectorChecker.h ('k') | Source/core/css/SiblingTraversalStrategies.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698