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

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

Issue 219993002: Avoid calling markAncestorsWithChildNeedsStyleRecalc() constantly in childrenChanged (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/dom/Element.h ('k') | no next file » | 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, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 inline void Node::setStyleChange(StyleChangeType changeType) 737 inline void Node::setStyleChange(StyleChangeType changeType)
738 { 738 {
739 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; 739 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
740 } 740 }
741 741
742 void Node::markAncestorsWithChildNeedsStyleRecalc() 742 void Node::markAncestorsWithChildNeedsStyleRecalc()
743 { 743 {
744 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode()) 744 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode())
745 p->setChildNeedsStyleRecalc(); 745 p->setChildNeedsStyleRecalc();
746 746
747 if (document().hasPendingStyleRecalc())
eseidel 2014/03/31 21:01:34 Why this additional check? Does document().schedu
748 return;
749
747 if (document().needsStyleRecalc() || document().childNeedsStyleRecalc()) 750 if (document().needsStyleRecalc() || document().childNeedsStyleRecalc())
748 document().scheduleRenderTreeUpdate(); 751 document().scheduleRenderTreeUpdate();
749 } 752 }
750 753
751 void Node::setNeedsStyleRecalc(StyleChangeType changeType) 754 void Node::setNeedsStyleRecalc(StyleChangeType changeType)
752 { 755 {
753 ASSERT(changeType != NoStyleChange); 756 ASSERT(changeType != NoStyleChange);
754 if (!inActiveDocument()) 757 if (!inActiveDocument())
755 return; 758 return;
756 759
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2524 node->showTreeForThis(); 2527 node->showTreeForThis();
2525 } 2528 }
2526 2529
2527 void showNodePath(const WebCore::Node* node) 2530 void showNodePath(const WebCore::Node* node)
2528 { 2531 {
2529 if (node) 2532 if (node)
2530 node->showNodePathForThis(); 2533 node->showNodePathForThis();
2531 } 2534 }
2532 2535
2533 #endif 2536 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698