OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NGLayoutOpportunityIterator_h |
| 6 #define NGLayoutOpportunityIterator_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/LayoutBox.h" |
| 10 #include "core/layout/ng/ng_constraint_space.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 #include "wtf/text/WTFString.h" |
| 13 #include "wtf/Vector.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class CORE_EXPORT NGLayoutOpportunityIterator final |
| 18 : public GarbageCollectedFinalized<NGLayoutOpportunityIterator> { |
| 19 public: |
| 20 NGLayoutOpportunityIterator(NGConstraintSpace* space, |
| 21 unsigned clear, |
| 22 bool for_inline_or_bfc); |
| 23 ~NGLayoutOpportunityIterator() {} |
| 24 |
| 25 NGConstraintSpace* Next(); |
| 26 |
| 27 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 28 visitor->trace(constraint_space_); |
| 29 visitor->trace(current_opportunities_); |
| 30 } |
| 31 |
| 32 private: |
| 33 void computeForExclusion(unsigned index); |
| 34 LayoutUnit heightForOpportunity(LayoutUnit left, |
| 35 LayoutUnit top, |
| 36 LayoutUnit right, |
| 37 LayoutUnit bottom); |
| 38 void addLayoutOpportunity(LayoutUnit left, |
| 39 LayoutUnit top, |
| 40 LayoutUnit right, |
| 41 LayoutUnit bottom); |
| 42 |
| 43 Member<NGConstraintSpace> constraint_space_; |
| 44 unsigned clear_; |
| 45 bool for_inline_or_bfc_; |
| 46 Vector<NGExclusion> filtered_exclusions_; |
| 47 HeapVector<Member<NGConstraintSpace>> current_opportunities_; |
| 48 unsigned current_exclusion_idx_; |
| 49 }; |
| 50 |
| 51 } // namespace blink |
| 52 |
| 53 #endif // NGLayoutOpportunityIterator_h |
OLD | NEW |