| 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_constraint_space.h" | 5 #include "core/layout/ng/ng_constraint_space.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/layout/ng/ng_constraint_space.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
| 10 #include "core/layout/ng/ng_constraint_space_builder.h" | 10 #include "core/layout/ng/ng_constraint_space_builder.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 .SetIsFixedSizeInline(fixed_inline) | 63 .SetIsFixedSizeInline(fixed_inline) |
| 64 .SetIsFixedSizeBlock(fixed_block) | 64 .SetIsFixedSizeBlock(fixed_block) |
| 65 .SetIsNewFormattingContext(is_new_fc); | 65 .SetIsNewFormattingContext(is_new_fc); |
| 66 | 66 |
| 67 return new NGConstraintSpace( | 67 return new NGConstraintSpace( |
| 68 FromPlatformWritingMode(box.styleRef().getWritingMode()), | 68 FromPlatformWritingMode(box.styleRef().getWritingMode()), |
| 69 FromPlatformDirection(box.styleRef().direction()), | 69 FromPlatformDirection(box.styleRef().direction()), |
| 70 builder.ToConstraintSpace()); | 70 builder.ToConstraintSpace()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void NGConstraintSpace::AddExclusion(const NGLogicalRect& exclusion) const { | 73 void NGConstraintSpace::AddExclusion(const NGExclusion* exclusion) const { |
| 74 WRITING_MODE_IGNORED( | |
| 75 "Exclusions are stored directly in physical constraint space."); | |
| 76 MutablePhysicalSpace()->AddExclusion(exclusion); | 74 MutablePhysicalSpace()->AddExclusion(exclusion); |
| 77 } | 75 } |
| 78 | 76 |
| 79 NGLogicalSize NGConstraintSpace::ContainerSize() const { | 77 NGLogicalSize NGConstraintSpace::ContainerSize() const { |
| 80 return physical_space_->container_size_.ConvertToLogical( | 78 return physical_space_->container_size_.ConvertToLogical( |
| 81 static_cast<NGWritingMode>(writing_mode_)); | 79 static_cast<NGWritingMode>(writing_mode_)); |
| 82 } | 80 } |
| 83 | 81 |
| 84 void NGConstraintSpace::SetSize(NGLogicalSize size) { | 82 void NGConstraintSpace::SetSize(NGLogicalSize size) { |
| 85 size_ = size; | 83 size_ = size; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 168 |
| 171 String NGConstraintSpace::ToString() const { | 169 String NGConstraintSpace::ToString() const { |
| 172 return String::format("%s,%s %sx%s", | 170 return String::format("%s,%s %sx%s", |
| 173 offset_.inline_offset.toString().ascii().data(), | 171 offset_.inline_offset.toString().ascii().data(), |
| 174 offset_.block_offset.toString().ascii().data(), | 172 offset_.block_offset.toString().ascii().data(), |
| 175 size_.inline_size.toString().ascii().data(), | 173 size_.inline_size.toString().ascii().data(), |
| 176 size_.block_size.toString().ascii().data()); | 174 size_.block_size.toString().ascii().data()); |
| 177 } | 175 } |
| 178 | 176 |
| 179 } // namespace blink | 177 } // namespace blink |
| OLD | NEW |