OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/layout/ng/NGBlockLayoutAlgorithm.h" |
| 6 |
| 7 #include "core/layout/LayoutBox.h" |
| 8 #include "core/layout/ng/NGConstraintSpace.h" |
| 9 #include "core/style/ComputedStyle.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm() |
| 14 { |
| 15 } |
| 16 |
| 17 NGConstraintSpace NGBlockLayoutAlgorithm::createConstraintSpaceFromLayoutObject(
const LayoutBox& child) |
| 18 { |
| 19 bool fixedInline = false, fixedBlock = false; |
| 20 // XXX for orthogonal writing mode this is not right |
| 21 LayoutUnit containerLogicalWidth = std::max(LayoutUnit(), child.containingBl
ockLogicalWidthForContent()); |
| 22 // XXX Make sure this height is correct |
| 23 LayoutUnit containerLogicalHeight = child.containingBlockLogicalHeightForCon
tent(ExcludeMarginBorderPadding); |
| 24 if (child.hasOverrideLogicalContentWidth()) { |
| 25 containerLogicalWidth = child.overrideLogicalContentWidth(); |
| 26 fixedInline = true; |
| 27 } |
| 28 if (child.hasOverrideLogicalContentHeight()) { |
| 29 containerLogicalWidth = child.overrideLogicalContentHeight(); |
| 30 fixedBlock = true; |
| 31 } |
| 32 NGConstraintSpace space(containerLogicalWidth, containerLogicalHeight); |
| 33 // XXX vertical writing mode |
| 34 space.setOverflowTriggersScrollbar(child.styleRef().overflowX() == OverflowA
uto, |
| 35 child.styleRef().overflowY() == OverflowAuto); |
| 36 space.setFixedSize(fixedInline, fixedBlock); |
| 37 return space; |
| 38 } |
| 39 |
| 40 } // namespace blink |
OLD | NEW |