Commit e2502ab0 authored by Aleks Totic's avatar Aleks Totic Committed by Commit Bot

[LayoutNG] fix NGLayoutResult clone null bug

This happens when ng cacheing is enabled.

Following tests crash with Cache flag without the fix:
compositing/geometry/composited-in-columns.html
external/wpt/css/css-multicol/multicol-break-000.xht
external/wpt/css/css-multicol/multicol-break-001.xht
fast/block/float/floats-do-not-overhang-from-block-formatting-context.html
fast/block/positioning/offsetLeft-offsetTop-multicolumn.html
fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size.html
fast/css-intrinsic-dimensions/multicol.html
fast/forms/number/number-spinbutton-in-multi-column.html
fast/forms/select/listbox-in-multi-column.html
fast/multicol/auto-height-forced-break-complex-margin-collapsing.html
fast/multicol/balance-break-inside-avoid.html
fast/multicol/balance-floats.html
fast/multicol/balance-short-trailing-empty-block.html
fast/multicol/balance-trailing-border-after-break.html
fast/multicol/balance-trailing-border.html
fast/multicol/balance-unbreakable.html
fast/multicol/break-after-always-bottom-margin.html
fast/multicol/break-before-first-line-in-first-child.html
fast/multicol/break-properties.html
fast/multicol/client-rects-rtl.html
fast/multicol/client-rects.html
fast/multicol/composited-layer.html
fast/multicol/cssom-view.html
fast/multicol/first-line-in-block-below-next-column-top.html
fast/multicol/first-line-in-block-with-padding-exact-fit.html
fast/multicol/first-line-in-block-with-padding.html
fast/multicol/first-line-in-float-below-next-column-top.html
fast/multicol/first-line-in-float-with-margin.html
fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html
fast/multicol/fixedpos-in-transform-at-column-boundary.html
fast/multicol/flipped-blocks-hit-test.html
fast/multicol/float-beside-bfc.html
fast/multicol/float-moved-by-child-line-and-unbreakable.html
fast/multicol/float-with-margin-moved-by-child-block-and-unbreakable.html
fast/multicol/float-with-margin-moved-by-child-block.html
fast/multicol/float-with-margin-moved-by-child-line-and-unbreakable.html
fast/multicol/float-with-margin-moved-by-child-line.html
fast/multicol/float-with-margin-moved-unbreakable.html
fast/multicol/forced-break-before-complex-margin-collapsing.html
fast/multicol/forced-break-in-nested-columns.html
fast/multicol/hit-test-above-or-below.html
fast/multicol/hit-test-end-of-column-with-line-height.html
fast/multicol/hit-test-end-of-column.html
fast/multicol/hit-test-float.html
fast/multicol/hit-test-translate-z.html
fast/multicol/image-inside-nested-blocks-with-border.html
fast/multicol/inline-getclientrects.html
fast/multicol/inner-multicol-moved-into-continuation.html
fast/multicol/insane-column-count-and-padding-nested-crash.html
fast/multicol/margin-bottom-and-break-after.html
fast/multicol/min-height-greater-than-content.html
fast/multicol/min-height-greater-than-height.html
fast/multicol/min-height-less-than-content.html
fast/multicol/min-height-less-than-height.html
fast/multicol/min-height-much-greater-than-content.html
fast/multicol/nested-balancing-with-line-at-exact-top.html
fast/multicol/nested-balancing-with-lines-and-space-left-in-previous-row.html
fast/multicol/nested-inner-auto-height-outer-extra-space.html
fast/multicol/nested-one-line-in-inner.html
fast/multicol/nested-short-first-row-extra-tall-line.html
fast/multicol/nested-short-first-row-unsplittable-block.html
fast/multicol/nested-uneven-inner-column-height.html
fast/multicol/nested-with-forced-breaks-in-eariler-rows.html
fast/multicol/orphaned-line-at-exact-top-of-column.html
fast/multicol/orphans-relayout.html
fast/multicol/relayout-and-push-float.html
fast/multicol/shadow-breaking.html
fast/multicol/three-inner-rows.html
fast/multicol/unforced-break-after-complex-margin-collapsing.html
fast/multicol/widows-and-orphans.html
fast/multicol/widows.html
fast/multicol/widows2.html
fast/multicol/dynamic/bottom-aligned-abspos-change-column-height.html
fast/multicol/newmulticol/balance-images.html
fast/multicol/newmulticol/balance-maxheight1.html
fast/multicol/newmulticol/balance-maxheight2.html
fast/multicol/newmulticol/balance1.html
fast/multicol/newmulticol/balance10.html
fast/multicol/newmulticol/balance2.html
fast/multicol/newmulticol/balance3.html
fast/multicol/newmulticol/balance4.html
fast/multicol/newmulticol/balance5.html
fast/multicol/newmulticol/balance6.html
fast/multicol/newmulticol/balance7.html
fast/multicol/newmulticol/balance8.html
fast/multicol/newmulticol/balance9.html
fast/multicol/newmulticol/orphans-and-widows-balance.html
fast/multicol/span/autofill-after-spanner.html
fast/multicol/vertical-lr/break-properties.html
fast/multicol/vertical-lr/balancing/balance-short-trailing-empty-block.html
fast/multicol/vertical-lr/balancing/balance-trailing-border-after-break.html
fast/multicol/vertical-lr/balancing/balance-trailing-border.html
fast/multicol/vertical-lr/balancing/balance-unbreakable.html
fast/multicol/vertical-rl/break-properties.html
fast/multicol/vertical-rl/balancing/balance-short-trailing-empty-block.html
fast/multicol/vertical-rl/balancing/balance-trailing-border-after-break.html
fast/multicol/vertical-rl/balancing/balance-trailing-border.html
fast/multicol/vertical-rl/balancing/balance-unbreakable.html
fast/pagination/multicol.html
fragmentation/abspos-after-forced-break.html
fragmentation/avoid-break-inside-first-child-nested.html
fragmentation/avoid-break-inside-first-child.html
fragmentation/block-with-float-and-1-orphaned-line.html
fragmentation/break-after-last-child.html
fragmentation/break-before-empty-child-block.html
fragmentation/break-before-first-child.html
fragmentation/break-in-caption-before-tbody.html
fragmentation/break-in-first-table-row-only.html
fragmentation/break-in-first-table-section.html
fragmentation/break-in-second-table-section.html
fragmentation/break-in-tbody-after-caption.html
fragmentation/break-inside-avoid-with-forced-break.html
fragmentation/cell-taller-than-col-straddles-columns.html
fragmentation/class-c-break-after-clearance.html
fragmentation/collapsing-class-a-breakpoints.html
fragmentation/float-after-forced-break.html
fragmentation/image-block-as-first-child.html
fragmentation/multi-line-cells.html
fragmentation/repeating-thead-exceeds-page-size.html
fragmentation/repeating-thead-no-room-for-content-row-on-first-page.html
fragmentation/single-cell-too-large-for-page.html
fragmentation/single-cells-multiple-tables-no-repeating-thead.html
fragmentation/single-line-cells-in-multiple-table-sections.html
fragmentation/single-line-cells.html
fragmentation/table-in-subpixel-fragmentainer.html
fragmentation/table-overlapping-rowspan.html
fragmentation/table-row-dimensions-break-freely.html
fragmentation/table-row-dimensions-with-thead.html
fragmentation/table-row-dimensions.html
fragmentation/tbody-before-thead.html
paint/invalidation/overflow/paged-with-overflowing-block-rl.html
paint/pagination/pagination-change-clip-crash.html
printing/multicol.html
printing/pageProperty-with-multicol.html

Bug: 819372
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I5df07ebf451527a640d7a5f4125d10a3e7441bc8
Reviewed-on: https://chromium-review.googlesource.com/952262
Commit-Queue: Aleks Totic <atotic@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541931}
parent ba3357d7
......@@ -54,8 +54,12 @@ scoped_refptr<NGLayoutResult> NGLayoutResult::CloneWithoutOffset() const {
Vector<NGPositionedFloat> positioned_floats(positioned_floats_);
Vector<scoped_refptr<NGUnpositionedFloat>> unpositioned_floats(
unpositioned_floats_);
std::unique_ptr<const NGExclusionSpace> exclusion_space(
WTF::WrapUnique(new NGExclusionSpace(*exclusion_space_)));
std::unique_ptr<const NGExclusionSpace> exclusion_space;
// TODO(layoutng) Replace this with DCHECK(exclusion_space_) when
// callers guarantee exclusion_space_ != null.
if (exclusion_space_)
exclusion_space = WTF::WrapUnique(new NGExclusionSpace(*exclusion_space_));
return base::AdoptRef(new NGLayoutResult(
physical_fragment_->CloneWithoutOffset(), oof_positioned_descendants,
positioned_floats, unpositioned_floats, unpositioned_list_marker_,
......
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