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 #include "core/layout/ng/ng_physical_constraint_space.h" | 5 #include "core/layout/ng/ng_physical_constraint_space.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace( | 9 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace( |
10 NGPhysicalSize container_size, | 10 NGPhysicalSize container_size, |
11 bool fixed_width, | 11 bool fixed_width, |
12 bool fixed_height, | 12 bool fixed_height, |
13 bool width_direction_triggers_scrollbar, | 13 bool width_direction_triggers_scrollbar, |
14 bool height_direction_triggers_scrollbar, | 14 bool height_direction_triggers_scrollbar, |
15 NGFragmentationType width_direction_fragmentation_type, | 15 NGFragmentationType width_direction_fragmentation_type, |
16 NGFragmentationType height_direction_fragmentation_type, | 16 NGFragmentationType height_direction_fragmentation_type, |
17 bool is_new_fc) | 17 bool is_new_fc) |
18 : container_size_(container_size), | 18 : container_size_(container_size), |
19 fixed_width_(fixed_width), | 19 fixed_width_(fixed_width), |
20 fixed_height_(fixed_height), | 20 fixed_height_(fixed_height), |
21 width_direction_triggers_scrollbar_(width_direction_triggers_scrollbar), | 21 width_direction_triggers_scrollbar_(width_direction_triggers_scrollbar), |
22 height_direction_triggers_scrollbar_(height_direction_triggers_scrollbar), | 22 height_direction_triggers_scrollbar_(height_direction_triggers_scrollbar), |
23 width_direction_fragmentation_type_(width_direction_fragmentation_type), | 23 width_direction_fragmentation_type_(width_direction_fragmentation_type), |
24 height_direction_fragmentation_type_(height_direction_fragmentation_type), | 24 height_direction_fragmentation_type_(height_direction_fragmentation_type), |
25 is_new_fc_(is_new_fc) {} | 25 is_new_fc_(is_new_fc) {} |
26 | 26 |
27 void NGPhysicalConstraintSpace::AddExclusion(const NGExclusion* exclusion, | 27 void NGPhysicalConstraintSpace::AddExclusion(const NGLogicalRect& exclusion, |
28 unsigned options) { | 28 unsigned options) { |
29 exclusions_.append(exclusion); | 29 NGLogicalRect* exclusion_ptr = new NGLogicalRect(exclusion); |
| 30 exclusions_.append(WTF::wrapUnique(exclusion_ptr)); |
30 } | 31 } |
31 | 32 |
32 const HeapVector<Member<const NGExclusion>>& | 33 const Vector<std::unique_ptr<const NGLogicalRect>>& |
33 NGPhysicalConstraintSpace::Exclusions(unsigned options) const { | 34 NGPhysicalConstraintSpace::Exclusions(unsigned options) const { |
34 // TODO(layout-ng): Filter based on options? Perhaps layout Opportunities | 35 // TODO(layout-ng): Filter based on options? Perhaps layout Opportunities |
35 // should filter instead? | 36 // should filter instead? |
36 return exclusions_; | 37 return exclusions_; |
37 } | 38 } |
38 | 39 |
39 } // namespace blink | 40 } // namespace blink |
OLD | NEW |