| 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 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( | 37 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( |
| 38 bool is_inline_direction_triggers_scrollbar); | 38 bool is_inline_direction_triggers_scrollbar); |
| 39 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( | 39 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( |
| 40 bool is_block_direction_triggers_scrollbar); | 40 bool is_block_direction_triggers_scrollbar); |
| 41 | 41 |
| 42 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); | 42 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); |
| 43 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); | 43 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); |
| 44 | 44 |
| 45 NGConstraintSpaceBuilder& SetWritingMode(NGWritingMode writing_mode); | 45 NGConstraintSpaceBuilder& SetWritingMode(NGWritingMode writing_mode); |
| 46 | 46 |
| 47 NGConstraintSpaceBuilder& SetMarginStrut(const NGMarginStrut& margin_strut); |
| 48 |
| 49 NGConstraintSpaceBuilder& SetBfcOffset(const NGLogicalOffset& offset) { |
| 50 bfc_offset_ = offset; |
| 51 return *this; |
| 52 } |
| 53 |
| 47 // Creates a new constraint space. This may be called multiple times, for | 54 // Creates a new constraint space. This may be called multiple times, for |
| 48 // example the constraint space will be different for a child which: | 55 // example the constraint space will be different for a child which: |
| 49 // - Establishes a new formatting context. | 56 // - Establishes a new formatting context. |
| 50 // - Is within a fragmentation container and needs its fragmentation offset | 57 // - Is within a fragmentation container and needs its fragmentation offset |
| 51 // updated. | 58 // updated. |
| 52 // - Has its size is determined by its parent layout (flex, abs-pos). | 59 // - Has its size is determined by its parent layout (flex, abs-pos). |
| 53 NGConstraintSpace* ToConstraintSpace(); | 60 NGConstraintSpace* ToConstraintSpace(); |
| 54 | 61 |
| 55 DEFINE_INLINE_TRACE() {} | 62 DEFINE_INLINE_TRACE() {} |
| 56 | 63 |
| 57 private: | 64 private: |
| 58 NGLogicalSize available_size_; | 65 NGLogicalSize available_size_; |
| 59 NGLogicalSize percentage_resolution_size_; | 66 NGLogicalSize percentage_resolution_size_; |
| 60 LayoutUnit fragmentainer_space_available_; | 67 LayoutUnit fragmentainer_space_available_; |
| 61 | 68 |
| 62 unsigned writing_mode_ : 2; | 69 unsigned writing_mode_ : 2; |
| 63 unsigned parent_writing_mode_ : 2; | 70 unsigned parent_writing_mode_ : 2; |
| 64 unsigned is_fixed_size_inline_ : 1; | 71 unsigned is_fixed_size_inline_ : 1; |
| 65 unsigned is_fixed_size_block_ : 1; | 72 unsigned is_fixed_size_block_ : 1; |
| 66 unsigned is_shrink_to_fit_ : 1; | 73 unsigned is_shrink_to_fit_ : 1; |
| 67 unsigned is_inline_direction_triggers_scrollbar_ : 1; | 74 unsigned is_inline_direction_triggers_scrollbar_ : 1; |
| 68 unsigned is_block_direction_triggers_scrollbar_ : 1; | 75 unsigned is_block_direction_triggers_scrollbar_ : 1; |
| 69 unsigned fragmentation_type_ : 2; | 76 unsigned fragmentation_type_ : 2; |
| 70 unsigned is_new_fc_ : 1; | 77 unsigned is_new_fc_ : 1; |
| 71 unsigned text_direction_ : 1; | 78 unsigned text_direction_ : 1; |
| 72 | 79 |
| 80 NGMarginStrut margin_strut_; |
| 81 NGLogicalOffset bfc_offset_; |
| 73 std::shared_ptr<NGExclusions> exclusions_; | 82 std::shared_ptr<NGExclusions> exclusions_; |
| 74 }; | 83 }; |
| 75 | 84 |
| 76 } // namespace blink | 85 } // namespace blink |
| 77 | 86 |
| 78 #endif // NGConstraintSpaceBuilder | 87 #endif // NGConstraintSpaceBuilder |
| OLD | NEW |