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

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

Issue 2562703003: Make AlgorithmForInputNode use original constraint space (Closed)
Patch Set: Make AlgorithmForInputNode use container constraint space Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layout_ng_block_flow.h" 5 #include "core/layout/ng/layout_ng_block_flow.h"
6 #include "core/layout/ng/ng_constraint_space.h" 6 #include "core/layout/ng/ng_constraint_space.h"
7 #include "core/layout/LayoutAnalyzer.h" 7 #include "core/layout/LayoutAnalyzer.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element) 11 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element)
12 : LayoutBlockFlow(element) {} 12 : LayoutBlockFlow(element) {}
13 13
14 bool LayoutNGBlockFlow::isOfType(LayoutObjectType type) const { 14 bool LayoutNGBlockFlow::isOfType(LayoutObjectType type) const {
15 return type == LayoutObjectNGBlockFlow || LayoutBlockFlow::isOfType(type); 15 return type == LayoutObjectNGBlockFlow || LayoutBlockFlow::isOfType(type);
16 } 16 }
17 17
18 void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) { 18 void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) {
19 LayoutAnalyzer::BlockScope analyzer(*this); 19 LayoutAnalyzer::BlockScope analyzer(*this);
20 20
21 const auto* constraint_space = 21 auto* constraint_space = NGConstraintSpace::CreateFromLayoutObject(*this);
22 NGConstraintSpace::CreateFromLayoutObject(*this);
23 22
24 // TODO(layout-dev): This should be created in the constructor once instead. 23 // TODO(layout-dev): This should be created in the constructor once instead.
25 // There is some internal state which needs to be cleared between layout 24 // There is some internal state which needs to be cleared between layout
26 // passes (probably FirstChild(), etc). 25 // passes (probably FirstChild(), etc).
27 m_box = new NGBlockNode(this); 26 m_box = new NGBlockNode(this);
28 27
29 NGFragmentBase* fragment; 28 NGFragmentBase* fragment;
30 while (!m_box->Layout(constraint_space, &fragment)) 29 while (!m_box->Layout(constraint_space, &fragment))
31 ; 30 ;
32 clearNeedsLayout(); 31 clearNeedsLayout();
33 } 32 }
34 33
35 } // namespace blink 34 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698