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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc

Issue 2266313002: [layoutng] Create a more correct constraint space for children (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 3 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/ng_constraint_space.h" 5 #include "core/layout/ng/ng_constraint_space.h"
6 6
7 #include "core/layout/LayoutBox.h" 7 #include "core/layout/LayoutBox.h"
8 #include "core/style/ComputedStyle.h" 8 #include "core/style/ComputedStyle.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 NGConstraintSpace::NGConstraintSpace(NGLogicalSize container_size) { 12 NGConstraintSpace::NGConstraintSpace(NGLogicalSize container_size) {
13 container_size_ = container_size; 13 container_size_ = container_size;
14 inline_triggers_scrollbar_ = 0; 14 inline_triggers_scrollbar_ = 0;
15 block_triggers_scrollbar_ = 0; 15 block_triggers_scrollbar_ = 0;
16 fixed_inline_size_ = 0; 16 fixed_inline_size_ = 0;
17 fixed_block_size_ = 0; 17 fixed_block_size_ = 0;
18 block_fragmentation_type_ = FragmentNone; 18 block_fragmentation_type_ = FragmentNone;
19 } 19 }
20 20
21 NGConstraintSpace::NGConstraintSpace(const NGConstraintSpace& other,
22 NGLogicalSize container_size)
23 : NGConstraintSpace(container_size) {
24 exclusions_ = other.exclusions_;
25 }
26
21 NGConstraintSpace NGConstraintSpace::fromLayoutObject(const LayoutBox& child) { 27 NGConstraintSpace NGConstraintSpace::fromLayoutObject(const LayoutBox& child) {
22 bool fixedInline = false, fixedBlock = false; 28 bool fixedInline = false, fixedBlock = false;
23 // XXX for orthogonal writing mode this is not right 29 // XXX for orthogonal writing mode this is not right
24 LayoutUnit container_logical_width = 30 LayoutUnit container_logical_width =
25 std::max(LayoutUnit(), child.containingBlockLogicalWidthForContent()); 31 std::max(LayoutUnit(), child.containingBlockLogicalWidthForContent());
26 // XXX Make sure this height is correct 32 // XXX Make sure this height is correct
27 LayoutUnit container_logical_height = 33 LayoutUnit container_logical_height =
28 child.containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); 34 child.containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
29 if (child.hasOverrideLogicalContentWidth()) { 35 if (child.hasOverrideLogicalContentWidth()) {
30 container_logical_width = child.overrideLogicalContentWidth(); 36 container_logical_width = child.overrideLogicalContentWidth();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 78
73 NGLayoutOpportunityIterator NGConstraintSpace::layoutOpportunities( 79 NGLayoutOpportunityIterator NGConstraintSpace::layoutOpportunities(
74 unsigned clear, 80 unsigned clear,
75 bool for_inline_or_bfc) const { 81 bool for_inline_or_bfc) const {
76 // TODO(eae): Implement. 82 // TODO(eae): Implement.
77 NGLayoutOpportunityIterator iterator(this, clear, for_inline_or_bfc); 83 NGLayoutOpportunityIterator iterator(this, clear, for_inline_or_bfc);
78 return iterator; 84 return iterator;
79 } 85 }
80 86
81 } // namespace blink 87 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698