| 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 available_size, | 10 NGPhysicalSize available_size, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 height_direction_triggers_scrollbar_(height_direction_triggers_scrollbar), | 24 height_direction_triggers_scrollbar_(height_direction_triggers_scrollbar), |
| 25 width_direction_fragmentation_type_(width_direction_fragmentation_type), | 25 width_direction_fragmentation_type_(width_direction_fragmentation_type), |
| 26 height_direction_fragmentation_type_(height_direction_fragmentation_type), | 26 height_direction_fragmentation_type_(height_direction_fragmentation_type), |
| 27 is_new_fc_(is_new_fc), | 27 is_new_fc_(is_new_fc), |
| 28 last_left_float_exclusion_(nullptr), | 28 last_left_float_exclusion_(nullptr), |
| 29 last_right_float_exclusion_(nullptr) {} | 29 last_right_float_exclusion_(nullptr) {} |
| 30 | 30 |
| 31 void NGPhysicalConstraintSpace::AddExclusion(const NGExclusion& exclusion) { | 31 void NGPhysicalConstraintSpace::AddExclusion(const NGExclusion& exclusion) { |
| 32 NGExclusion* exclusion_ptr = new NGExclusion(exclusion); | 32 NGExclusion* exclusion_ptr = new NGExclusion(exclusion); |
| 33 exclusions_.append(WTF::wrapUnique(exclusion_ptr)); | 33 exclusions_.append(WTF::wrapUnique(exclusion_ptr)); |
| 34 if (exclusion.type == NGExclusion::NG_FLOAT_LEFT) { | 34 if (exclusion.type == NGExclusion::kFloatLeft) { |
| 35 last_left_float_exclusion_ = exclusions_.rbegin()->get(); | 35 last_left_float_exclusion_ = exclusions_.rbegin()->get(); |
| 36 } else if (exclusion.type == NGExclusion::NG_FLOAT_RIGHT) { | 36 } else if (exclusion.type == NGExclusion::kFloatRight) { |
| 37 last_right_float_exclusion_ = exclusions_.rbegin()->get(); | 37 last_right_float_exclusion_ = exclusions_.rbegin()->get(); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 const Vector<std::unique_ptr<const NGExclusion>>& | 41 const Vector<std::unique_ptr<const NGExclusion>>& |
| 42 NGPhysicalConstraintSpace::Exclusions(unsigned options) const { | 42 NGPhysicalConstraintSpace::Exclusions(unsigned options) const { |
| 43 // TODO(layout-ng): Filter based on options? Perhaps layout Opportunities | 43 // TODO(layout-ng): Filter based on options? Perhaps layout Opportunities |
| 44 // should filter instead? | 44 // should filter instead? |
| 45 return exclusions_; | 45 return exclusions_; |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace blink | 48 } // namespace blink |
| OLD | NEW |