| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 using namespace HTMLNames; | 41 using namespace HTMLNames; |
| 42 | 42 |
| 43 inline HTMLSlotElement::HTMLSlotElement(Document& document) | 43 inline HTMLSlotElement::HTMLSlotElement(Document& document) |
| 44 : HTMLElement(slotTag, document) | 44 : HTMLElement(slotTag, document) |
| 45 { | 45 { |
| 46 } | 46 } |
| 47 | 47 |
| 48 DEFINE_NODE_FACTORY(HTMLSlotElement); | 48 DEFINE_NODE_FACTORY(HTMLSlotElement); |
| 49 | 49 |
| 50 const WillBeHeapVector<RefPtrWillBeMember<Node>> HTMLSlotElement::getAssignedNod
esForBinding(const AssignedNodesOptions& options) | 50 const HeapVector<Member<Node>> HTMLSlotElement::getAssignedNodesForBinding(const
AssignedNodesOptions& options) |
| 51 { | 51 { |
| 52 updateDistribution(); | 52 updateDistribution(); |
| 53 if (options.hasFlatten() && options.flatten()) | 53 if (options.hasFlatten() && options.flatten()) |
| 54 return getDistributedNodes(); | 54 return getDistributedNodes(); |
| 55 return m_assignedNodes; | 55 return m_assignedNodes; |
| 56 } | 56 } |
| 57 | 57 |
| 58 const WillBeHeapVector<RefPtrWillBeMember<Node>>& HTMLSlotElement::getDistribute
dNodes() | 58 const HeapVector<Member<Node>>& HTMLSlotElement::getDistributedNodes() |
| 59 { | 59 { |
| 60 ASSERT(!needsDistributionRecalc()); | 60 ASSERT(!needsDistributionRecalc()); |
| 61 if (isInShadowTree()) | 61 if (isInShadowTree()) |
| 62 return m_distributedNodes; | 62 return m_distributedNodes; |
| 63 | 63 |
| 64 // A slot is unlikely to be used outside of a shadow tree. | 64 // A slot is unlikely to be used outside of a shadow tree. |
| 65 // We do not need to optimize this case in most cases. | 65 // We do not need to optimize this case in most cases. |
| 66 // TODO(hayato): If this path causes a performance issue, we should move | 66 // TODO(hayato): If this path causes a performance issue, we should move |
| 67 // ShadowRootRaraDate::m_descendantSlots into TreeScopreRareData-ish and | 67 // ShadowRootRaraDate::m_descendantSlots into TreeScopreRareData-ish and |
| 68 // update the distribution code so it considers a document tree too. | 68 // update the distribution code so it considers a document tree too. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 { | 222 { |
| 223 #if ENABLE(OILPAN) | 223 #if ENABLE(OILPAN) |
| 224 visitor->trace(m_assignedNodes); | 224 visitor->trace(m_assignedNodes); |
| 225 visitor->trace(m_distributedNodes); | 225 visitor->trace(m_distributedNodes); |
| 226 visitor->trace(m_distributedIndices); | 226 visitor->trace(m_distributedIndices); |
| 227 #endif | 227 #endif |
| 228 HTMLElement::trace(visitor); | 228 HTMLElement::trace(visitor); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace blink | 231 } // namespace blink |
| OLD | NEW |