[LayoutNG] Add NGLineBoxFragment

Desktop / Chromium - kojii [chromium.org] - 24 March 2017 12:18 EDT

This patch adds NGLineBoxFragment, along with:- NGPhysicalLineBoxFragment- NGLineBoxFragmentBuilder- NGTextFragmentBuilder for consistency

Part of code in NGLineBuilder was extracted to new classes, in preparation of renaming it to NGLineLayoutAlgorithm.

NGFragment::Overflow was moved to NGBoxFragment, since neither text nor linebox has layout overflow. All types of fragments have ink overflow, but this is not included in this CL.

Some of NGFragmentBuilders could be shared as super classes. This is not in this CL but to be discussed further.

This patch moves one step towards computing baseline position from NGFragment, but its implementation is not included in this CL.

BUG=636993

Review-Url: https://codereview.chromium.org/2764753007 Cr-Commit-Position: refs/heads/master@{#459446}

9872e64 [LayoutNG] Add NGLineBoxFragment
third_party/WebKit/Source/core/layout/BUILD.gn | 10 ++
.../Source/core/layout/ng/ng_box_fragment.cc | 12 ++
.../WebKit/Source/core/layout/ng/ng_box_fragment.h | 4 +
.../WebKit/Source/core/layout/ng/ng_fragment.cc | 12 --
.../WebKit/Source/core/layout/ng/ng_fragment.h | 4 -
.../Source/core/layout/ng/ng_fragment_builder.cc | 15 --
.../Source/core/layout/ng/ng_fragment_builder.h | 3 -
.../Source/core/layout/ng/ng_inline_node_test.cc | 10 +-
.../Source/core/layout/ng/ng_line_box_fragment.cc | 7 +
.../Source/core/layout/ng/ng_line_box_fragment.h | 30 ++++
.../core/layout/ng/ng_line_box_fragment_builder.cc | 70 ++++++++
.../core/layout/ng/ng_line_box_fragment_builder.h | 57 ++++++
.../Source/core/layout/ng/ng_line_builder.cc | 199 ++++++++-------------
.../WebKit/Source/core/layout/ng/ng_line_builder.h | 50 +-----
.../core/layout/ng/ng_line_height_metrics.cc | 46 +++++
.../Source/core/layout/ng/ng_line_height_metrics.h | 46 +++++
.../core/layout/ng/ng_physical_box_fragment.cc | 2 +-
.../core/layout/ng/ng_physical_box_fragment.h | 5 +
.../Source/core/layout/ng/ng_physical_fragment.cc | 21 ++-
.../Source/core/layout/ng/ng_physical_fragment.h | 17 +-
.../layout/ng/ng_physical_line_box_fragment.cc | 24 +++
.../core/layout/ng/ng_physical_line_box_fragment.h | 43 +++++
.../core/layout/ng/ng_physical_text_fragment.h | 5 +-
.../core/layout/ng/ng_text_fragment_builder.cc | 48 +++++
.../core/layout/ng/ng_text_fragment_builder.h | 49 +++++
.../layout/ng/ng_text_layout_algorithm_test.cc | 21 ++-
26 files changed, 579 insertions(+), 231 deletions(-)

Upstream: git.chromium.org


  • Share