| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void didDistributeNode(const Node*, InsertionPoint*); | 69 void didDistributeNode(const Node*, InsertionPoint*); |
| 70 | 70 |
| 71 bool isV1() const { return youngestShadowRoot().isV1(); }; | 71 bool isV1() const { return youngestShadowRoot().isV1(); }; |
| 72 bool isOpenOrV0() const { return youngestShadowRoot().isOpenOrV0(); }; | 72 bool isOpenOrV0() const { return youngestShadowRoot().isOpenOrV0(); }; |
| 73 | 73 |
| 74 DECLARE_TRACE(); | 74 DECLARE_TRACE(); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 ElementShadow(); | 77 ElementShadow(); |
| 78 | 78 |
| 79 #if !ENABLE(OILPAN) | |
| 80 void removeDetachedShadowRoots(); | |
| 81 #endif | |
| 82 | |
| 83 void distribute(); | 79 void distribute(); |
| 84 void clearDistribution(); | 80 void clearDistribution(); |
| 85 | 81 |
| 86 void distributeV0(); | 82 void distributeV0(); |
| 87 void distributeV1(); | 83 void distributeV1(); |
| 88 | 84 |
| 89 void collectSelectFeatureSetFrom(ShadowRoot&); | 85 void collectSelectFeatureSetFrom(ShadowRoot&); |
| 90 void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*); | 86 void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*); |
| 91 | 87 |
| 92 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } | 88 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } |
| 93 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } | 89 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } |
| 94 | 90 |
| 95 #if ENABLE(OILPAN) | 91 using NodeToDestinationInsertionPoints = HeapHashMap<Member<const Node>, Mem
ber<DestinationInsertionPoints>>; |
| 96 // The cost of |new| in Oilpan is lower than non-Oilpan. We should reduce | |
| 97 // the size of HashMap entry. | |
| 98 typedef HeapHashMap<Member<const Node>, Member<DestinationInsertionPoints>>
NodeToDestinationInsertionPoints; | |
| 99 #else | |
| 100 typedef HashMap<const Node*, DestinationInsertionPoints> NodeToDestinationIn
sertionPoints; | |
| 101 #endif | |
| 102 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; | 92 NodeToDestinationInsertionPoints m_nodeToInsertionPoints; |
| 103 | 93 |
| 104 SelectRuleFeatureSet m_selectFeatures; | 94 SelectRuleFeatureSet m_selectFeatures; |
| 105 // FIXME: Oilpan: add a heap-based version of DoublyLinkedList<>. | 95 // TODO(Oilpan): add a heap-based version of DoublyLinkedList<>. |
| 106 DoublyLinkedList<ShadowRoot> m_shadowRoots; | 96 DoublyLinkedList<ShadowRoot> m_shadowRoots; |
| 107 bool m_needsDistributionRecalc; | 97 bool m_needsDistributionRecalc; |
| 108 bool m_needsSelectFeatureSet; | 98 bool m_needsSelectFeatureSet; |
| 109 }; | 99 }; |
| 110 | 100 |
| 111 inline Element* ElementShadow::host() const | 101 inline Element* ElementShadow::host() const |
| 112 { | 102 { |
| 113 DCHECK(!m_shadowRoots.isEmpty()); | 103 DCHECK(!m_shadowRoots.isEmpty()); |
| 114 return youngestShadowRoot().host(); | 104 return youngestShadowRoot().host(); |
| 115 } | 105 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 138 inline void ElementShadow::distributeIfNeeded() | 128 inline void ElementShadow::distributeIfNeeded() |
| 139 { | 129 { |
| 140 if (m_needsDistributionRecalc) | 130 if (m_needsDistributionRecalc) |
| 141 distribute(); | 131 distribute(); |
| 142 m_needsDistributionRecalc = false; | 132 m_needsDistributionRecalc = false; |
| 143 } | 133 } |
| 144 | 134 |
| 145 } // namespace blink | 135 } // namespace blink |
| 146 | 136 |
| 147 #endif | 137 #endif |
| OLD | NEW |