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

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

Issue 2798203002: NGInlineLayoutAlgorithm should take margins of inline floats into account (Closed)
Patch Set: Created 3 years, 8 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
(Empty)
1 // Copyright 2017 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/ng_layout_algorithm.h"
6
7 #include "core/layout/ng/ng_block_break_token.h"
8 #include "core/layout/ng/ng_block_node.h"
9 #include "core/layout/ng/ng_inline_break_token.h"
10 #include "core/layout/ng/ng_inline_node.h"
11 #include "core/layout/ng/ng_length_utils.h"
12
13 namespace blink {
14
15 template <typename NGInputNodeType, typename NGBreakTokenType>
kojii 2017/04/06 13:44:52 I'm probably missing something but can you explain
Gleb Lanbin 2017/04/06 16:35:36 Acknowledged.
16 NGBoxStrut
17 NGLayoutAlgorithm<NGInputNodeType, NGBreakTokenType>::ComputeMarginsForChild(
ikilpatrick 2017/04/06 16:24:31 So I don't think we want to pull this down into th
Gleb Lanbin 2017/04/06 16:35:36 Acknowledged.
18 const NGConstraintSpace& space,
19 NGLayoutInputNode* child) {
20 DCHECK(child);
21 const ComputedStyle& child_style = child->Style();
kojii 2017/04/06 13:44:52 This doesn't look right to me...NGInlineNode::Styl
Gleb Lanbin 2017/04/06 16:35:36 Acknowledged.
22
23 WTF::Optional<MinMaxContentSize> sizes;
24 if (NeedMinMaxContentSize(space, child_style))
25 sizes = child->ComputeMinMaxContentSize();
26
27 LayoutUnit child_inline_size =
28 ComputeInlineSizeForFragment(space, child_style, sizes);
29 NGBoxStrut margins = ComputeMargins(space, child_style, space.WritingMode(),
30 space.Direction());
31 ApplyAutoMargins(space, child_style, child_inline_size, &margins);
32 return margins;
33 }
34 template NGBoxStrut
35 NGLayoutAlgorithm<NGBlockNode, NGBlockBreakToken>::ComputeMarginsForChild(
36 NGConstraintSpace const&,
37 NGLayoutInputNode*);
38 template NGBoxStrut
39 NGLayoutAlgorithm<NGInlineNode, NGInlineBreakToken>::ComputeMarginsForChild(
40 NGConstraintSpace const&,
41 NGLayoutInputNode*);
42
43 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698