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

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

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; 759 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
760 } 760 }
761 761
762 void Node::markAncestorsWithChildNeedsStyleRecalc() 762 void Node::markAncestorsWithChildNeedsStyleRecalc()
763 { 763 {
764 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode()) 764 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode())
765 p->setChildNeedsStyleRecalc(); 765 p->setChildNeedsStyleRecalc();
766 document().scheduleRenderTreeUpdateIfNeeded(); 766 document().scheduleRenderTreeUpdateIfNeeded();
767 } 767 }
768 768
769 void Node::setNeedsStyleRecalc(StyleChangeType changeType) 769 void Node::setNeedsStyleRecalc(StyleChangeReason reason, StyleChangeType changeT ype)
770 { 770 {
771 ASSERT(changeType != NoStyleChange); 771 ASSERT(changeType != NoStyleChange);
772 if (!inActiveDocument()) 772 if (!inActiveDocument())
773 return; 773 return;
774 774
775 StyleChangeType existingChangeType = styleChangeType(); 775 StyleChangeType existingChangeType = styleChangeType();
776 if (changeType > existingChangeType) { 776 if (changeType > existingChangeType) {
777 setStyleChange(changeType); 777 setStyleChange(changeType);
778 if (changeType >= SubtreeStyleChange) 778 if (changeType >= SubtreeStyleChange)
779 traceStyleChangeIfNeeded(changeType); 779 traceStyleChangeIfNeeded(changeType);
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 case Upgraded: 2420 case Upgraded:
2421 ASSERT(WaitingForUpgrade == oldState); 2421 ASSERT(WaitingForUpgrade == oldState);
2422 break; 2422 break;
2423 } 2423 }
2424 2424
2425 ASSERT(isHTMLElement() || isSVGElement()); 2425 ASSERT(isHTMLElement() || isSVGElement());
2426 setFlag(CustomElementFlag); 2426 setFlag(CustomElementFlag);
2427 setFlag(newState == Upgraded, CustomElementUpgradedFlag); 2427 setFlag(newState == Upgraded, CustomElementUpgradedFlag);
2428 2428
2429 if (oldState == NotCustomElement || newState == Upgraded) 2429 if (oldState == NotCustomElement || newState == Upgraded)
2430 setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed 2430 setNeedsStyleRecalc(StyleRecalcDueToCustomElement, SubtreeStyleChange); // :unresolved has changed
2431 } 2431 }
2432 2432
2433 void Node::trace(Visitor* visitor) 2433 void Node::trace(Visitor* visitor)
2434 { 2434 {
2435 #if ENABLE(OILPAN) 2435 #if ENABLE(OILPAN)
2436 visitor->trace(m_parentOrShadowHostNode); 2436 visitor->trace(m_parentOrShadowHostNode);
2437 visitor->trace(m_previous); 2437 visitor->trace(m_previous);
2438 visitor->trace(m_next); 2438 visitor->trace(m_next);
2439 // rareData() and m_data.m_renderer share their storage. We have to trace 2439 // rareData() and m_data.m_renderer share their storage. We have to trace
2440 // only one of them. 2440 // only one of them.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2501 node->showTreeForThis(); 2501 node->showTreeForThis();
2502 } 2502 }
2503 2503
2504 void showNodePath(const blink::Node* node) 2504 void showNodePath(const blink::Node* node)
2505 { 2505 {
2506 if (node) 2506 if (node)
2507 node->showNodePathForThis(); 2507 node->showNodePathForThis();
2508 } 2508 }
2509 2509
2510 #endif 2510 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698