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

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

Issue 143873016: Implement style invalidation tree walk for targeted style recalc upon class change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/Node.h ('k') | Source/core/dom/shadow/SelectRuleFeatureSet.h » ('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, 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 632 }
633 633
634 clearChildNeedsDistributionRecalc(); 634 clearChildNeedsDistributionRecalc();
635 } 635 }
636 636
637 void Node::setIsLink(bool isLink) 637 void Node::setIsLink(bool isLink)
638 { 638 {
639 setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag); 639 setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag);
640 } 640 }
641 641
642 void Node::setNeedsStyleInvalidation()
643 {
644 setFlag(NeedsStyleInvalidation);
645 markAncestorsWithChildNeedsStyleInvalidation();
646 }
647
648 void Node::markAncestorsWithChildNeedsStyleInvalidation()
649 {
650 for (Node* node = this; node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode())
651 node->setChildNeedsStyleInvalidation();
652 if (document().childNeedsStyleInvalidation())
653 document().scheduleStyleRecalc();
654 }
655
642 void Node::markAncestorsWithChildNeedsDistributionRecalc() 656 void Node::markAncestorsWithChildNeedsDistributionRecalc()
643 { 657 {
644 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode()) 658 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode())
645 node->setChildNeedsDistributionRecalc(); 659 node->setChildNeedsDistributionRecalc();
646 if (document().childNeedsDistributionRecalc()) 660 if (document().childNeedsDistributionRecalc())
647 document().scheduleStyleRecalc(); 661 document().scheduleStyleRecalc();
648 } 662 }
649 663
650 namespace { 664 namespace {
651 665
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 node->showTreeForThis(); 2575 node->showTreeForThis();
2562 } 2576 }
2563 2577
2564 void showNodePath(const WebCore::Node* node) 2578 void showNodePath(const WebCore::Node* node)
2565 { 2579 {
2566 if (node) 2580 if (node)
2567 node->showNodePathForThis(); 2581 node->showNodePathForThis();
2568 } 2582 }
2569 2583
2570 #endif 2584 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/shadow/SelectRuleFeatureSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698