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

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

Issue 217423012: Avoid the hash table StyleInvalidator::clearInvalidation in Node::detach when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « no previous file | 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 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/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 23 matching lines...) Expand all
34 StyleInvalidator::InvalidationList& StyleInvalidator::ensurePendingInvalidationL ist(Element& element) 34 StyleInvalidator::InvalidationList& StyleInvalidator::ensurePendingInvalidationL ist(Element& element)
35 { 35 {
36 PendingInvalidationMap::AddResult addResult = m_pendingInvalidationMap.add(& element, nullptr); 36 PendingInvalidationMap::AddResult addResult = m_pendingInvalidationMap.add(& element, nullptr);
37 if (addResult.isNewEntry) 37 if (addResult.isNewEntry)
38 addResult.storedValue->value = adoptPtr(new InvalidationList); 38 addResult.storedValue->value = adoptPtr(new InvalidationList);
39 return *addResult.storedValue->value; 39 return *addResult.storedValue->value;
40 } 40 }
41 41
42 void StyleInvalidator::clearInvalidation(Node& node) 42 void StyleInvalidator::clearInvalidation(Node& node)
43 { 43 {
44 if (node.isElementNode() && node.needsStyleInvalidation())
45 m_pendingInvalidationMap.remove(toElement(&node));
44 node.clearChildNeedsStyleInvalidation(); 46 node.clearChildNeedsStyleInvalidation();
45 node.clearNeedsStyleInvalidation(); 47 node.clearNeedsStyleInvalidation();
46 if (node.isElementNode())
47 m_pendingInvalidationMap.remove(toElement(&node));
48 } 48 }
49 49
50 void StyleInvalidator::clearPendingInvalidations() 50 void StyleInvalidator::clearPendingInvalidations()
51 { 51 {
52 m_pendingInvalidationMap.clear(); 52 m_pendingInvalidationMap.clear();
53 } 53 }
54 54
55 StyleInvalidator::StyleInvalidator() 55 StyleInvalidator::StyleInvalidator()
56 { } 56 { }
57 57
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 } 149 }
150 150
151 element.clearChildNeedsStyleInvalidation(); 151 element.clearChildNeedsStyleInvalidation();
152 element.clearNeedsStyleInvalidation(); 152 element.clearNeedsStyleInvalidation();
153 153
154 return thisElementNeedsStyleRecalc; 154 return thisElementNeedsStyleRecalc;
155 } 155 }
156 156
157 } // namespace WebCore 157 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698