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, 2013 Apple Inc. All rights | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights |
6 * reserved. | 6 * reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1290 if (element->shouldCallRecalcStyle(change)) | 1290 if (element->shouldCallRecalcStyle(change)) |
1291 element->recalcStyle(change, lastTextNode); | 1291 element->recalcStyle(change, lastTextNode); |
1292 else if (element->supportsStyleSharing()) | 1292 else if (element->supportsStyleSharing()) |
1293 styleResolver.addToStyleSharingList(*element); | 1293 styleResolver.addToStyleSharingList(*element); |
1294 if (element->layoutObject()) | 1294 if (element->layoutObject()) |
1295 lastTextNode = nullptr; | 1295 lastTextNode = nullptr; |
1296 } | 1296 } |
1297 } | 1297 } |
1298 } | 1298 } |
1299 | 1299 |
1300 void ContainerNode::rebuildChildrenLayoutTrees() { | |
1301 DCHECK(!needsStyleRecalc()); | |
1302 DCHECK(!needsReattachLayoutTree()); | |
1303 | |
1304 for (Node* child = firstChild(); child; child = child->nextSibling()) { | |
1305 if (child->needsReattachLayoutTree() || | |
1306 child->childNeedsReattachLayoutTree()) { | |
1307 if (child->isTextNode()) | |
1308 toText(child)->rebuildTextLayoutTree(); | |
1309 else if (child->isElementNode()) | |
1310 toElement(child)->rebuildLayoutTree(); | |
1311 } | |
1312 } | |
1313 clearChildNeedsStyleRecalc(); | |
esprehn
2016/12/14 04:30:47
I don't think you need to clear this bit, it shoul
nainar
2016/12/14 22:21:54
Done.
| |
1314 clearChildNeedsReattachLayoutTree(); | |
1315 } | |
1316 | |
1300 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, | 1317 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, |
1301 Element* changedElement, | 1318 Element* changedElement, |
1302 Node* nodeBeforeChange, | 1319 Node* nodeBeforeChange, |
1303 Node* nodeAfterChange) { | 1320 Node* nodeAfterChange) { |
1304 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || | 1321 if (!inActiveDocument() || document().hasPendingForcedStyleRecalc() || |
1305 getStyleChangeType() >= SubtreeStyleChange) | 1322 getStyleChangeType() >= SubtreeStyleChange) |
1306 return; | 1323 return; |
1307 | 1324 |
1308 if (!hasRestyleFlag(ChildrenAffectedByStructuralRules)) | 1325 if (!hasRestyleFlag(ChildrenAffectedByStructuralRules)) |
1309 return; | 1326 return; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1469 return true; | 1486 return true; |
1470 | 1487 |
1471 if (node->isElementNode() && toElement(node)->shadow()) | 1488 if (node->isElementNode() && toElement(node)->shadow()) |
1472 return true; | 1489 return true; |
1473 | 1490 |
1474 return false; | 1491 return false; |
1475 } | 1492 } |
1476 #endif | 1493 #endif |
1477 | 1494 |
1478 } // namespace blink | 1495 } // namespace blink |
OLD | NEW |