| 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_fragment.h" | 8 #include "core/layout/ng/ng_fragment.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 GarbageCollected<NGConstraintSpaceBuilder> { | 14 : public GarbageCollected<NGConstraintSpaceBuilder> { |
| 15 public: | 15 public: |
| 16 NGConstraintSpaceBuilder(NGWritingMode writing_mode); | 16 NGConstraintSpaceBuilder(NGWritingMode writing_mode); |
| 17 | 17 |
| 18 NGConstraintSpaceBuilder& SetContainerSize(NGLogicalSize container_size); | 18 NGConstraintSpaceBuilder& SetContainerSize(NGLogicalSize container_size); |
| 19 NGConstraintSpaceBuilder& SetFixedSize(bool fixed_inline, bool fixed_block); | 19 |
| 20 NGConstraintSpaceBuilder& SetOverflowTriggersScrollbar( | 20 NGConstraintSpaceBuilder& SetIsFixedSizeInline(bool is_fixed_size_inline); |
| 21 bool inline_direction_triggers_scrollbar, | 21 NGConstraintSpaceBuilder& SetIsFixedSizeBlock(bool is_fixed_size_block); |
| 22 bool block_direction_triggers_scrollbar); | 22 |
| 23 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( |
| 24 bool is_inline_direction_triggers_scrollbar); |
| 25 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( |
| 26 bool is_block_direction_triggers_scrollbar); |
| 27 |
| 23 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); | 28 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); |
| 24 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); | 29 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); |
| 25 | 30 |
| 26 // Creates a new constraint space. This may be called multiple times, for | 31 // Creates a new constraint space. This may be called multiple times, for |
| 27 // example the constraint space will be different for a child which: | 32 // example the constraint space will be different for a child which: |
| 28 // - Establishes a new formatting context. | 33 // - Establishes a new formatting context. |
| 29 // - Is within a fragmentation container and needs its fragmentation offset | 34 // - Is within a fragmentation container and needs its fragmentation offset |
| 30 // updated. | 35 // updated. |
| 31 // - Has its size is determined by its parent layout (flex, abs-pos). | 36 // - Has its size is determined by its parent layout (flex, abs-pos). |
| 32 NGPhysicalConstraintSpace* ToConstraintSpace(); | 37 NGPhysicalConstraintSpace* ToConstraintSpace(); |
| 33 | 38 |
| 34 DEFINE_INLINE_TRACE() {} | 39 DEFINE_INLINE_TRACE() {} |
| 35 | 40 |
| 36 private: | 41 private: |
| 37 NGLogicalSize container_size_; | 42 NGLogicalSize container_size_; |
| 38 | 43 |
| 39 // const bit fields. | 44 // const bit fields. |
| 40 const unsigned writing_mode_ : 2; | 45 const unsigned writing_mode_ : 2; |
| 41 | 46 |
| 42 // mutable bit fields. | 47 // mutable bit fields. |
| 43 unsigned fixed_inline_ : 1; | 48 unsigned is_fixed_size_inline_ : 1; |
| 44 unsigned fixed_block_ : 1; | 49 unsigned is_fixed_size_block_ : 1; |
| 45 unsigned inline_direction_triggers_scrollbar_ : 1; | 50 unsigned is_inline_direction_triggers_scrollbar_ : 1; |
| 46 unsigned block_direction_triggers_scrollbar_ : 1; | 51 unsigned is_block_direction_triggers_scrollbar_ : 1; |
| 47 unsigned fragmentation_type_ : 2; | 52 unsigned fragmentation_type_ : 2; |
| 48 unsigned is_new_fc_ : 1; | 53 unsigned is_new_fc_ : 1; |
| 49 }; | 54 }; |
| 50 | 55 |
| 51 } // namespace blink | 56 } // namespace blink |
| 52 | 57 |
| 53 #endif // NGConstraintSpaceBuilder | 58 #endif // NGConstraintSpaceBuilder |
| OLD | NEW |