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

Side by Side Diff: Source/core/dom/ContainerNode.cpp

Issue 1264573004: Need to check for positional rules on parent with style change. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/css/nth-child-dynamic-002-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 1338
1339 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules); 1339 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules);
1340 } 1340 }
1341 } 1341 }
1342 1342
1343 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Nod e* nodeBeforeChange, Node* nodeAfterChange) 1343 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, Nod e* nodeBeforeChange, Node* nodeAfterChange)
1344 { 1344 {
1345 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || style ChangeType() >= SubtreeStyleChange) 1345 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || style ChangeType() >= SubtreeStyleChange)
1346 return; 1346 return;
1347 1347
1348 if (needsStyleRecalc() && childrenAffectedByPositionalRules())
1349 return;
1350
1351 // Forward positional selectors include nth-child, nth-of-type, first-of-typ e and only-of-type. 1348 // Forward positional selectors include nth-child, nth-of-type, first-of-typ e and only-of-type.
1352 // The indirect adjacent selector is the ~ selector. 1349 // The indirect adjacent selector is the ~ selector.
1353 // Backward positional selectors include nth-last-child, nth-last-of-type, l ast-of-type and only-of-type. 1350 // Backward positional selectors include nth-last-child, nth-last-of-type, l ast-of-type and only-of-type.
1354 // We have to invalidate everything following the insertion point in the for ward and indirect adjacent case, 1351 // We have to invalidate everything following the insertion point in the for ward and indirect adjacent case,
1355 // and everything before the insertion point in the backward case. 1352 // and everything before the insertion point in the backward case.
1356 // |afterChange| is 0 in the parser callback case, so we won't do any work f or the forward case if we don't have to. 1353 // |afterChange| is 0 in the parser callback case, so we won't do any work f or the forward case if we don't have to.
1357 // For performance reasons we just mark the parent node as changed, since we don't want to make childrenChanged O(n^2) by crawling all our kids 1354 // For performance reasons we just mark the parent node as changed, since we don't want to make childrenChanged O(n^2) by crawling all our kids
1358 // here. recalcStyle will then force a walk of the children when it sees tha t this has happened. 1355 // here. recalcStyle will then force a walk of the children when it sees tha t this has happened.
1359 if (((childrenAffectedByForwardPositionalRules() || childrenAffectedByIndire ctAdjacentRules()) && nodeAfterChange) 1356 if (((childrenAffectedByForwardPositionalRules() || childrenAffectedByIndire ctAdjacentRules()) && nodeAfterChange)
1360 || (childrenAffectedByBackwardPositionalRules() && nodeBeforeChange)) { 1357 || (childrenAffectedByBackwardPositionalRules() && nodeBeforeChange)) {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 return true; 1511 return true;
1515 1512
1516 if (node->isElementNode() && toElement(node)->shadow()) 1513 if (node->isElementNode() && toElement(node)->shadow())
1517 return true; 1514 return true;
1518 1515
1519 return false; 1516 return false;
1520 } 1517 }
1521 #endif 1518 #endif
1522 1519
1523 } // namespace blink 1520 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/nth-child-dynamic-002-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698