Chromium Code Reviews| Index: Source/core/css/invalidation/StyleInvalidationTreeWalk.h |
| diff --git a/Source/core/css/invalidation/StyleInvalidationTreeWalk.h b/Source/core/css/invalidation/StyleInvalidationTreeWalk.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5098565f2fc890b7c0c78a0008ed4995c230caf7 |
| --- /dev/null |
| +++ b/Source/core/css/invalidation/StyleInvalidationTreeWalk.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef StyleInvalidationTreeWalk_h |
| +#define StyleInvalidationTreeWalk_h |
| + |
| +#include "core/css/RuleFeature.h" |
| + |
| +namespace WebCore { |
| + |
| +class StyleInvalidationTreeWalk { |
| +public: |
| + static void computeStyleInvalidation(Document&, RuleFeatureSet*); |
|
esprehn
2014/03/19 22:09:04
No static, this should work like the ChildInsertio
chrishtr
2014/03/19 22:49:39
The point of the static is to enforce invalidator
esprehn
2014/03/19 23:04:14
That's not the correct way to solve this. We have
chrishtr
2014/03/20 00:08:35
Matching style is good. Done.
|
| + |
| +private: |
| + StyleInvalidationTreeWalk(const RuleFeatureSet*); |
| + |
| + bool invalidateStyle(Element*); |
| + bool invalidateStyleForChildren(Element*); |
| + |
| + bool checkInvalidationSetsAgainstElement(Element*); |
|
esprehn
2014/03/19 22:09:04
These should all be references.
chrishtr
2014/03/19 22:49:39
Done.
|
| + |
| + class RecursionCheckpoint; |
| + class RecursionData { |
| + public: |
| + RecursionData() : m_foundInvalidationSet(false) { } |
| + void pushInvalidationSet(const DescendantInvalidationSet&); |
| + bool matchesCurrentInvalidationSets(Element*); |
| + bool foundInvalidationSet() { return m_foundInvalidationSet; } |
| + |
| + private: |
| + Vector<AtomicString> m_invalidationClasses; |
| + bool m_foundInvalidationSet; |
| + friend class RecursionCheckpoint; |
|
esprehn
2014/03/19 22:09:04
No friends please.
chrishtr
2014/03/19 22:49:39
Done.
|
| + }; |
| + |
| + class RecursionCheckpoint { |
| + public: |
| + RecursionCheckpoint(RecursionData* data) |
| + : m_prevClassLength(data->m_invalidationClasses.size()), |
| + m_prevFoundInvalidationSet(data->m_foundInvalidationSet), |
| + m_data(data) |
| + { } |
| + ~RecursionCheckpoint() |
| + { |
| + m_data->m_invalidationClasses.remove(m_prevClassLength, m_data->m_invalidationClasses.size() - m_prevClassLength); |
| + m_data->m_foundInvalidationSet = m_prevFoundInvalidationSet; |
| + } |
| + |
| + private: |
| + int m_prevClassLength; |
| + bool m_prevFoundInvalidationSet; |
| + RecursionData* m_data; |
| + }; |
| + |
| + const RuleFeatureSet* m_featureSet; |
| + RecursionData m_recursionData; |
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif // StyleInvalidationTreeWalk_h |