| Index: third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc
|
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc
|
| index f72caecb8cf527f60a4c59fa3722d0250fc3147e..291c18eebcdd5cbce5eec3fdd5b7ac3a4cdf0089 100644
|
| --- a/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc
|
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include "core/layout/ng/ng_break_token.h"
|
| #include "core/layout/ng/ng_constraint_space.h"
|
| +#include "core/layout/ng/ng_fragment.h"
|
| +#include "core/layout/ng/ng_fragment_builder.h"
|
| #include "core/layout/ng/ng_inline_node.h"
|
|
|
| namespace blink {
|
| @@ -25,8 +27,23 @@ NGLayoutStatus NGTextLayoutAlgorithm::Layout(
|
| NGPhysicalFragmentBase*,
|
| NGPhysicalFragmentBase** fragment_out,
|
| NGLayoutAlgorithm**) {
|
| - // TODO(layout-dev): implement.
|
| - *fragment_out = nullptr;
|
| + // TODO(kojii): What kind of fragment tree do we want for line boxes/root line
|
| + // boxes? Just text, box, or new type of fragment?
|
| + NGFragmentBuilder root_line_box_builder(NGPhysicalFragmentBase::kFragmentBox);
|
| + root_line_box_builder.SetWritingMode(constraint_space_->WritingMode());
|
| + root_line_box_builder.SetDirection(constraint_space_->Direction());
|
| + unsigned start = 0;
|
| + do {
|
| + NGFragmentBuilder line_box_builder(NGPhysicalFragmentBase::kFragmentBox);
|
| + start =
|
| + inline_box_->CreateLine(start, constraint_space_, &line_box_builder);
|
| + root_line_box_builder.AddChild(
|
| + new NGFragment(constraint_space_->WritingMode(),
|
| + constraint_space_->Direction(),
|
| + line_box_builder.ToFragment()),
|
| + NGLogicalOffset());
|
| + } while (start);
|
| + *fragment_out = root_line_box_builder.ToFragment();
|
| return kNewFragment;
|
| }
|
|
|
|
|