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 NGFloatingObject_h | 5 #ifndef NGFloatingObject_h |
6 #define NGFloatingObject_h | 6 #define NGFloatingObject_h |
7 | 7 |
8 #include "core/layout/ng/geometry/ng_box_strut.h" | 8 #include "core/layout/ng/geometry/ng_box_strut.h" |
9 #include "core/layout/ng/ng_block_node.h" | 9 #include "core/layout/ng/ng_block_node.h" |
10 #include "core/layout/ng/ng_constraint_space.h" | 10 #include "core/layout/ng/ng_constraint_space.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 | 43 |
44 // In the case where a legacy FloatingObject is attached to not its own | 44 // In the case where a legacy FloatingObject is attached to not its own |
45 // parent, e.g. a float surrounded by a bunch of nested empty divs, | 45 // parent, e.g. a float surrounded by a bunch of nested empty divs, |
46 // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's | 46 // NG float fragment's LeftOffset() cannot be used as legacy FloatingObject's |
47 // left offset because that offset should be relative to the original float | 47 // left offset because that offset should be relative to the original float |
48 // parent. | 48 // parent. |
49 // {@code left_offset} is calculated when we know to which parent this float | 49 // {@code left_offset} is calculated when we know to which parent this float |
50 // would be attached. | 50 // would be attached. |
51 LayoutUnit left_offset; | 51 LayoutUnit left_offset; |
52 | 52 |
53 String ToString() const { | |
ikilpatrick
2017/03/17 21:25:24
I know we haven't done this previously but we shou
| |
54 return String::format("Type: '%d' Fragment: '%s'", exclusion_type, | |
55 fragment->ToString().ascii().data()); | |
56 } | |
57 | |
53 private: | 58 private: |
54 NGFloatingObject(const NGConstraintSpace* space, | 59 NGFloatingObject(const NGConstraintSpace* space, |
55 const NGConstraintSpace* parent_space, | 60 const NGConstraintSpace* parent_space, |
56 const ComputedStyle& style, | 61 const ComputedStyle& style, |
57 const NGBoxStrut& margins, | 62 const NGBoxStrut& margins, |
58 NGPhysicalFragment* fragment) | 63 NGPhysicalFragment* fragment) |
59 : space(space), | 64 : space(space), |
60 original_parent_space(parent_space), | 65 original_parent_space(parent_space), |
61 margins(margins), | 66 margins(margins), |
62 fragment(fragment) { | 67 fragment(fragment) { |
63 exclusion_type = NGExclusion::kFloatLeft; | 68 exclusion_type = NGExclusion::kFloatLeft; |
64 if (style.floating() == EFloat::kRight) | 69 if (style.floating() == EFloat::kRight) |
65 exclusion_type = NGExclusion::kFloatRight; | 70 exclusion_type = NGExclusion::kFloatRight; |
66 clear_type = style.clear(); | 71 clear_type = style.clear(); |
67 } | 72 } |
68 }; | 73 }; |
69 | 74 |
70 } // namespace blink | 75 } // namespace blink |
71 | 76 |
72 #endif // NGFloatingObject_h | 77 #endif // NGFloatingObject_h |
OLD | NEW |