| 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 22 matching lines...) Expand all Loading... |
| 33 #include "core/dom/shadow/ShadowRoot.h" | 33 #include "core/dom/shadow/ShadowRoot.h" |
| 34 #include "core/dom/shadow/SlotAssignment.h" | 34 #include "core/dom/shadow/SlotAssignment.h" |
| 35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 36 #include "wtf/DoublyLinkedList.h" | 36 #include "wtf/DoublyLinkedList.h" |
| 37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
| 38 #include "wtf/Noncopyable.h" | 38 #include "wtf/Noncopyable.h" |
| 39 #include "wtf/PassOwnPtr.h" | 39 #include "wtf/PassOwnPtr.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class CORE_EXPORT ElementShadow final : public NoBaseWillBeGarbageCollectedFinal
ized<ElementShadow> { | 43 class CORE_EXPORT ElementShadow final : public GarbageCollectedFinalized<Element
Shadow> { |
| 44 WTF_MAKE_NONCOPYABLE(ElementShadow); | 44 WTF_MAKE_NONCOPYABLE(ElementShadow); |
| 45 USING_FAST_MALLOC_WILL_BE_REMOVED(ElementShadow); | |
| 46 public: | 45 public: |
| 47 static PassOwnPtrWillBeRawPtr<ElementShadow> create(); | 46 static RawPtr<ElementShadow> create(); |
| 48 ~ElementShadow(); | 47 ~ElementShadow(); |
| 49 | 48 |
| 50 Element* host() const; | 49 Element* host() const; |
| 51 ShadowRoot& youngestShadowRoot() const { ASSERT(m_shadowRoots.head()); retur
n *m_shadowRoots.head(); } | 50 ShadowRoot& youngestShadowRoot() const { ASSERT(m_shadowRoots.head()); retur
n *m_shadowRoots.head(); } |
| 52 ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); } | 51 ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); } |
| 53 ElementShadow* containingShadow() const; | 52 ElementShadow* containingShadow() const; |
| 54 | 53 |
| 55 ShadowRoot* shadowRootIfV1() const | 54 ShadowRoot* shadowRootIfV1() const |
| 56 { | 55 { |
| 57 if (isV1()) | 56 if (isV1()) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 #endif | 116 #endif |
| 118 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; | 117 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; |
| 119 | 118 |
| 120 SelectRuleFeatureSet m_selectFeatures; | 119 SelectRuleFeatureSet m_selectFeatures; |
| 121 // FIXME: Oilpan: add a heap-based version of DoublyLinkedList<>. | 120 // FIXME: Oilpan: add a heap-based version of DoublyLinkedList<>. |
| 122 DoublyLinkedList<ShadowRoot> m_shadowRoots; | 121 DoublyLinkedList<ShadowRoot> m_shadowRoots; |
| 123 bool m_needsDistributionRecalc; | 122 bool m_needsDistributionRecalc; |
| 124 bool m_needsSelectFeatureSet; | 123 bool m_needsSelectFeatureSet; |
| 125 | 124 |
| 126 // TODO(hayato): ShadowRoot should be an owner of SlotAssigment | 125 // TODO(hayato): ShadowRoot should be an owner of SlotAssigment |
| 127 OwnPtrWillBeMember<SlotAssignment> m_slotAssignment; | 126 Member<SlotAssignment> m_slotAssignment; |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 inline Element* ElementShadow::host() const | 129 inline Element* ElementShadow::host() const |
| 131 { | 130 { |
| 132 ASSERT(!m_shadowRoots.isEmpty()); | 131 ASSERT(!m_shadowRoots.isEmpty()); |
| 133 return youngestShadowRoot().host(); | 132 return youngestShadowRoot().host(); |
| 134 } | 133 } |
| 135 | 134 |
| 136 inline ShadowRoot* Node::youngestShadowRoot() const | 135 inline ShadowRoot* Node::youngestShadowRoot() const |
| 137 { | 136 { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 164 inline void ElementShadow::distributeIfNeeded() | 163 inline void ElementShadow::distributeIfNeeded() |
| 165 { | 164 { |
| 166 if (m_needsDistributionRecalc) | 165 if (m_needsDistributionRecalc) |
| 167 distribute(); | 166 distribute(); |
| 168 m_needsDistributionRecalc = false; | 167 m_needsDistributionRecalc = false; |
| 169 } | 168 } |
| 170 | 169 |
| 171 } // namespace blink | 170 } // namespace blink |
| 172 | 171 |
| 173 #endif | 172 #endif |
| OLD | NEW |