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

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

Issue 2760233004: Make all setNeedsReattachLayoutTree happen from updateStyle. (Closed)
Patch Set: Included https://codereview.chromium.org/2760953003/ Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | 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 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 781
782 void ContainerNode::detachLayoutTree(const AttachContext& context) { 782 void ContainerNode::detachLayoutTree(const AttachContext& context) {
783 AttachContext childrenContext(context); 783 AttachContext childrenContext(context);
784 childrenContext.resolvedStyle = nullptr; 784 childrenContext.resolvedStyle = nullptr;
785 childrenContext.clearInvalidation = true; 785 childrenContext.clearInvalidation = true;
786 786
787 for (Node* child = firstChild(); child; child = child->nextSibling()) 787 for (Node* child = firstChild(); child; child = child->nextSibling())
788 child->detachLayoutTree(childrenContext); 788 child->detachLayoutTree(childrenContext);
789 789
790 setChildNeedsStyleRecalc(); 790 setChildNeedsStyleRecalc();
791 setChildNeedsReattachLayoutTree();
792 Node::detachLayoutTree(context); 791 Node::detachLayoutTree(context);
793 } 792 }
794 793
795 void ContainerNode::childrenChanged(const ChildrenChange& change) { 794 void ContainerNode::childrenChanged(const ChildrenChange& change) {
796 document().incDOMTreeVersion(); 795 document().incDOMTreeVersion();
797 document().notifyChangeChildren(*this); 796 document().notifyChangeChildren(*this);
798 invalidateNodeListCachesInAncestors(); 797 invalidateNodeListCachesInAncestors();
799 if (change.isChildInsertion()) { 798 if (change.isChildInsertion()) {
800 if (!childNeedsStyleRecalc()) { 799 if (!childNeedsStyleRecalc()) {
801 setChildNeedsStyleRecalc(); 800 setChildNeedsStyleRecalc();
802 markAncestorsWithChildNeedsStyleRecalc(); 801 markAncestorsWithChildNeedsStyleRecalc();
803 } 802 }
804 if (!childNeedsReattachLayoutTree()) {
805 setChildNeedsReattachLayoutTree();
806 markAncestorsWithChildNeedsReattachLayoutTree();
807 }
808 } 803 }
809 } 804 }
810 805
811 void ContainerNode::cloneChildNodes(ContainerNode* clone) { 806 void ContainerNode::cloneChildNodes(ContainerNode* clone) {
812 DummyExceptionStateForTesting exceptionState; 807 DummyExceptionStateForTesting exceptionState;
813 for (Node* n = firstChild(); n && !exceptionState.hadException(); 808 for (Node* n = firstChild(); n && !exceptionState.hadException();
814 n = n->nextSibling()) 809 n = n->nextSibling())
815 clone->appendChild(n->cloneNode(true), exceptionState); 810 clone->appendChild(n->cloneNode(true), exceptionState);
816 } 811 }
817 812
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 return true; 1501 return true;
1507 1502
1508 if (node->isElementNode() && toElement(node)->shadow()) 1503 if (node->isElementNode() && toElement(node)->shadow())
1509 return true; 1504 return true;
1510 1505
1511 return false; 1506 return false;
1512 } 1507 }
1513 #endif 1508 #endif
1514 1509
1515 } // namespace blink 1510 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698