| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu
llptr : m_distributedNodes.last().get(); } | 51 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu
llptr : m_distributedNodes.last().get(); } |
| 52 | 52 |
| 53 Node* distributedNodeNextTo(const Node&) const; | 53 Node* distributedNodeNextTo(const Node&) const; |
| 54 Node* distributedNodePreviousTo(const Node&) const; | 54 Node* distributedNodePreviousTo(const Node&) const; |
| 55 | 55 |
| 56 void appendAssignedNode(Node&); | 56 void appendAssignedNode(Node&); |
| 57 void appendDistributedNode(Node&); | 57 void appendDistributedNode(Node&); |
| 58 void appendDistributedNodesFrom(const HTMLSlotElement& other); | 58 void appendDistributedNodesFrom(const HTMLSlotElement& other); |
| 59 void clearDistribution(); | 59 void clearDistribution(); |
| 60 | 60 |
| 61 bool hasSlotChangeEventListener(); |
| 62 |
| 61 void updateDistributedNodesWithFallback(); | 63 void updateDistributedNodesWithFallback(); |
| 64 void didUpdateDistribution(); |
| 62 | 65 |
| 63 void attach(const AttachContext& = AttachContext()) override; | 66 void attach(const AttachContext& = AttachContext()) override; |
| 64 void detach(const AttachContext& = AttachContext()) override; | 67 void detach(const AttachContext& = AttachContext()) override; |
| 65 | 68 |
| 66 void attributeChanged(const QualifiedName&, const AtomicString& oldValue, co
nst AtomicString& newValue, AttributeModificationReason = ModifiedDirectly) over
ride; | 69 void attributeChanged(const QualifiedName&, const AtomicString& oldValue, co
nst AtomicString& newValue, AttributeModificationReason = ModifiedDirectly) over
ride; |
| 67 | 70 |
| 68 DECLARE_VIRTUAL_TRACE(); | 71 DECLARE_VIRTUAL_TRACE(); |
| 69 | 72 |
| 70 private: | 73 private: |
| 71 HTMLSlotElement(Document&); | 74 HTMLSlotElement(Document&); |
| 72 | 75 |
| 73 void childrenChanged(const ChildrenChange&) override; | 76 void childrenChanged(const ChildrenChange&) override; |
| 74 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 77 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 75 void removedFrom(ContainerNode*) override; | 78 void removedFrom(ContainerNode*) override; |
| 76 | 79 |
| 80 void dispatchSlotChangeEvent(); |
| 81 |
| 77 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; | 82 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; |
| 78 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; | 83 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; |
| 79 WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t> m_distributedIndic
es; | 84 WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t> m_distributedIndic
es; |
| 85 // TODO(hayato): Remove m_oldDistibutedNodes and make SlotAssignment check t
he diffirence between old and new distributed nodes for each slot to save the me
mories. |
| 86 WillBeHeapVector<RefPtrWillBeMember<Node>> m_oldDistributedNodes; |
| 80 }; | 87 }; |
| 81 | 88 |
| 82 } // namespace blink | 89 } // namespace blink |
| 83 | 90 |
| 84 #endif // HTMLSlotElement_h | 91 #endif // HTMLSlotElement_h |
| OLD | NEW |