Commit 64f1197e authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[LayoutNG] Add LayoutOverflow for NG Children

I had to update bad expectations for several files.
New expectations match Legacy.

Bug: 728378
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I64c10c269dd38f55a707cb7a0135f9f3a1207b97
Reviewed-on: https://chromium-review.googlesource.com/971465Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544643}
parent 651a38c4
...@@ -274,9 +274,6 @@ crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/wid ...@@ -274,9 +274,6 @@ crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/wid
# Block: percent height in continuations. # Block: percent height in continuations.
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-percents-001.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-percents-001.xht [ Failure ]
# Block: percent max-height.
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-percentage-002.xht [ Failure ]
# Inline: border in continuations. Fail in Blink. # Inline: border in continuations. Fail in Blink.
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-empty-001.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-empty-001.xht [ Failure ]
crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-empty-004.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-empty-004.xht [ Failure ]
......
layer at (0,0) size 800x600 scrollHeight 1279 layer at (0,0) size 800x600 scrollWidth 880 scrollHeight 1279
LayoutView at (0,0) size 800x600 LayoutView at (0,0) size 800x600
layer at (0,0) size 800x1279 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 layer at (0,0) size 800x1279 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
LayoutNGBlockFlow {HTML} at (0,0) size 800x1278.53 LayoutNGBlockFlow {HTML} at (0,0) size 800x1278.53
......
layer at (0,0) size 800x600 scrollHeight 1993 layer at (0,0) size 800x600 scrollWidth 888 scrollHeight 1993
LayoutView at (0,0) size 800x600 LayoutView at (0,0) size 800x600
layer at (0,0) size 800x1993 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 layer at (0,0) size 800x1993 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
LayoutNGBlockFlow {HTML} at (0,0) size 800x1993 LayoutNGBlockFlow {HTML} at (0,0) size 800x1993
......
layer at (0,0) size 800x600 layer at (0,0) size 800x600 scrollWidth 954
LayoutView at (0,0) size 800x600 LayoutView at (0,0) size 800x600
layer at (0,0) size 800x100 layer at (0,0) size 800x100
LayoutNGBlockFlow {HTML} at (0,0) size 800x100 LayoutNGBlockFlow {HTML} at (0,0) size 800x100
......
layer at (0,0) size 800x600 layer at (0,0) size 800x600 scrollWidth 1031
LayoutView at (0,0) size 800x600 LayoutView at (0,0) size 800x600
layer at (0,0) size 800x251 layer at (0,0) size 800x251
LayoutNGBlockFlow {HTML} at (0,0) size 800x251 LayoutNGBlockFlow {HTML} at (0,0) size 800x251
......
...@@ -56,6 +56,21 @@ void LayoutNGMixin<Base>::AddOverflowFromChildren() { ...@@ -56,6 +56,21 @@ void LayoutNGMixin<Base>::AddOverflowFromChildren() {
// Add overflow from the last layout cycle. // Add overflow from the last layout cycle.
if (Base::ChildrenInline()) { if (Base::ChildrenInline()) {
if (const NGPhysicalBoxFragment* physical_fragment = CurrentFragment()) { if (const NGPhysicalBoxFragment* physical_fragment = CurrentFragment()) {
bool has_width =
physical_fragment->Style().OverflowX() != EOverflow::kHidden;
bool has_height =
physical_fragment->Style().OverflowY() != EOverflow::kHidden;
if (has_width || has_height) {
for (const auto& child : physical_fragment->Children()) {
NGPhysicalOffsetRect child_rect(child->Offset(), child->Size());
if (!has_width)
child_rect.size.width = LayoutUnit();
if (!has_height)
child_rect.size.height = LayoutUnit();
Base::AddLayoutOverflow(child_rect.ToLayoutRect());
}
}
// TODO(kojii): If |RecalcOverflowAfterStyleChange()|, we need to // TODO(kojii): If |RecalcOverflowAfterStyleChange()|, we need to
// re-compute glyph bounding box. How to detect it and how to re-compute // re-compute glyph bounding box. How to detect it and how to re-compute
// is TBD. // is TBD.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment