Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(917)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.cpp

Issue 2228593005: [LayoutNG] Move createConstraintSpaceFromLayoutObject to NGConstraintSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698