OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef StyleResolverParentScope_h | 5 #ifndef StyleResolverParentScope_h |
6 #define StyleResolverParentScope_h | 6 #define StyleResolverParentScope_h |
7 | 7 |
8 #include "core/css/resolver/StyleResolver.h" | 8 #include "core/css/resolver/StyleResolver.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
11 #include "core/dom/shadow/ShadowRoot.h" | 11 #include "core/dom/shadow/ShadowRoot.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 // Maintains the parent element stack (and bloom filter) inside recalcStyle. | 15 // Maintains the parent element stack (and bloom filter) inside recalcStyle. |
16 class StyleResolverParentScope FINAL { | 16 class StyleResolverParentScope final { |
17 STACK_ALLOCATED(); | 17 STACK_ALLOCATED(); |
18 public: | 18 public: |
19 explicit StyleResolverParentScope(Node& parent); | 19 explicit StyleResolverParentScope(Node& parent); |
20 ~StyleResolverParentScope(); | 20 ~StyleResolverParentScope(); |
21 | 21 |
22 static void ensureParentStackIsPushed(); | 22 static void ensureParentStackIsPushed(); |
23 | 23 |
24 private: | 24 private: |
25 void pushParentIfNeeded(); | 25 void pushParentIfNeeded(); |
26 Node& parent() const { return *m_parent; } | 26 Node& parent() const { return *m_parent; } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (m_previous) | 68 if (m_previous) |
69 m_previous->pushParentIfNeeded(); | 69 m_previous->pushParentIfNeeded(); |
70 if (parent().isElementNode()) | 70 if (parent().isElementNode()) |
71 m_resolver.pushParentElement(toElement(parent())); | 71 m_resolver.pushParentElement(toElement(parent())); |
72 m_pushed = true; | 72 m_pushed = true; |
73 } | 73 } |
74 | 74 |
75 } // namespace blink | 75 } // namespace blink |
76 | 76 |
77 #endif // StyleResolverParentScope_h | 77 #endif // StyleResolverParentScope_h |
OLD | NEW |