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

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

Issue 219993002: Avoid calling markAncestorsWithChildNeedsStyleRecalc() constantly in childrenChanged (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix accessibility test and causing recalcs on removal Created 6 years, 8 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 | Annotate | Revision Log
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 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 clearChildNeedsStyleRecalc(); 647 clearChildNeedsStyleRecalc();
648 Node::detach(context); 648 Node::detach(context);
649 } 649 }
650 650
651 void ContainerNode::childrenChanged(bool changedByParser, Node*, Node*, int chil dCountDelta) 651 void ContainerNode::childrenChanged(bool changedByParser, Node*, Node*, int chil dCountDelta)
652 { 652 {
653 document().incDOMTreeVersion(); 653 document().incDOMTreeVersion();
654 if (!changedByParser && childCountDelta) 654 if (!changedByParser && childCountDelta)
655 document().updateRangesAfterChildrenChanged(this); 655 document().updateRangesAfterChildrenChanged(this);
656 invalidateNodeListCachesInAncestors(); 656 invalidateNodeListCachesInAncestors();
657 if (childCountDelta > 0 && inActiveDocument()) { 657 if (childCountDelta > 0 && !childNeedsStyleRecalc()) {
658 setChildNeedsStyleRecalc(); 658 setChildNeedsStyleRecalc();
659 markAncestorsWithChildNeedsStyleRecalc(); 659 markAncestorsWithChildNeedsStyleRecalc();
660 } 660 }
661 } 661 }
662 662
663 void ContainerNode::cloneChildNodes(ContainerNode *clone) 663 void ContainerNode::cloneChildNodes(ContainerNode *clone)
664 { 664 {
665 TrackExceptionState exceptionState; 665 TrackExceptionState exceptionState;
666 for (Node* n = firstChild(); n && !exceptionState.hadException(); n = n->nex tSibling()) 666 for (Node* n = firstChild(); n && !exceptionState.hadException(); n = n->nex tSibling())
667 clone->appendChild(n->cloneNode(true), exceptionState); 667 clone->appendChild(n->cloneNode(true), exceptionState);
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 return true; 1095 return true;
1096 1096
1097 if (node->isElementNode() && toElement(node)->shadow()) 1097 if (node->isElementNode() && toElement(node)->shadow())
1098 return true; 1098 return true;
1099 1099
1100 return false; 1100 return false;
1101 } 1101 }
1102 #endif 1102 #endif
1103 1103
1104 } // namespace WebCore 1104 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698