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 #include "wtf/Optional.h" |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class CORE_EXPORT NGConstraintSpaceBuilder final | 14 class CORE_EXPORT NGConstraintSpaceBuilder final |
14 : public GarbageCollectedFinalized<NGConstraintSpaceBuilder> { | 15 : public GarbageCollectedFinalized<NGConstraintSpaceBuilder> { |
15 public: | 16 public: |
16 NGConstraintSpaceBuilder(const NGConstraintSpace* parent_space); | 17 NGConstraintSpaceBuilder(const NGConstraintSpace* parent_space); |
17 | 18 |
18 NGConstraintSpaceBuilder(NGWritingMode writing_mode); | 19 NGConstraintSpaceBuilder(NGWritingMode writing_mode); |
19 | 20 |
(...skipping 19 matching lines...) Expand all Loading... |
39 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( | 40 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( |
40 bool is_inline_direction_triggers_scrollbar); | 41 bool is_inline_direction_triggers_scrollbar); |
41 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( | 42 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( |
42 bool is_block_direction_triggers_scrollbar); | 43 bool is_block_direction_triggers_scrollbar); |
43 | 44 |
44 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); | 45 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); |
45 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); | 46 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); |
46 | 47 |
47 NGConstraintSpaceBuilder& SetMarginStrut(const NGMarginStrut& margin_strut); | 48 NGConstraintSpaceBuilder& SetMarginStrut(const NGMarginStrut& margin_strut); |
48 | 49 |
49 NGConstraintSpaceBuilder& SetBfcOffset(const NGLogicalOffset& offset) { | 50 NGConstraintSpaceBuilder& SetBfcOffset(const NGLogicalOffset& offset); |
50 bfc_offset_ = offset; | 51 |
51 return *this; | 52 NGConstraintSpaceBuilder& SetClearanceOffset( |
52 } | 53 const WTF::Optional<LayoutUnit>& clearance_offset); |
53 | 54 |
54 // Creates a new constraint space. This may be called multiple times, for | 55 // Creates a new constraint space. This may be called multiple times, for |
55 // example the constraint space will be different for a child which: | 56 // example the constraint space will be different for a child which: |
56 // - Establishes a new formatting context. | 57 // - Establishes a new formatting context. |
57 // - Is within a fragmentation container and needs its fragmentation offset | 58 // - Is within a fragmentation container and needs its fragmentation offset |
58 // updated. | 59 // updated. |
59 // - Has its size is determined by its parent layout (flex, abs-pos). | 60 // - Has its size is determined by its parent layout (flex, abs-pos). |
60 // | 61 // |
61 // NGWritingMode specifies the writing mode of the generated space. | 62 // NGWritingMode specifies the writing mode of the generated space. |
62 NGConstraintSpace* ToConstraintSpace(NGWritingMode); | 63 NGConstraintSpace* ToConstraintSpace(NGWritingMode); |
(...skipping 14 matching lines...) Expand all Loading... |
77 unsigned is_shrink_to_fit_ : 1; | 78 unsigned is_shrink_to_fit_ : 1; |
78 unsigned is_inline_direction_triggers_scrollbar_ : 1; | 79 unsigned is_inline_direction_triggers_scrollbar_ : 1; |
79 unsigned is_block_direction_triggers_scrollbar_ : 1; | 80 unsigned is_block_direction_triggers_scrollbar_ : 1; |
80 unsigned fragmentation_type_ : 2; | 81 unsigned fragmentation_type_ : 2; |
81 unsigned is_new_fc_ : 1; | 82 unsigned is_new_fc_ : 1; |
82 unsigned text_direction_ : 1; | 83 unsigned text_direction_ : 1; |
83 | 84 |
84 NGMarginStrut margin_strut_; | 85 NGMarginStrut margin_strut_; |
85 NGLogicalOffset bfc_offset_; | 86 NGLogicalOffset bfc_offset_; |
86 std::shared_ptr<NGExclusions> exclusions_; | 87 std::shared_ptr<NGExclusions> exclusions_; |
| 88 WTF::Optional<LayoutUnit> clearance_offset_; |
87 }; | 89 }; |
88 | 90 |
89 } // namespace blink | 91 } // namespace blink |
90 | 92 |
91 #endif // NGConstraintSpaceBuilder | 93 #endif // NGConstraintSpaceBuilder |
OLD | NEW |