Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.h

Issue 1872303002: Simplify slot assignments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const HeapVector<Member<Node>>& assignedNodes() const { ASSERT(!needsDistrib utionRecalc()); return m_assignedNodes; } 46 const HeapVector<Member<Node>>& assignedNodes() const { ASSERT(!needsDistrib utionRecalc()); return m_assignedNodes; }
47 const HeapVector<Member<Node>>& getDistributedNodes(); 47 const HeapVector<Member<Node>>& getDistributedNodes();
48 const HeapVector<Member<Node>> assignedNodesForBinding(const AssignedNodesOp tions&); 48 const HeapVector<Member<Node>> assignedNodesForBinding(const AssignedNodesOp tions&);
49 49
50 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); } 50 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); }
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 AtomicString normalizedSlotName() const;
kochi 2016/04/11 10:57:54 No user of this function? I don't find the impleme
hayato 2016/04/12 04:06:53 Nice catch. Removed.
57
56 void appendAssignedNode(Node&); 58 void appendAssignedNode(Node&);
57 void appendDistributedNode(Node&); 59 void appendDistributedNode(Node&);
58 void appendDistributedNodesFrom(const HTMLSlotElement& other); 60 void appendDistributedNodesFrom(const HTMLSlotElement& other);
59 void willUpdateDistribution(); 61 void willUpdateDistribution();
60 62
61 bool hasSlotChangeEventListener(); 63 bool hasSlotChangeEventListener();
62 64
63 void updateDistributedNodesWithFallback(); 65 void updateDistributedNodesWithFallback();
64 void didUpdateDistribution(); 66 void didUpdateDistribution();
65 67
66 void attach(const AttachContext& = AttachContext()) final; 68 void attach(const AttachContext& = AttachContext()) final;
67 void detach(const AttachContext& = AttachContext()) final; 69 void detach(const AttachContext& = AttachContext()) final;
68 70
69 void attributeChanged(const QualifiedName&, const AtomicString& oldValue, co nst AtomicString& newValue, AttributeModificationReason = ModifiedDirectly) fina l; 71 void attributeChanged(const QualifiedName&, const AtomicString& oldValue, co nst AtomicString& newValue, AttributeModificationReason = ModifiedDirectly) fina l;
70 72
71 short tabIndex() const override; 73 short tabIndex() const override;
74 AtomicString name() const;
72 75
73 DECLARE_VIRTUAL_TRACE(); 76 DECLARE_VIRTUAL_TRACE();
74 77
75 private: 78 private:
76 HTMLSlotElement(Document&); 79 HTMLSlotElement(Document&);
77 80
78 enum DistributionState { 81 enum DistributionState {
79 DistributionOnGoing, 82 DistributionOnGoing,
80 DistributionDone, 83 DistributionDone,
81 DistributionChanged, 84 DistributionChanged,
(...skipping 13 matching lines...) Expand all
95 HeapVector<Member<Node>> m_distributedNodes; 98 HeapVector<Member<Node>> m_distributedNodes;
96 HeapHashMap<Member<const Node>, size_t> m_distributedIndices; 99 HeapHashMap<Member<const Node>, size_t> m_distributedIndices;
97 // 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. 100 // 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.
98 HeapVector<Member<Node>> m_oldDistributedNodes; 101 HeapVector<Member<Node>> m_oldDistributedNodes;
99 DistributionState m_distributionState; 102 DistributionState m_distributionState;
100 }; 103 };
101 104
102 } // namespace blink 105 } // namespace blink
103 106
104 #endif // HTMLSlotElement_h 107 #endif // HTMLSlotElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698