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

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: use AtomicString Created 6 years, 2 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
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/ShadowTreeStyleSheetCollection.cpp » ('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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; 760 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
761 } 761 }
762 762
763 void Node::markAncestorsWithChildNeedsStyleRecalc() 763 void Node::markAncestorsWithChildNeedsStyleRecalc()
764 { 764 {
765 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode()) 765 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode())
766 p->setChildNeedsStyleRecalc(); 766 p->setChildNeedsStyleRecalc();
767 document().scheduleRenderTreeUpdateIfNeeded(); 767 document().scheduleRenderTreeUpdateIfNeeded();
768 } 768 }
769 769
770 void Node::setNeedsStyleRecalc(StyleChangeType changeType) 770 void Node::setNeedsStyleRecalc(StyleChangeType changeType, const StyleChangeReas onForTracing& reason)
771 { 771 {
772 ASSERT(changeType != NoStyleChange); 772 ASSERT(changeType != NoStyleChange);
773 if (!inActiveDocument()) 773 if (!inActiveDocument())
774 return; 774 return;
775 775
776 StyleChangeType existingChangeType = styleChangeType(); 776 StyleChangeType existingChangeType = styleChangeType();
777 if (changeType > existingChangeType) { 777 if (changeType > existingChangeType) {
778 setStyleChange(changeType); 778 setStyleChange(changeType);
779 if (changeType >= SubtreeStyleChange) 779 if (changeType >= SubtreeStyleChange)
780 traceStyleChangeIfNeeded(changeType); 780 traceStyleChangeIfNeeded(changeType);
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 case Upgraded: 2421 case Upgraded:
2422 ASSERT(WaitingForUpgrade == oldState); 2422 ASSERT(WaitingForUpgrade == oldState);
2423 break; 2423 break;
2424 } 2424 }
2425 2425
2426 ASSERT(isHTMLElement() || isSVGElement()); 2426 ASSERT(isHTMLElement() || isSVGElement());
2427 setFlag(CustomElementFlag); 2427 setFlag(CustomElementFlag);
2428 setFlag(newState == Upgraded, CustomElementUpgradedFlag); 2428 setFlag(newState == Upgraded, CustomElementUpgradedFlag);
2429 2429
2430 if (oldState == NotCustomElement || newState == Upgraded) 2430 if (oldState == NotCustomElement || newState == Upgraded)
2431 setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed 2431 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ateWithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Unresolve d)); // :unresolved has changed
2432 } 2432 }
2433 2433
2434 void Node::trace(Visitor* visitor) 2434 void Node::trace(Visitor* visitor)
2435 { 2435 {
2436 #if ENABLE(OILPAN) 2436 #if ENABLE(OILPAN)
2437 visitor->trace(m_parentOrShadowHostNode); 2437 visitor->trace(m_parentOrShadowHostNode);
2438 visitor->trace(m_previous); 2438 visitor->trace(m_previous);
2439 visitor->trace(m_next); 2439 visitor->trace(m_next);
2440 // rareData() and m_data.m_renderer share their storage. We have to trace 2440 // rareData() and m_data.m_renderer share their storage. We have to trace
2441 // only one of them. 2441 // only one of them.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2510 node->showTreeForThis(); 2510 node->showTreeForThis();
2511 } 2511 }
2512 2512
2513 void showNodePath(const blink::Node* node) 2513 void showNodePath(const blink::Node* node)
2514 { 2514 {
2515 if (node) 2515 if (node)
2516 node->showNodePathForThis(); 2516 node->showNodePathForThis();
2517 } 2517 }
2518 2518
2519 #endif 2519 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/ShadowTreeStyleSheetCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698