| 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_box.h" | 5 #include "core/layout/ng/ng_box.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBlockFlow.h" | 7 #include "core/layout/LayoutBlockFlow.h" |
| 8 #include "core/layout/ng/layout_ng_block_flow.h" | 8 #include "core/layout/ng/layout_ng_block_flow.h" |
| 9 #include "core/layout/ng/ng_block_layout_algorithm.h" | 9 #include "core/layout/ng/ng_block_layout_algorithm.h" |
| 10 #include "core/layout/ng/ng_constraint_space.h" | 10 #include "core/layout/ng/ng_constraint_space.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 const LayoutBlockFlow* block_flow = toLayoutBlockFlow(layout_box_); | 118 const LayoutBlockFlow* block_flow = toLayoutBlockFlow(layout_box_); |
| 119 return !block_flow->childrenInline() || !block_flow->firstChild(); | 119 return !block_flow->childrenInline() || !block_flow->firstChild(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void NGBox::CopyFragmentDataToLayoutBox( | 122 void NGBox::CopyFragmentDataToLayoutBox( |
| 123 const NGConstraintSpace& constraint_space) { | 123 const NGConstraintSpace& constraint_space) { |
| 124 DCHECK(layout_box_); | 124 DCHECK(layout_box_); |
| 125 layout_box_->setWidth(fragment_->Width()); | 125 layout_box_->setWidth(fragment_->Width()); |
| 126 layout_box_->setHeight(fragment_->Height()); | 126 layout_box_->setHeight(fragment_->Height()); |
| 127 NGBoxStrut border_and_padding = | 127 NGBoxStrut border_and_padding = |
| 128 computeBorders(*Style()) + computePadding(constraint_space, *Style()); | 128 ComputeBorders(*Style()) + ComputePadding(constraint_space, *Style()); |
| 129 LayoutUnit intrinsic_logical_height = | 129 LayoutUnit intrinsic_logical_height = |
| 130 layout_box_->style()->isHorizontalWritingMode() | 130 layout_box_->style()->isHorizontalWritingMode() |
| 131 ? fragment_->HeightOverflow() | 131 ? fragment_->HeightOverflow() |
| 132 : fragment_->WidthOverflow(); | 132 : fragment_->WidthOverflow(); |
| 133 intrinsic_logical_height -= border_and_padding.BlockSum(); | 133 intrinsic_logical_height -= border_and_padding.BlockSum(); |
| 134 layout_box_->setIntrinsicContentLogicalHeight(intrinsic_logical_height); | 134 layout_box_->setIntrinsicContentLogicalHeight(intrinsic_logical_height); |
| 135 | 135 |
| 136 // Ensure the position of the children are copied across to the | 136 // Ensure the position of the children are copied across to the |
| 137 // LayoutObject tree. | 137 // LayoutObject tree. |
| 138 for (NGBox* box = FirstChild(); box; box = box->NextSibling()) { | 138 for (NGBox* box = FirstChild(); box; box = box->NextSibling()) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 169 .SetBlockSize(layout_box_->logicalHeight()) | 169 .SetBlockSize(layout_box_->logicalHeight()) |
| 170 .SetDirection(FromPlatformDirection(layout_box_->styleRef().direction())) | 170 .SetDirection(FromPlatformDirection(layout_box_->styleRef().direction())) |
| 171 .SetWritingMode( | 171 .SetWritingMode( |
| 172 FromPlatformWritingMode(layout_box_->styleRef().getWritingMode())) | 172 FromPlatformWritingMode(layout_box_->styleRef().getWritingMode())) |
| 173 .SetInlineOverflow(overflow.width()) | 173 .SetInlineOverflow(overflow.width()) |
| 174 .SetBlockOverflow(overflow.height()); | 174 .SetBlockOverflow(overflow.height()); |
| 175 return builder.ToFragment(); | 175 return builder.ToFragment(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |