Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h

Issue 2525033002: Deprecate NGPhysicalConstraintSpace (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 GarbageCollectedFinalized<NGConstraintSpaceBuilder> {
15 public: 15 public:
16 NGConstraintSpaceBuilder(const NGConstraintSpace* parent_space);
17
16 NGConstraintSpaceBuilder(NGWritingMode writing_mode); 18 NGConstraintSpaceBuilder(NGWritingMode writing_mode);
17 19
18 NGConstraintSpaceBuilder& SetAvailableSize(NGLogicalSize available_size); 20 NGConstraintSpaceBuilder& SetAvailableSize(NGLogicalSize available_size);
19 21
20 NGConstraintSpaceBuilder& SetPercentageResolutionSize( 22 NGConstraintSpaceBuilder& SetPercentageResolutionSize(
21 NGLogicalSize percentage_resolution_size); 23 NGLogicalSize percentage_resolution_size);
22 24
25 NGConstraintSpaceBuilder& SetTextDirection(TextDirection);
26
23 NGConstraintSpaceBuilder& SetIsFixedSizeInline(bool is_fixed_size_inline); 27 NGConstraintSpaceBuilder& SetIsFixedSizeInline(bool is_fixed_size_inline);
24 NGConstraintSpaceBuilder& SetIsFixedSizeBlock(bool is_fixed_size_block); 28 NGConstraintSpaceBuilder& SetIsFixedSizeBlock(bool is_fixed_size_block);
25 29
26 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar( 30 NGConstraintSpaceBuilder& SetIsInlineDirectionTriggersScrollbar(
27 bool is_inline_direction_triggers_scrollbar); 31 bool is_inline_direction_triggers_scrollbar);
28 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar( 32 NGConstraintSpaceBuilder& SetIsBlockDirectionTriggersScrollbar(
29 bool is_block_direction_triggers_scrollbar); 33 bool is_block_direction_triggers_scrollbar);
30 34
31 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType); 35 NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType);
32 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc); 36 NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc);
33 37
38 NGConstraintSpaceBuilder& SetWritingMode(WritingMode writing_mode) {
39 writing_mode_ = writing_mode;
40 return *this;
41 }
ikilpatrick 2016/11/23 17:40:38 .nit nl below this?
Gleb Lanbin 2016/11/23 18:59:50 Done.
34 // Creates a new constraint space. This may be called multiple times, for 42 // Creates a new constraint space. This may be called multiple times, for
35 // example the constraint space will be different for a child which: 43 // example the constraint space will be different for a child which:
36 // - Establishes a new formatting context. 44 // - Establishes a new formatting context.
37 // - Is within a fragmentation container and needs its fragmentation offset 45 // - Is within a fragmentation container and needs its fragmentation offset
38 // updated. 46 // updated.
39 // - Has its size is determined by its parent layout (flex, abs-pos). 47 // - Has its size is determined by its parent layout (flex, abs-pos).
40 NGPhysicalConstraintSpace* ToConstraintSpace(); 48 NGConstraintSpace* ToConstraintSpace();
41 49
42 DEFINE_INLINE_TRACE() {} 50 DEFINE_INLINE_TRACE() {}
43 51
44 private: 52 private:
45 NGLogicalSize available_size_; 53 NGLogicalSize available_size_;
46 NGLogicalSize percentage_resolution_size_; 54 NGLogicalSize percentage_resolution_size_;
47 55
48 // const bit fields. 56 // const bit fields.
ikilpatrick 2016/11/23 17:40:38 remove this comment now?
Gleb Lanbin 2016/11/23 18:59:50 Done.
49 const unsigned writing_mode_ : 2; 57 unsigned writing_mode_ : 2;
50 58
51 // mutable bit fields. 59 // mutable bit fields.
52 unsigned is_fixed_size_inline_ : 1; 60 unsigned is_fixed_size_inline_ : 1;
53 unsigned is_fixed_size_block_ : 1; 61 unsigned is_fixed_size_block_ : 1;
54 unsigned is_inline_direction_triggers_scrollbar_ : 1; 62 unsigned is_inline_direction_triggers_scrollbar_ : 1;
55 unsigned is_block_direction_triggers_scrollbar_ : 1; 63 unsigned is_block_direction_triggers_scrollbar_ : 1;
56 unsigned fragmentation_type_ : 2; 64 unsigned fragmentation_type_ : 2;
57 unsigned is_new_fc_ : 1; 65 unsigned is_new_fc_ : 1;
66 unsigned text_direction_ : 1;
67
68 std::shared_ptr<NGExclusions> exclusions_;
58 }; 69 };
59 70
60 } // namespace blink 71 } // namespace blink
61 72
62 #endif // NGConstraintSpaceBuilder 73 #endif // NGConstraintSpaceBuilder
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698