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

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

Issue 2375293002: Set NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree flags on Node (Closed)
Patch Set: As per Bugs' suggestions Created 4 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 | « third_party/WebKit/Source/core/dom/Node.h ('k') | no next file » | 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 685
686 inline void Node::setStyleChange(StyleChangeType changeType) 686 inline void Node::setStyleChange(StyleChangeType changeType)
687 { 687 {
688 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType; 688 m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
689 } 689 }
690 690
691 void Node::markAncestorsWithChildNeedsStyleRecalc() 691 void Node::markAncestorsWithChildNeedsStyleRecalc()
692 { 692 {
693 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode()) 693 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsStyleRe calc(); p = p->parentOrShadowHostNode())
694 p->setChildNeedsStyleRecalc(); 694 p->setChildNeedsStyleRecalc();
695 // TODO(nainar): Move this to Node::markAncestorsWithChildNeedsReattachLayou tTree()
esprehn 2016/09/29 04:32:47 Hmm, why do you want to move this?
695 document().scheduleLayoutTreeUpdateIfNeeded(); 696 document().scheduleLayoutTreeUpdateIfNeeded();
696 } 697 }
697 698
699 void Node::markAncestorsWithChildNeedsReattachLayoutTree()
700 {
701 for (ContainerNode* p = parentOrShadowHostNode(); p && !p->childNeedsReattac hLayoutTree(); p = p->parentOrShadowHostNode())
702 p->setChildNeedsReattachLayoutTree();
703 }
704 void Node::setNeedsReattachLayoutTree()
705 {
706 setFlag(NeedsReattachLayoutTree);
707 markAncestorsWithChildNeedsReattachLayoutTree();
708 }
709
698 void Node::setNeedsStyleRecalc(StyleChangeType changeType, const StyleChangeReas onForTracing& reason) 710 void Node::setNeedsStyleRecalc(StyleChangeType changeType, const StyleChangeReas onForTracing& reason)
699 { 711 {
700 DCHECK(changeType != NoStyleChange); 712 DCHECK(changeType != NoStyleChange);
701 if (!inActiveDocument()) 713 if (!inActiveDocument())
702 return; 714 return;
703 715
704 TRACE_EVENT_INSTANT1( 716 TRACE_EVENT_INSTANT1(
705 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), 717 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"),
706 "StyleRecalcInvalidationTracking", 718 "StyleRecalcInvalidationTracking",
707 TRACE_EVENT_SCOPE_THREAD, 719 TRACE_EVENT_SCOPE_THREAD,
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 if (node) { 2422 if (node) {
2411 std::stringstream stream; 2423 std::stringstream stream;
2412 node->printNodePathTo(stream); 2424 node->printNodePathTo(stream);
2413 LOG(INFO) << stream.str(); 2425 LOG(INFO) << stream.str();
2414 } else { 2426 } else {
2415 LOG(INFO) << "Cannot showNodePath for <null>"; 2427 LOG(INFO) << "Cannot showNodePath for <null>";
2416 } 2428 }
2417 } 2429 }
2418 2430
2419 #endif 2431 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698