Index: third_party/WebKit/Source/core/layout/ng/ng_box.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.h b/third_party/WebKit/Source/core/layout/ng/ng_box.h |
index a402ad24c2b1cde35a50da3d5d4b05ffe32b9f1e..1292b2d9975d1acfc5cd902c20524591392eb718 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.h |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.h |
@@ -13,10 +13,11 @@ namespace blink { |
class ComputedStyle; |
class LayoutBox; |
class LayoutObject; |
-class NGBlockLayoutAlgorithm; |
class NGConstraintSpace; |
class NGFragment; |
+class NGLayoutAlgorithm; |
class NGPhysicalFragment; |
+struct MinAndMaxContentSizes; |
// Represents a node to be laid out. |
class CORE_EXPORT NGBox final : public GarbageCollectedFinalized<NGBox> { |
@@ -32,6 +33,18 @@ class CORE_EXPORT NGBox final : public GarbageCollectedFinalized<NGBox> { |
// TODO(layout-ng): Should we have a StartLayout function to avoid passing |
// the same space for each Layout iteration? |
bool Layout(const NGConstraintSpace*, NGFragment**); |
+ |
+ // Computes the value of min-content and max-content for this box. |
+ // The return value has the same meaning as for Layout. |
+ // If the underlying layout algorithm returns NotImplemented from |
+ // ComputeMinAndMaxContentSizes, this function will synthesize these sizes |
+ // using Layout with special constraint spaces. |
+ // It is not legal to interleave a pending Layout() with a pending |
+ // ComputeOrSynthesizeMinAndMaxContentSizes (i.e. you have to call Layout |
+ // often enough that it returns true before calling |
+ // ComputeOrSynthesizeMinAndMaxContentSizes) |
+ bool ComputeMinAndMaxContentSizes(MinAndMaxContentSizes*); |
+ |
const ComputedStyle* Style() const; |
NGBox* NextSibling(); |
@@ -41,12 +54,7 @@ class CORE_EXPORT NGBox final : public GarbageCollectedFinalized<NGBox> { |
void SetNextSibling(NGBox*); |
void SetFirstChild(NGBox*); |
- DEFINE_INLINE_VIRTUAL_TRACE() { |
- visitor->trace(algorithm_); |
- visitor->trace(fragment_); |
- visitor->trace(next_sibling_); |
- visitor->trace(first_child_); |
- } |
+ DECLARE_VIRTUAL_TRACE(); |
private: |
// This is necessary for interop between old and new trees -- after our parent |
@@ -70,7 +78,8 @@ class CORE_EXPORT NGBox final : public GarbageCollectedFinalized<NGBox> { |
RefPtr<ComputedStyle> style_; |
Member<NGBox> next_sibling_; |
Member<NGBox> first_child_; |
- Member<NGBlockLayoutAlgorithm> algorithm_; |
+ Member<NGLayoutAlgorithm> layout_algorithm_; |
+ Member<NGLayoutAlgorithm> minmax_algorithm_; |
Member<NGPhysicalFragment> fragment_; |
}; |