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

Side by Side Diff: Source/core/css/invalidation/StyleInvalidator.cpp

Issue 1173283002: Move some Element specific code from Node::detach to Element::detach. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/css/invalidation/StyleInvalidator.h ('k') | Source/core/dom/Document.h » ('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 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "config.h" 6 #include "config.h"
7 7
8 #include "core/css/invalidation/StyleInvalidator.h" 8 #include "core/css/invalidation/StyleInvalidator.h"
9 9
10 #include "core/css/invalidation/DescendantInvalidationSet.h" 10 #include "core/css/invalidation/DescendantInvalidationSet.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 62
63 StyleInvalidator::InvalidationList& StyleInvalidator::ensurePendingInvalidationL ist(Element& element) 63 StyleInvalidator::InvalidationList& StyleInvalidator::ensurePendingInvalidationL ist(Element& element)
64 { 64 {
65 PendingInvalidationMap::AddResult addResult = m_pendingInvalidationMap.add(& element, nullptr); 65 PendingInvalidationMap::AddResult addResult = m_pendingInvalidationMap.add(& element, nullptr);
66 if (addResult.isNewEntry) 66 if (addResult.isNewEntry)
67 addResult.storedValue->value = adoptPtrWillBeNoop(new InvalidationList); 67 addResult.storedValue->value = adoptPtrWillBeNoop(new InvalidationList);
68 return *addResult.storedValue->value; 68 return *addResult.storedValue->value;
69 } 69 }
70 70
71 void StyleInvalidator::clearInvalidation(Node& node) 71 void StyleInvalidator::clearInvalidation(Element& element)
72 { 72 {
73 if (node.isElementNode() && node.needsStyleInvalidation()) 73 if (!element.needsStyleInvalidation())
74 m_pendingInvalidationMap.remove(toElement(&node)); 74 return;
75 m_pendingInvalidationMap.remove(&element);
76 element.clearNeedsStyleInvalidation();
75 } 77 }
76 78
77 void StyleInvalidator::clearPendingInvalidations() 79 void StyleInvalidator::clearPendingInvalidations()
78 { 80 {
79 m_pendingInvalidationMap.clear(); 81 m_pendingInvalidationMap.clear();
80 } 82 }
81 83
82 StyleInvalidator::StyleInvalidator() 84 StyleInvalidator::StyleInvalidator()
83 { 85 {
84 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_ENABLED(TRACE_DISABLED_BY_DE FAULT("devtools.timeline.invalidationTracking")); 86 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_ENABLED(TRACE_DISABLED_BY_DE FAULT("devtools.timeline.invalidationTracking"));
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 198 }
197 199
198 DEFINE_TRACE(StyleInvalidator) 200 DEFINE_TRACE(StyleInvalidator)
199 { 201 {
200 #if ENABLE(OILPAN) 202 #if ENABLE(OILPAN)
201 visitor->trace(m_pendingInvalidationMap); 203 visitor->trace(m_pendingInvalidationMap);
202 #endif 204 #endif
203 } 205 }
204 206
205 } // namespace blink 207 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/invalidation/StyleInvalidator.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698