| 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 for (Node* child = firstChild(); child; child = child->nextSibling()) { | 760 for (Node* child = firstChild(); child; child = child->nextSibling()) { |
| 761 #if DCHECK_IS_ON() | 761 #if DCHECK_IS_ON() |
| 762 DCHECK(child->needsAttach() || | 762 DCHECK(child->needsAttach() || |
| 763 childAttachedAllowedWhenAttachingChildren(this)); | 763 childAttachedAllowedWhenAttachingChildren(this)); |
| 764 #endif | 764 #endif |
| 765 if (child->needsAttach()) | 765 if (child->needsAttach()) |
| 766 child->attachLayoutTree(childrenContext); | 766 child->attachLayoutTree(childrenContext); |
| 767 } | 767 } |
| 768 | 768 |
| 769 clearChildNeedsStyleRecalc(); | 769 clearChildNeedsStyleRecalc(); |
| 770 clearChildNeedsReattachLayoutTree(); | |
| 771 Node::attachLayoutTree(context); | 770 Node::attachLayoutTree(context); |
| 772 } | 771 } |
| 773 | 772 |
| 774 void ContainerNode::detachLayoutTree(const AttachContext& context) { | 773 void ContainerNode::detachLayoutTree(const AttachContext& context) { |
| 775 AttachContext childrenContext(context); | 774 AttachContext childrenContext(context); |
| 776 childrenContext.resolvedStyle = nullptr; | 775 childrenContext.resolvedStyle = nullptr; |
| 777 childrenContext.clearInvalidation = true; | 776 childrenContext.clearInvalidation = true; |
| 778 | 777 |
| 779 for (Node* child = firstChild(); child; child = child->nextSibling()) | 778 for (Node* child = firstChild(); child; child = child->nextSibling()) |
| 780 child->detachLayoutTree(childrenContext); | 779 child->detachLayoutTree(childrenContext); |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 // O(1) time. See crbug.com/288225 | 1279 // O(1) time. See crbug.com/288225 |
| 1281 StyleResolver& styleResolver = document().ensureStyleResolver(); | 1280 StyleResolver& styleResolver = document().ensureStyleResolver(); |
| 1282 Text* lastTextNode = nullptr; | 1281 Text* lastTextNode = nullptr; |
| 1283 for (Node* child = lastChild(); child; child = child->previousSibling()) { | 1282 for (Node* child = lastChild(); child; child = child->previousSibling()) { |
| 1284 if (child->isTextNode()) { | 1283 if (child->isTextNode()) { |
| 1285 toText(child)->recalcTextStyle(change, lastTextNode); | 1284 toText(child)->recalcTextStyle(change, lastTextNode); |
| 1286 lastTextNode = toText(child); | 1285 lastTextNode = toText(child); |
| 1287 } else if (child->isElementNode()) { | 1286 } else if (child->isElementNode()) { |
| 1288 Element* element = toElement(child); | 1287 Element* element = toElement(child); |
| 1289 if (element->shouldCallRecalcStyle(change)) | 1288 if (element->shouldCallRecalcStyle(change)) |
| 1290 element->recalcStyle(change); | 1289 element->recalcStyle(change, lastTextNode); |
| 1291 else if (element->supportsStyleSharing()) | 1290 else if (element->supportsStyleSharing()) |
| 1292 styleResolver.addToStyleSharingList(*element); | 1291 styleResolver.addToStyleSharingList(*element); |
| 1293 if (element->layoutObject()) | 1292 if (element->layoutObject()) |
| 1294 lastTextNode = nullptr; | 1293 lastTextNode = nullptr; |
| 1295 } | 1294 } |
| 1296 } | 1295 } |
| 1297 } | 1296 } |
| 1298 | 1297 |
| 1299 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, | 1298 void ContainerNode::checkForSiblingStyleChanges(SiblingCheckType changeType, |
| 1300 Element* changedElement, | 1299 Element* changedElement, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 return true; | 1467 return true; |
| 1469 | 1468 |
| 1470 if (node->isElementNode() && toElement(node)->shadow()) | 1469 if (node->isElementNode() && toElement(node)->shadow()) |
| 1471 return true; | 1470 return true; |
| 1472 | 1471 |
| 1473 return false; | 1472 return false; |
| 1474 } | 1473 } |
| 1475 #endif | 1474 #endif |
| 1476 | 1475 |
| 1477 } // namespace blink | 1476 } // namespace blink |
| OLD | NEW |