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

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: Addressed comments. 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
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
649 void Node::markAncestorsWithChildNeedsStyleInvalidation()
650 {
651 for (Node* node = this; node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode())
652 node->setChildNeedsStyleInvalidation();
653 if (document().childNeedsStyleInvalidation())
654 document().scheduleStyleRecalc();
655 }
656
642 void Node::markAncestorsWithChildNeedsDistributionRecalc() 657 void Node::markAncestorsWithChildNeedsDistributionRecalc()
643 { 658 {
644 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode()) 659 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode())
645 node->setChildNeedsDistributionRecalc(); 660 node->setChildNeedsDistributionRecalc();
646 if (document().childNeedsDistributionRecalc()) 661 if (document().childNeedsDistributionRecalc())
647 document().scheduleStyleRecalc(); 662 document().scheduleStyleRecalc();
648 } 663 }
649 664
650 namespace { 665 namespace {
651 666
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 node->showTreeForThis(); 2576 node->showTreeForThis();
2562 } 2577 }
2563 2578
2564 void showNodePath(const WebCore::Node* node) 2579 void showNodePath(const WebCore::Node* node)
2565 { 2580 {
2566 if (node) 2581 if (node)
2567 node->showNodePathForThis(); 2582 node->showNodePathForThis();
2568 } 2583 }
2569 2584
2570 #endif 2585 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698