| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NGConstraintSpaceBuilder_h | 5 #ifndef NGConstraintSpaceBuilder_h |
| 6 #define NGConstraintSpaceBuilder_h | 6 #define NGConstraintSpaceBuilder_h |
| 7 | 7 |
| 8 #include "core/layout/ng/ng_constraint_space.h" | 8 #include "core/layout/ng/ng_constraint_space.h" |
| 9 #include "core/layout/ng/ng_units.h" | 9 #include "core/layout/ng/ng_units.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class CORE_EXPORT NGConstraintSpaceBuilder final | 13 class CORE_EXPORT NGConstraintSpaceBuilder final |
| 14 : public GarbageCollectedFinalized<NGConstraintSpaceBuilder> { | 14 : public GarbageCollectedFinalized<NGConstraintSpaceBuilder> { |
| 15 public: | 15 public: |
| 16 NGConstraintSpaceBuilder(const NGConstraintSpace* parent_space); | 16 NGConstraintSpaceBuilder(const NGConstraintSpace* parent_space); |
| 17 | 17 |
| 18 NGConstraintSpaceBuilder(NGWritingMode writing_mode); | 18 NGConstraintSpaceBuilder(NGWritingMode writing_mode); |
| 19 | 19 |
| 20 NGConstraintSpaceBuilder& SetAvailableSize(NGLogicalSize available_size); | 20 NGConstraintSpaceBuilder& SetAvailableSize(NGLogicalSize available_size); |
| 21 | 21 |
| 22 NGConstraintSpaceBuilder& SetPercentageResolutionSize( | 22 NGConstraintSpaceBuilder& SetPercentageResolutionSize( |
| 23 NGLogicalSize percentage_resolution_size); | 23 NGLogicalSize percentage_resolution_size); |
| 24 | 24 |
| 25 NGConstraintSpaceBuilder& SetFragmentainerSpaceAvailable(LayoutUnit space) { |
| 26 fragmentainer_space_available_ = space; |
| 27 return *this; |
| 28 } |
| 29 |
| 25 NGConstraintSpaceBuilder& SetTextDirection(TextDirection); | 30 NGConstraintSpaceBuilder& SetTextDirection(TextDirection); |
| 26 | 31 |
| 27 NGConstraintSpaceBuilder& SetIsFixedSizeInline(bool is_fixed_size_inline); | 32 NGConstraintSpaceBuilder& SetIsFixedSizeInline(bool is_fixed_size_inline); |
| 28 NGConstraintSpaceBuilder& SetIsFixedSizeBlock(bool is_fixed_size_block); | 33 NGConstraintSpaceBuilder& SetIsFixedSizeBlock(bool is_fixed_size_block); |
| 29 | 34 |
| 30 NGConstraintSpaceBuilder& SetIsShrinkToFit(bool shrink_to_fit); | 35 NGConstraintSpaceBuilder& SetIsShrinkToFit(bool shrink_to_fit); |
| 31 | 36 |
| 32 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( | 37 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( |
| 33 bool is_inline_direction_triggers_scrollbar); | 38 bool is_inline_direction_triggers_scrollbar); |
| 34 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( | 39 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 // - Is within a fragmentation container and needs its fragmentation offset | 50 // - Is within a fragmentation container and needs its fragmentation offset |
| 46 // updated. | 51 // updated. |
| 47 // - Has its size is determined by its parent layout (flex, abs-pos). | 52 // - Has its size is determined by its parent layout (flex, abs-pos). |
| 48 NGConstraintSpace* ToConstraintSpace(); | 53 NGConstraintSpace* ToConstraintSpace(); |
| 49 | 54 |
| 50 DEFINE_INLINE_TRACE() {} | 55 DEFINE_INLINE_TRACE() {} |
| 51 | 56 |
| 52 private: | 57 private: |
| 53 NGLogicalSize available_size_; | 58 NGLogicalSize available_size_; |
| 54 NGLogicalSize percentage_resolution_size_; | 59 NGLogicalSize percentage_resolution_size_; |
| 60 LayoutUnit fragmentainer_space_available_; |
| 55 | 61 |
| 56 unsigned writing_mode_ : 2; | 62 unsigned writing_mode_ : 2; |
| 57 unsigned parent_writing_mode_ : 2; | 63 unsigned parent_writing_mode_ : 2; |
| 58 unsigned is_fixed_size_inline_ : 1; | 64 unsigned is_fixed_size_inline_ : 1; |
| 59 unsigned is_fixed_size_block_ : 1; | 65 unsigned is_fixed_size_block_ : 1; |
| 60 unsigned is_shrink_to_fit_ : 1; | 66 unsigned is_shrink_to_fit_ : 1; |
| 61 unsigned is_inline_direction_triggers_scrollbar_ : 1; | 67 unsigned is_inline_direction_triggers_scrollbar_ : 1; |
| 62 unsigned is_block_direction_triggers_scrollbar_ : 1; | 68 unsigned is_block_direction_triggers_scrollbar_ : 1; |
| 63 unsigned fragmentation_type_ : 2; | 69 unsigned fragmentation_type_ : 2; |
| 64 unsigned is_new_fc_ : 1; | 70 unsigned is_new_fc_ : 1; |
| 65 unsigned text_direction_ : 1; | 71 unsigned text_direction_ : 1; |
| 66 | 72 |
| 67 std::shared_ptr<NGExclusions> exclusions_; | 73 std::shared_ptr<NGExclusions> exclusions_; |
| 68 }; | 74 }; |
| 69 | 75 |
| 70 } // namespace blink | 76 } // namespace blink |
| 71 | 77 |
| 72 #endif // NGConstraintSpaceBuilder | 78 #endif // NGConstraintSpaceBuilder |
| OLD | NEW |