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

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

Issue 143983007: Remove PostAttachCallbacks and replace with something more specialized (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update Created 6 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 | 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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 743
744 void Node::markAncestorsWithChildNeedsStyleRecalc() 744 void Node::markAncestorsWithChildNeedsStyleRecalc()
745 { 745 {
746 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode()) 746 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode())
747 p->setChildNeedsStyleRecalc(); 747 p->setChildNeedsStyleRecalc();
748 748
749 if (document().needsStyleRecalc() || document().childNeedsStyleRecalc()) 749 if (document().needsStyleRecalc() || document().childNeedsStyleRecalc())
750 document().scheduleStyleRecalc(); 750 document().scheduleStyleRecalc();
751 } 751 }
752 752
753 void Node::setNeedsStyleRecalc(StyleChangeType changeType, StyleChangeSource sou rce) 753 void Node::setNeedsStyleRecalc(StyleChangeType changeType)
754 { 754 {
755 ASSERT(changeType != NoStyleChange); 755 ASSERT(changeType != NoStyleChange);
756 if (!inActiveDocument()) 756 if (!inActiveDocument())
757 return; 757 return;
758 758
759 if (source == StyleChangeFromRenderer)
760 setFlag(NotifyRendererWithIdenticalStyles);
761
762 StyleChangeType existingChangeType = styleChangeType(); 759 StyleChangeType existingChangeType = styleChangeType();
763 if (changeType > existingChangeType) { 760 if (changeType > existingChangeType) {
764 setStyleChange(changeType); 761 setStyleChange(changeType);
765 if (changeType >= SubtreeStyleChange) 762 if (changeType >= SubtreeStyleChange)
766 traceStyleChangeIfNeeded(changeType); 763 traceStyleChangeIfNeeded(changeType);
767 } 764 }
768 765
769 if (existingChangeType == NoStyleChange) 766 if (existingChangeType == NoStyleChange)
770 markAncestorsWithChildNeedsStyleRecalc(); 767 markAncestorsWithChildNeedsStyleRecalc();
771 768
772 if (isElementNode() && hasRareData()) 769 if (isElementNode() && hasRareData())
773 toElement(*this).setAnimationStyleChange(false); 770 toElement(*this).setAnimationStyleChange(false);
774 } 771 }
775 772
776 void Node::clearNeedsStyleRecalc() 773 void Node::clearNeedsStyleRecalc()
777 { 774 {
778 m_nodeFlags &= ~StyleChangeMask; 775 m_nodeFlags &= ~StyleChangeMask;
779 clearFlag(NotifyRendererWithIdenticalStyles); 776
777 clearNeedsLayerUpdate();
780 778
781 if (isElementNode() && hasRareData()) 779 if (isElementNode() && hasRareData())
782 toElement(*this).setAnimationStyleChange(false); 780 toElement(*this).setAnimationStyleChange(false);
783 } 781 }
784 782
785 bool Node::inActiveDocument() const 783 bool Node::inActiveDocument() const
786 { 784 {
787 return inDocument() && document().isActive(); 785 return inDocument() && document().isActive();
788 } 786 }
789 787
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 if (hovered()) 997 if (hovered())
1000 doc.hoveredNodeDetached(this); 998 doc.hoveredNodeDetached(this);
1001 if (inActiveChain()) 999 if (inActiveChain())
1002 doc.activeChainNodeDetached(this); 1000 doc.activeChainNodeDetached(this);
1003 doc.userActionElements().didDetach(this); 1001 doc.userActionElements().didDetach(this);
1004 } 1002 }
1005 } 1003 }
1006 1004
1007 setStyleChange(NeedsReattachStyleChange); 1005 setStyleChange(NeedsReattachStyleChange);
1008 setChildNeedsStyleRecalc(); 1006 setChildNeedsStyleRecalc();
1007
1009 if (StyleResolver* resolver = document().styleResolver()) 1008 if (StyleResolver* resolver = document().styleResolver())
1010 resolver->ruleFeatureSet().clearStyleInvalidation(this); 1009 resolver->ruleFeatureSet().clearStyleInvalidation(this);
1011 1010
1012 #ifndef NDEBUG 1011 #ifndef NDEBUG
1013 detachingNode = 0; 1012 detachingNode = 0;
1014 #endif 1013 #endif
1015 } 1014 }
1016 1015
1017 void Node::reattachWhitespaceSiblings(Text* start) 1016 void Node::reattachWhitespaceSiblings(Text* start)
1018 { 1017 {
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 node->showTreeForThis(); 2540 node->showTreeForThis();
2542 } 2541 }
2543 2542
2544 void showNodePath(const WebCore::Node* node) 2543 void showNodePath(const WebCore::Node* node)
2545 { 2544 {
2546 if (node) 2545 if (node)
2547 node->showNodePathForThis(); 2546 node->showNodePathForThis();
2548 } 2547 }
2549 2548
2550 #endif 2549 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698