OLD | NEW |
---|---|
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 Apple Inc. All rights reserv ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. |
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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1109 bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules(); | 1109 bool hasDirectAdjacentRules = childrenAffectedByDirectAdjacentRules(); |
1110 bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules(); | 1110 bool hasIndirectAdjacentRules = childrenAffectedByIndirectAdjacentRules(); |
1111 | 1111 |
1112 if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules) | 1112 if (!hasDirectAdjacentRules && !hasIndirectAdjacentRules) |
1113 return; | 1113 return; |
1114 | 1114 |
1115 unsigned forceCheckOfNextElementCount = 0; | 1115 unsigned forceCheckOfNextElementCount = 0; |
1116 bool forceCheckOfAnyElementSibling = false; | 1116 bool forceCheckOfAnyElementSibling = false; |
1117 Document& document = this->document(); | 1117 Document& document = this->document(); |
1118 | 1118 |
1119 for (Node* child = firstChild(); child; child = child->nextSibling()) { | 1119 for (Element* childElement = ElementTraversal::firstChild(*this); childEleme nt; childElement = ElementTraversal::nextSibling(*childElement)) { |
esprehn
2014/06/06 01:19:41
Just call it child, you don't need to rename it.
Inactive
2014/06/06 01:27:59
Done.
| |
1120 if (!child->isElementNode()) | 1120 bool childRulesChanged = childElement->needsStyleRecalc() && childElemen t->styleChangeType() >= SubtreeStyleChange; |
1121 continue; | |
1122 Element* element = toElement(child); | |
1123 bool childRulesChanged = element->needsStyleRecalc() && element->styleCh angeType() >= SubtreeStyleChange; | |
1124 | 1121 |
1125 if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling) | 1122 if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling) |
1126 element->setNeedsStyleRecalc(SubtreeStyleChange); | 1123 childElement->setNeedsStyleRecalc(SubtreeStyleChange); |
1127 | |
1128 if (forceCheckOfNextElementCount) | |
1129 forceCheckOfNextElementCount--; | |
1130 | 1124 |
1131 if (childRulesChanged && hasDirectAdjacentRules) | 1125 if (childRulesChanged && hasDirectAdjacentRules) |
1132 forceCheckOfNextElementCount = document.styleEngine()->maxDirectAdja centSelectors(); | 1126 forceCheckOfNextElementCount = document.styleEngine()->maxDirectAdja centSelectors(); |
1127 else if (forceCheckOfNextElementCount) | |
1128 --forceCheckOfNextElementCount; | |
1133 | 1129 |
1134 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules); | 1130 forceCheckOfAnyElementSibling = forceCheckOfAnyElementSibling || (childR ulesChanged && hasIndirectAdjacentRules); |
1135 } | 1131 } |
1136 } | 1132 } |
1137 | 1133 |
1138 void ContainerNode::checkForSiblingStyleChanges(bool finishedParsingCallback, No de* beforeChange, Node* afterChange, int childCountDelta) | 1134 void ContainerNode::checkForSiblingStyleChanges(bool finishedParsingCallback, No de* beforeChange, Node* afterChange, int childCountDelta) |
1139 { | 1135 { |
1140 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || style ChangeType() >= SubtreeStyleChange) | 1136 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || style ChangeType() >= SubtreeStyleChange) |
1141 return; | 1137 return; |
1142 | 1138 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1278 return true; | 1274 return true; |
1279 | 1275 |
1280 if (node->isElementNode() && toElement(node)->shadow()) | 1276 if (node->isElementNode() && toElement(node)->shadow()) |
1281 return true; | 1277 return true; |
1282 | 1278 |
1283 return false; | 1279 return false; |
1284 } | 1280 } |
1285 #endif | 1281 #endif |
1286 | 1282 |
1287 } // namespace WebCore | 1283 } // namespace WebCore |
OLD | NEW |