Chromium Code Reviews| 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 #include "core/layout/ng/ptr_util.h" | |
| 6 | 7 |
| 7 namespace blink { | 8 namespace blink { |
| 8 | 9 |
| 9 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace( | 10 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace( |
| 10 NGPhysicalSize container_size, | 11 NGPhysicalSize container_size, |
| 11 bool fixed_width, | 12 bool fixed_width, |
| 12 bool fixed_height, | 13 bool fixed_height, |
| 13 bool width_direction_triggers_scrollbar, | 14 bool width_direction_triggers_scrollbar, |
| 14 bool height_direction_triggers_scrollbar, | 15 bool height_direction_triggers_scrollbar, |
| 15 NGFragmentationType width_direction_fragmentation_type, | 16 NGFragmentationType width_direction_fragmentation_type, |
| 16 NGFragmentationType height_direction_fragmentation_type, | 17 NGFragmentationType height_direction_fragmentation_type, |
| 17 bool is_new_fc) | 18 bool is_new_fc) |
| 18 : container_size_(container_size), | 19 : container_size_(container_size), |
| 19 fixed_width_(fixed_width), | 20 fixed_width_(fixed_width), |
| 20 fixed_height_(fixed_height), | 21 fixed_height_(fixed_height), |
| 21 width_direction_triggers_scrollbar_(width_direction_triggers_scrollbar), | 22 width_direction_triggers_scrollbar_(width_direction_triggers_scrollbar), |
| 22 height_direction_triggers_scrollbar_(height_direction_triggers_scrollbar), | 23 height_direction_triggers_scrollbar_(height_direction_triggers_scrollbar), |
| 23 width_direction_fragmentation_type_(width_direction_fragmentation_type), | 24 width_direction_fragmentation_type_(width_direction_fragmentation_type), |
| 24 height_direction_fragmentation_type_(height_direction_fragmentation_type), | 25 height_direction_fragmentation_type_(height_direction_fragmentation_type), |
| 25 is_new_fc_(is_new_fc) {} | 26 is_new_fc_(is_new_fc) {} |
| 26 | 27 |
| 27 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace( | 28 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace( |
| 28 NGPhysicalSize container_size) | 29 NGPhysicalSize container_size) |
| 29 : container_size_(container_size), | 30 : container_size_(container_size), |
| 30 fixed_width_(0), | 31 fixed_width_(0), |
| 31 fixed_height_(0), | 32 fixed_height_(0), |
| 32 width_direction_triggers_scrollbar_(0), | 33 width_direction_triggers_scrollbar_(0), |
| 33 height_direction_triggers_scrollbar_(0), | 34 height_direction_triggers_scrollbar_(0), |
| 34 width_direction_fragmentation_type_(FragmentNone), | 35 width_direction_fragmentation_type_(FragmentNone), |
| 35 height_direction_fragmentation_type_(FragmentNone) {} | 36 height_direction_fragmentation_type_(FragmentNone), |
| 37 is_new_fc_(0) {} | |
| 36 | 38 |
| 37 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace() | 39 NGPhysicalConstraintSpace::NGPhysicalConstraintSpace() |
| 38 : fixed_width_(0), | 40 : fixed_width_(0), |
| 39 fixed_height_(0), | 41 fixed_height_(0), |
| 40 width_direction_triggers_scrollbar_(0), | 42 width_direction_triggers_scrollbar_(0), |
| 41 height_direction_triggers_scrollbar_(0), | 43 height_direction_triggers_scrollbar_(0), |
| 42 width_direction_fragmentation_type_(FragmentNone), | 44 width_direction_fragmentation_type_(FragmentNone), |
| 43 height_direction_fragmentation_type_(FragmentNone) {} | 45 height_direction_fragmentation_type_(FragmentNone), |
| 46 is_new_fc_(0) {} | |
| 44 | 47 |
| 45 void NGPhysicalConstraintSpace::AddExclusion(const NGExclusion* exclusion, | 48 void NGPhysicalConstraintSpace::AddExclusion(const NGLogicalRect& exclusion, |
| 46 unsigned options) { | 49 unsigned options) { |
| 47 exclusions_.append(exclusion); | 50 exclusions_.append(MakeUnique<const NGLogicalRect>(exclusion)); |
|
ikilpatrick
2016/10/31 21:36:08
util the wtf ptr_util goes through can we just to
Gleb Lanbin
2016/10/31 23:08:18
Done.
| |
| 48 } | 51 } |
| 49 | 52 |
| 50 const HeapVector<Member<const NGExclusion>>& | 53 const Vector<std::unique_ptr<const NGLogicalRect>>& |
| 51 NGPhysicalConstraintSpace::Exclusions(unsigned options) const { | 54 NGPhysicalConstraintSpace::Exclusions(unsigned options) const { |
| 52 // TODO(layout-ng): Filter based on options? Perhaps layout Opportunities | 55 // TODO(layout-ng): Filter based on options? Perhaps layout Opportunities |
| 53 // should filter instead? | 56 // should filter instead? |
| 54 return exclusions_; | 57 return exclusions_; |
| 55 } | 58 } |
| 56 | 59 |
| 57 } // namespace blink | 60 } // namespace blink |
| OLD | NEW |