| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 #endif | 115 #endif |
| 117 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; | 116 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; |
| 118 | 117 |
| 119 SelectRuleFeatureSet m_selectFeatures; | 118 SelectRuleFeatureSet m_selectFeatures; |
| 120 // FIXME: Oilpan: add a heap-based version of DoublyLinkedList<>. | 119 // FIXME: Oilpan: add a heap-based version of DoublyLinkedList<>. |
| 121 DoublyLinkedList<ShadowRoot> m_shadowRoots; | 120 DoublyLinkedList<ShadowRoot> m_shadowRoots; |
| 122 bool m_needsDistributionRecalc; | 121 bool m_needsDistributionRecalc; |
| 123 bool m_needsSelectFeatureSet; | 122 bool m_needsSelectFeatureSet; |
| 124 | 123 |
| 125 // TODO(hayato): ShadowRoot should be an owner of SlotAssigment | 124 // TODO(hayato): ShadowRoot should be an owner of SlotAssigment |
| 126 OwnPtrWillBeMember<SlotAssignment> m_slotAssignment; | 125 Member<SlotAssignment> m_slotAssignment; |
| 127 }; | 126 }; |
| 128 | 127 |
| 129 inline Element* ElementShadow::host() const | 128 inline Element* ElementShadow::host() const |
| 130 { | 129 { |
| 131 ASSERT(!m_shadowRoots.isEmpty()); | 130 ASSERT(!m_shadowRoots.isEmpty()); |
| 132 return youngestShadowRoot().host(); | 131 return youngestShadowRoot().host(); |
| 133 } | 132 } |
| 134 | 133 |
| 135 inline ShadowRoot* Node::youngestShadowRoot() const | 134 inline ShadowRoot* Node::youngestShadowRoot() const |
| 136 { | 135 { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 163 inline void ElementShadow::distributeIfNeeded() | 162 inline void ElementShadow::distributeIfNeeded() |
| 164 { | 163 { |
| 165 if (m_needsDistributionRecalc) | 164 if (m_needsDistributionRecalc) |
| 166 distribute(); | 165 distribute(); |
| 167 m_needsDistributionRecalc = false; | 166 m_needsDistributionRecalc = false; |
| 168 } | 167 } |
| 169 | 168 |
| 170 } // namespace blink | 169 } // namespace blink |
| 171 | 170 |
| 172 #endif | 171 #endif |
| OLD | NEW |