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

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

Issue 2446243003: [LayoutNG] Add NGConstraintSpaceBuilder class. (Closed)
Patch Set: . Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h
new file mode 100644
index 0000000000000000000000000000000000000000..084a0f97baf327c9ccd9c7379c5c8ef489fa6bc2
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.h
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NGConstraintSpaceBuilder_h
+#define NGConstraintSpaceBuilder_h
+
+#include "core/layout/ng/ng_fragment.h"
+#include "core/layout/ng/ng_units.h"
+
+namespace blink {
+
+class CORE_EXPORT NGConstraintSpaceBuilder final
eae 2016/10/25 17:26:27 Should this be PhysicalConstraintSpaceBuilder? Als
ikilpatrick 2016/10/25 23:20:42 Can rename to that; was following ng_fragment_buil
ikilpatrick 2016/10/25 23:20:42 Right, yeah there are more cases than I originally
+ : public GarbageCollectedFinalized<NGConstraintSpaceBuilder> {
Gleb Lanbin 2016/10/25 17:37:27 .nit you don't have anything that needs to be fina
ikilpatrick 2016/10/25 23:20:42 Done.
+ public:
+ NGConstraintSpaceBuilder(NGWritingMode writing_mode);
+
+ NGConstraintSpaceBuilder& SetContainerSize(NGLogicalSize container_size);
+ NGConstraintSpaceBuilder& SetFixedSize(bool fixed_inline, bool fixed_block);
+ NGConstraintSpaceBuilder& SetOverflowTriggersScrollbar(
+ bool inline_direction_triggers_scrollbar,
+ bool block_direction_triggers_scrollbar);
+ NGConstraintSpaceBuilder& SetFragmentationType(NGFragmentationType);
Gleb Lanbin 2016/10/25 17:37:27 Can we use SetFragmentType here and have a TODO to
ikilpatrick 2016/10/25 23:20:42 FragmentationType and FragmentType are different,
+ NGConstraintSpaceBuilder& SetIsNewFormattingContext(bool is_new_fc);
+
+ // Creates a new constraint space. Can be called multiple times.
Gleb Lanbin 2016/10/25 17:37:27 can you provide a bit more details here about why
ikilpatrick 2016/10/25 23:20:42 Done.
+ NGPhysicalConstraintSpace* ToConstraintSpace();
+
+ DEFINE_INLINE_TRACE() {}
+
+ private:
+ NGLogicalSize container_size_;
+
+ unsigned writing_mode_ : 2;
Gleb Lanbin 2016/10/25 17:37:27 should we separate mutable fields from const field
ikilpatrick 2016/10/25 23:20:42 Done.
+ unsigned fixed_inline_ : 1;
+ unsigned fixed_block_ : 1;
+ unsigned inline_direction_triggers_scrollbar_ : 1;
+ unsigned block_direction_triggers_scrollbar_ : 1;
+ unsigned fragmentation_type_ : 2;
Gleb Lanbin 2016/10/25 17:37:27 .nit fragment_type_ ?
ikilpatrick 2016/10/25 23:20:42 See above.
+ unsigned is_new_fc_ : 1;
+};
+
+} // namespace blink
+
+#endif // NGConstraintSpaceBuilder

Powered by Google App Engine
This is Rietveld 408576698