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 NGPhysicalBoxFragment_h | 5 #ifndef NGPhysicalBoxFragment_h |
6 #define NGPhysicalBoxFragment_h | 6 #define NGPhysicalBoxFragment_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/geometry/ng_logical_offset.h" | 9 #include "core/layout/ng/geometry/ng_logical_offset.h" |
10 #include "core/layout/ng/geometry/ng_margin_strut.h" | 10 #include "core/layout/ng/geometry/ng_margin_strut.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // This modifies the passed-in children vector. | 21 // This modifies the passed-in children vector. |
22 NGPhysicalBoxFragment(LayoutObject* layout_object, | 22 NGPhysicalBoxFragment(LayoutObject* layout_object, |
23 NGPhysicalSize size, | 23 NGPhysicalSize size, |
24 NGPhysicalSize overflow, | 24 NGPhysicalSize overflow, |
25 Vector<RefPtr<NGPhysicalFragment>>& children, | 25 Vector<RefPtr<NGPhysicalFragment>>& children, |
26 Vector<RefPtr<NGFloatingObject>>& positioned_floats, | 26 Vector<RefPtr<NGFloatingObject>>& positioned_floats, |
27 const WTF::Optional<NGLogicalOffset>& bfc_offset, | 27 const WTF::Optional<NGLogicalOffset>& bfc_offset, |
28 const NGMarginStrut& end_margin_strut, | 28 const NGMarginStrut& end_margin_strut, |
29 RefPtr<NGBreakToken> break_token = nullptr); | 29 RefPtr<NGBreakToken> break_token = nullptr); |
30 | 30 |
| 31 // Returns the total size, including the contents outside of the border-box. |
| 32 LayoutUnit WidthOverflow() const { return overflow_.width; } |
| 33 LayoutUnit HeightOverflow() const { return overflow_.height; } |
| 34 |
31 const Vector<RefPtr<NGPhysicalFragment>>& Children() const { | 35 const Vector<RefPtr<NGPhysicalFragment>>& Children() const { |
32 return children_; | 36 return children_; |
33 } | 37 } |
34 | 38 |
35 // List of positioned floats that need to be copied to the old layout tree. | 39 // List of positioned floats that need to be copied to the old layout tree. |
36 // TODO(layout-ng): remove this once we change painting code to handle floats | 40 // TODO(layout-ng): remove this once we change painting code to handle floats |
37 // differently. | 41 // differently. |
38 const Vector<RefPtr<NGFloatingObject>>& PositionedFloats() const { | 42 const Vector<RefPtr<NGFloatingObject>>& PositionedFloats() const { |
39 return positioned_floats_; | 43 return positioned_floats_; |
40 } | 44 } |
41 | 45 |
42 const WTF::Optional<NGLogicalOffset>& BfcOffset() const { | 46 const WTF::Optional<NGLogicalOffset>& BfcOffset() const { |
43 return bfc_offset_; | 47 return bfc_offset_; |
44 } | 48 } |
45 | 49 |
46 const NGMarginStrut& EndMarginStrut() const { return end_margin_strut_; } | 50 const NGMarginStrut& EndMarginStrut() const { return end_margin_strut_; } |
47 | 51 |
48 private: | 52 private: |
| 53 NGPhysicalSize overflow_; |
49 Vector<RefPtr<NGPhysicalFragment>> children_; | 54 Vector<RefPtr<NGPhysicalFragment>> children_; |
50 Vector<RefPtr<NGFloatingObject>> positioned_floats_; | 55 Vector<RefPtr<NGFloatingObject>> positioned_floats_; |
51 const WTF::Optional<NGLogicalOffset> bfc_offset_; | 56 const WTF::Optional<NGLogicalOffset> bfc_offset_; |
52 const NGMarginStrut end_margin_strut_; | 57 const NGMarginStrut end_margin_strut_; |
53 }; | 58 }; |
54 | 59 |
55 DEFINE_TYPE_CASTS(NGPhysicalBoxFragment, | 60 DEFINE_TYPE_CASTS(NGPhysicalBoxFragment, |
56 NGPhysicalFragment, | 61 NGPhysicalFragment, |
57 fragment, | 62 fragment, |
58 fragment->Type() == NGPhysicalFragment::kFragmentBox, | 63 fragment->Type() == NGPhysicalFragment::kFragmentBox, |
59 fragment.Type() == NGPhysicalFragment::kFragmentBox); | 64 fragment.Type() == NGPhysicalFragment::kFragmentBox); |
60 | 65 |
61 } // namespace blink | 66 } // namespace blink |
62 | 67 |
63 #endif // NGPhysicalBoxFragment_h | 68 #endif // NGPhysicalBoxFragment_h |
OLD | NEW |