OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 12 matching lines...) Expand all Loading... | |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef ElementShadow_h | 27 #ifndef ElementShadow_h |
28 #define ElementShadow_h | 28 #define ElementShadow_h |
29 | 29 |
30 #include "core/dom/shadow/InsertionPoint.h" | 30 #include "core/dom/shadow/InsertionPoint.h" |
31 #include "core/dom/shadow/SelectRuleFeatureSet.h" | 31 #include "core/dom/shadow/SelectRuleFeatureSet.h" |
32 #include "core/dom/shadow/ShadowRoot.h" | 32 #include "core/dom/shadow/ShadowRoot.h" |
33 #include "platform/heap/Handle.h" | |
33 #include "wtf/DoublyLinkedList.h" | 34 #include "wtf/DoublyLinkedList.h" |
34 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
35 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
36 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
37 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
39 | 40 |
40 namespace WebCore { | 41 namespace WebCore { |
41 | 42 |
42 class ElementShadow FINAL { | 43 class ElementShadow FINAL : public NoBaseWillBeGarbageCollectedFinalized<Element Shadow> { |
43 WTF_MAKE_NONCOPYABLE(ElementShadow); WTF_MAKE_FAST_ALLOCATED; | 44 WTF_MAKE_NONCOPYABLE(ElementShadow); |
45 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | |
44 public: | 46 public: |
45 static PassOwnPtr<ElementShadow> create(); | 47 static PassOwnPtrWillBeRawPtr<ElementShadow> create(); |
46 ~ElementShadow(); | 48 ~ElementShadow(); |
47 | 49 |
48 Element* host() const; | 50 Element* host() const; |
49 ShadowRoot* youngestShadowRoot() const { return m_shadowRoots.head(); } | 51 ShadowRoot* youngestShadowRoot() const { return m_shadowRoots.head(); } |
50 ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); } | 52 ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); } |
51 ElementShadow* containingShadow() const; | 53 ElementShadow* containingShadow() const; |
52 | 54 |
53 ShadowRoot& addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType); | 55 ShadowRoot& addShadowRoot(Element& shadowHost, ShadowRoot::ShadowRootType); |
54 | 56 |
55 bool hasSameStyles(const ElementShadow*) const; | 57 bool hasSameStyles(const ElementShadow*) const; |
(...skipping 26 matching lines...) Expand all Loading... | |
82 void collectSelectFeatureSetFrom(ShadowRoot&); | 84 void collectSelectFeatureSetFrom(ShadowRoot&); |
83 void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*); | 85 void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*); |
84 | 86 |
85 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } | 87 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } |
86 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } | 88 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } |
87 | 89 |
88 typedef HashMap<const Node*, DestinationInsertionPoints> NodeToDestinationIn sertionPoints; | 90 typedef HashMap<const Node*, DestinationInsertionPoints> NodeToDestinationIn sertionPoints; |
89 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; | 91 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; |
90 | 92 |
91 SelectRuleFeatureSet m_selectFeatures; | 93 SelectRuleFeatureSet m_selectFeatures; |
92 DoublyLinkedList<ShadowRoot> m_shadowRoots; | 94 DoublyLinkedList<ShadowRoot> m_shadowRoots; |
haraken
2014/05/08 04:14:00
Add a FIXME and mention that this should be moved
sof
2014/05/08 06:43:15
Done.
| |
93 bool m_needsDistributionRecalc; | 95 bool m_needsDistributionRecalc; |
94 bool m_needsSelectFeatureSet; | 96 bool m_needsSelectFeatureSet; |
95 }; | 97 }; |
96 | 98 |
97 inline Element* ElementShadow::host() const | 99 inline Element* ElementShadow::host() const |
98 { | 100 { |
99 ASSERT(!m_shadowRoots.isEmpty()); | 101 ASSERT(!m_shadowRoots.isEmpty()); |
100 return youngestShadowRoot()->host(); | 102 return youngestShadowRoot()->host(); |
101 } | 103 } |
102 | 104 |
(...skipping 21 matching lines...) Expand all Loading... | |
124 inline void ElementShadow::distributeIfNeeded() | 126 inline void ElementShadow::distributeIfNeeded() |
125 { | 127 { |
126 if (m_needsDistributionRecalc) | 128 if (m_needsDistributionRecalc) |
127 distribute(); | 129 distribute(); |
128 m_needsDistributionRecalc = false; | 130 m_needsDistributionRecalc = false; |
129 } | 131 } |
130 | 132 |
131 } // namespace | 133 } // namespace |
132 | 134 |
133 #endif | 135 #endif |
OLD | NEW |