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

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

Issue 2222133002: [layoutng] Initial version of block layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/NGBlockLayoutAlgorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698