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/NGBlockLayoutAlgorithm.h" | 5 #include "core/layout/ng/NGBlockLayoutAlgorithm.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBox.h" | |
|
cbiesinger
2016/08/09 19:26:58
Can you keep these? My pending patch needs them :)
| |
| 8 #include "core/layout/ng/NGConstraintSpace.h" | |
| 9 #include "core/style/ComputedStyle.h" | |
| 10 | |
| 11 namespace blink { | 7 namespace blink { |
| 12 | 8 |
| 13 NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm() | 9 NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm() |
| 14 { | 10 { |
| 15 } | 11 } |
| 16 | 12 |
| 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 | 13 } // namespace blink |
| OLD | NEW |