[LayoutNG] Cleanup visual overflow computations

Desktop / Chromium - Koji Ishii [chromium.org] - 12 October 2017 01:43 EDT

This patch cleans up visual overflow computations in: 1. Use type-safe geometry classes. NGPhysicalOffsetRect is added. 2. Add conversion functions for LayoutUnit to type-safe geometry classes. 3. LocalVisualRect() turned out not to include its children. Matched to the definition and separated ContentsVisualRect(). 4. Removed NGPhysicalFragment::LocalVisualRect() and its storage. NGPhysicalBoxFragment has the storage, but other types are assumed to be cheap and compute on the fly. 5. Removed NGPhysicalFragment::UpdateVisualRect(). Box fragments computes in NGFragmentBuilder. 6. With that, removed all virtual functions from NGPhysicalFragment.

Bug: 591099 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Iaa39ad1260e5bd34b430bb3693d914a9e73f8e46 Reviewed-on: https://chromium-review.googlesource.com/691476 Commit-Queue: Koji Ishii

62d8fd1 [LayoutNG] Cleanup visual overflow computations
third_party/WebKit/Source/core/BUILD.gn | 1 +
third_party/WebKit/Source/core/layout/BUILD.gn | 2 +
.../core/layout/ng/geometry/ng_physical_offset.cc | 4 ++
.../core/layout/ng/geometry/ng_physical_offset.h | 6 +++
.../layout/ng/geometry/ng_physical_offset_rect.cc | 51 ++++++++++++++++++++
.../layout/ng/geometry/ng_physical_offset_rect.h | 49 +++++++++++++++++++
.../ng/geometry/ng_physical_offset_rect_test.cc | 56 ++++++++++++++++++++++
.../core/layout/ng/geometry/ng_physical_size.cc | 5 ++
.../core/layout/ng/geometry/ng_physical_size.h | 9 ++++
.../ng/inline/ng_inline_layout_algorithm_test.cc | 6 +--
.../ng/inline/ng_line_box_fragment_builder.cc | 1 -
.../layout/ng/inline/ng_physical_text_fragment.cc | 27 +++++------
.../layout/ng/inline/ng_physical_text_fragment.h | 6 ++-
.../layout/ng/inline/ng_text_fragment_builder.cc | 1 -
.../Source/core/layout/ng/layout_ng_block_flow.cc | 10 ++--
.../Source/core/layout/ng/layout_ng_block_flow.h | 2 +-
.../Source/core/layout/ng/ng_fragment_builder.cc | 8 ++--
.../Source/core/layout/ng/ng_fragment_builder.h | 1 +
.../core/layout/ng/ng_physical_box_fragment.cc | 14 +++---
.../core/layout/ng/ng_physical_box_fragment.h | 12 ++++-
.../layout/ng/ng_physical_container_fragment.cc | 11 -----
.../layout/ng/ng_physical_container_fragment.h | 2 -
.../Source/core/layout/ng/ng_physical_fragment.cc | 30 ++++++++++--
.../Source/core/layout/ng/ng_physical_fragment.h | 17 ++-----
.../Source/core/paint/ng/ng_paint_fragment.cc | 3 +-
25 files changed, 264 insertions(+), 70 deletions(-)

Upstream: git.chromium.org


  • Share