| 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 NGPhysicalConstraintSpace_h | 5 #ifndef NGPhysicalConstraintSpace_h |
| 6 #define NGPhysicalConstraintSpace_h | 6 #define NGPhysicalConstraintSpace_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_units.h" | 9 #include "core/layout/ng/ng_units.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 FragmentPage, | 25 FragmentPage, |
| 26 FragmentColumn, | 26 FragmentColumn, |
| 27 FragmentRegion | 27 FragmentRegion |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 struct NGExclusion : public GarbageCollected<NGExclusion> { | 30 struct NGExclusion : public GarbageCollected<NGExclusion> { |
| 31 NGExclusion(LayoutUnit top, | 31 NGExclusion(LayoutUnit top, |
| 32 LayoutUnit right, | 32 LayoutUnit right, |
| 33 LayoutUnit bottom, | 33 LayoutUnit bottom, |
| 34 LayoutUnit left) { | 34 LayoutUnit left) { |
| 35 rect.location.left = left; | 35 rect.offset.left = left; |
| 36 rect.location.top = top; | 36 rect.offset.top = top; |
| 37 rect.size.width = right - left; | 37 rect.size.width = right - left; |
| 38 rect.size.height = bottom - top; | 38 rect.size.height = bottom - top; |
| 39 } | 39 } |
| 40 LayoutUnit Top() const { return rect.location.top; } | 40 LayoutUnit Top() const { return rect.offset.top; } |
| 41 LayoutUnit Right() const { return rect.size.width + rect.location.left; } | 41 LayoutUnit Right() const { return rect.size.width + rect.offset.left; } |
| 42 LayoutUnit Bottom() const { return rect.size.height + rect.location.top; } | 42 LayoutUnit Bottom() const { return rect.size.height + rect.offset.top; } |
| 43 LayoutUnit Left() const { return rect.location.left; } | 43 LayoutUnit Left() const { return rect.offset.left; } |
| 44 | 44 |
| 45 String ToString() const { | 45 String ToString() const { |
| 46 return String::format("%s,%s %sx%s", | 46 return String::format("%s,%s %sx%s", |
| 47 rect.location.left.toString().ascii().data(), | 47 rect.offset.left.toString().ascii().data(), |
| 48 rect.location.top.toString().ascii().data(), | 48 rect.offset.top.toString().ascii().data(), |
| 49 rect.size.width.toString().ascii().data(), | 49 rect.size.width.toString().ascii().data(), |
| 50 rect.size.height.toString().ascii().data()); | 50 rect.size.height.toString().ascii().data()); |
| 51 } | 51 } |
| 52 NGPhysicalRect rect; | 52 NGPhysicalRect rect; |
| 53 | 53 |
| 54 DEFINE_INLINE_TRACE() {} | 54 DEFINE_INLINE_TRACE() {} |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // The NGPhysicalConstraintSpace contains the underlying data for the | 57 // The NGPhysicalConstraintSpace contains the underlying data for the |
| 58 // NGConstraintSpace. It is not meant to be used directly as all members are in | 58 // NGConstraintSpace. It is not meant to be used directly as all members are in |
| (...skipping 27 matching lines...) Expand all Loading... |
| 86 // Whether the current constraint space is for the newly established | 86 // Whether the current constraint space is for the newly established |
| 87 // formatting Context | 87 // formatting Context |
| 88 unsigned is_new_fc_ : 1; | 88 unsigned is_new_fc_ : 1; |
| 89 | 89 |
| 90 HeapVector<Member<const NGExclusion>> exclusions_; | 90 HeapVector<Member<const NGExclusion>> exclusions_; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| 94 | 94 |
| 95 #endif // NGPhysicalConstraintSpace_h | 95 #endif // NGPhysicalConstraintSpace_h |
| OLD | NEW |