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

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

Issue 2739683006: Use Opportunity Iterator to position text fragments in NGLineBuilder (Closed)
Patch Set: Created 3 years, 9 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_base_layout_algorithm_test.h"
6
7 #include "core/layout/ng/layout_ng_block_flow.h"
8 #include "core/layout/ng/ng_block_layout_algorithm.h"
9 #include "core/layout/ng/ng_physical_fragment.h"
10 namespace blink {
11
12 NGBaseLayoutAlgorithmTest::NGBaseLayoutAlgorithmTest() {
13 RuntimeEnabledFeatures::setLayoutNGEnabled(true);
14 RuntimeEnabledFeatures::setLayoutNGInlineEnabled(true);
15 }
16
17 NGBaseLayoutAlgorithmTest::~NGBaseLayoutAlgorithmTest() {
18 RuntimeEnabledFeatures::setLayoutNGEnabled(false);
19 RuntimeEnabledFeatures::setLayoutNGInlineEnabled(false);
20 }
21
22 void NGBaseLayoutAlgorithmTest::SetUp() {
23 RenderingTest::SetUp();
24 enableCompositing();
25 }
26
27 std::pair<RefPtr<NGPhysicalBoxFragment>, RefPtr<NGConstraintSpace>>
28 NGBaseLayoutAlgorithmTest::RunBlockLayoutAlgorithmForElement(Element* element) {
29 LayoutNGBlockFlow* block_flow = toLayoutNGBlockFlow(element->layoutObject());
30 NGBlockNode* node = new NGBlockNode(block_flow);
31 RefPtr<NGConstraintSpace> space =
32 NGConstraintSpace::CreateFromLayoutObject(*block_flow);
33
34 RefPtr<NGLayoutResult> result =
35 NGBlockLayoutAlgorithm(node, space.get()).Layout();
36 return std::make_pair(
37 toNGPhysicalBoxFragment(result->PhysicalFragment().get()), space);
38 }
39
40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698