1 // Copyright 2019 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_BOX_LAYOUT_EXTRA_INPUT_H_
6 #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_BOX_LAYOUT_EXTRA_INPUT_H_
7 
8 #include "base/optional.h"
9 #include "third_party/blink/renderer/platform/geometry/layout_unit.h"
10 
11 namespace blink {
12 
13 class LayoutBox;
14 
15 // Extra input data for laying out a LayoutBox. The object will automatically
16 // associate itself with the specified LayoutBox upon creation, and dissociate
17 // itself upon destruction.
18 struct BoxLayoutExtraInput {
19   BoxLayoutExtraInput(LayoutBox&);
20   ~BoxLayoutExtraInput();
21 
22   LayoutBox& box;
23 
24   // When set, no attempt should be be made to resolve the inline size. Use this
25   // one instead.
26   base::Optional<LayoutUnit> override_inline_size;
27 
28   // When set, no attempt should be be made to resolve the block size. Use this
29   // one instead.
30   base::Optional<LayoutUnit> override_block_size;
31 
32   // Available inline size. https://drafts.csswg.org/css-sizing/#available
33   LayoutUnit available_inline_size;
34 
35   // The content size of the containing block. These are somewhat vague legacy
36   // layout values, that typically either mean available size or percentage
37   // resolution size.
38   LayoutUnit containing_block_content_inline_size;
39   LayoutUnit containing_block_content_block_size;
40 };
41 
42 }  // namespace blink
43 
44 #endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_BOX_LAYOUT_EXTRA_INPUT_H_
45