Commit f99b2ca3 authored by Ian Kilpatrick's avatar Ian Kilpatrick Committed by Commit Bot

[LayoutNG] Make empty block end margins "inherit" quirkiness from start margins.

This is amazing. Essentially if an element has "default" quirky start
margins, and it is an empty block, the end margin (regardless of if it
is quirky or not), becomes quirky.

This doesn't propagate to other elements however, see:
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=6016

A bigger fix might be to change the default stylesheet to make all of
these elements with quirky margins to have quirky margins on each side,
then change the logic for the bottom quirkyness. But this is a pretty
scary change. (This may however match other browsers better eventually).

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I5895a148211a5a1291e9b0a935fea08e094d4ec0
Bug: 635619
Reviewed-on: https://chromium-review.googlesource.com/1124071Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572513}
parent efc54545
...@@ -323,7 +323,6 @@ crbug.com/591099 fast/backgrounds/size/backgroundSize16.html [ Failure ] ...@@ -323,7 +323,6 @@ crbug.com/591099 fast/backgrounds/size/backgroundSize16.html [ Failure ]
crbug.com/591099 fast/block/basic/quirk-percent-height-table-cell.html [ Failure ] crbug.com/591099 fast/block/basic/quirk-percent-height-table-cell.html [ Failure ]
crbug.com/591099 fast/block/block-width-recalc-with-relative-height.html [ Failure ] crbug.com/591099 fast/block/block-width-recalc-with-relative-height.html [ Failure ]
crbug.com/591099 fast/block/float-avoids-padding-inline-ancestors.html [ Crash ] crbug.com/591099 fast/block/float-avoids-padding-inline-ancestors.html [ Crash ]
crbug.com/810335 fast/block/float/003.html [ Failure ]
crbug.com/591099 fast/block/float/floats-offset-image-strict-line-height.html [ Failure ] crbug.com/591099 fast/block/float/floats-offset-image-strict-line-height.html [ Failure ]
crbug.com/591099 fast/block/float/floats-offset-inline-block-strict-line-height.html [ Failure ] crbug.com/591099 fast/block/float/floats-offset-inline-block-strict-line-height.html [ Failure ]
crbug.com/591099 fast/block/float/negative-margin-on-element-avoiding-floats-with-margin-on-parent.html [ Failure ] crbug.com/591099 fast/block/float/negative-margin-on-element-avoiding-floats-with-margin-on-parent.html [ Failure ]
...@@ -382,7 +381,6 @@ crbug.com/591099 fast/css-intrinsic-dimensions/fixed-height-stf-img-block-child- ...@@ -382,7 +381,6 @@ crbug.com/591099 fast/css-intrinsic-dimensions/fixed-height-stf-img-block-child-
crbug.com/591099 fast/css-intrinsic-dimensions/fixed-height-stf-img-inline-child-percent-height.html [ Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/fixed-height-stf-img-inline-child-percent-height.html [ Failure ]
crbug.com/591099 fast/css-intrinsic-dimensions/height-positioned.html [ Failure ] crbug.com/591099 fast/css-intrinsic-dimensions/height-positioned.html [ Failure ]
crbug.com/807708 fast/css-intrinsic-dimensions/width-avoid-floats.html [ Failure ] crbug.com/807708 fast/css-intrinsic-dimensions/width-avoid-floats.html [ Failure ]
crbug.com/591099 fast/css/007.html [ Failure ]
crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-001.html [ Failure ] crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-001.html [ Failure ]
crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-offset-001.html [ Failure ] crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-offset-001.html [ Failure ]
crbug.com/591099 fast/css/absolute-inline-alignment-2.html [ Pass ] crbug.com/591099 fast/css/absolute-inline-alignment-2.html [ Pass ]
...@@ -901,7 +899,6 @@ crbug.com/714962 paint/text/text-match-highlights-big-line-height.html [ Failure ...@@ -901,7 +899,6 @@ crbug.com/714962 paint/text/text-match-highlights-big-line-height.html [ Failure
crbug.com/591099 printing/absolute-position-headers-and-footers.html [ Failure ] crbug.com/591099 printing/absolute-position-headers-and-footers.html [ Failure ]
crbug.com/591099 printing/iframe-svg-in-object-print.html [ Failure ] crbug.com/591099 printing/iframe-svg-in-object-print.html [ Failure ]
crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ] crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
crbug.com/591099 scrollbars/scrollbar-miss-mousemove-disabled.html [ Failure ]
crbug.com/591099 shapedetection/detection-HTMLVideoElement.html [ Pass ] crbug.com/591099 shapedetection/detection-HTMLVideoElement.html [ Pass ]
crbug.com/591099 storage/indexeddb/cursor-continue-validity.html [ Timeout ] crbug.com/591099 storage/indexeddb/cursor-continue-validity.html [ Timeout ]
crbug.com/591099 storage/indexeddb/index-cursor.html [ Pass Timeout ] crbug.com/591099 storage/indexeddb/index-cursor.html [ Pass Timeout ]
...@@ -932,7 +929,6 @@ crbug.com/591099 tables/mozilla/bugs/bug23235.html [ Failure ] ...@@ -932,7 +929,6 @@ crbug.com/591099 tables/mozilla/bugs/bug23235.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug30692.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug30692.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug50695-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug50695-2.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug53690-2.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug55527.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug55527.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug57828-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug57828-2.html [ Failure ]
crbug.com/591099 tables/mozilla_expected_failures/bugs/bug3166-16.html [ Failure ] crbug.com/591099 tables/mozilla_expected_failures/bugs/bug3166-16.html [ Failure ]
......
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutNGBlockFlow {HTML} at (0,0) size 800x600
LayoutNGBlockFlow {BODY} at (8,16) size 784x576
LayoutNGBlockFlow (anonymous) at (0,0) size 784x0
LayoutInline {FONT} at (0,0) size 0x0
LayoutText {#text} at (0,0) size 0x0
LayoutNGBlockFlow (anonymous) at (0,0) size 784x0
LayoutNGBlockFlow {FORM} at (0,0) size 784x0
LayoutNGBlockFlow (anonymous) at (0,0) size 784x0
LayoutInline {FONT} at (0,0) size 0x0
LayoutTable {TABLE} at (0,0) size 0x0
...@@ -1379,8 +1379,12 @@ NGPreviousInflowPosition NGBlockLayoutAlgorithm::ComputeInflowPosition( ...@@ -1379,8 +1379,12 @@ NGPreviousInflowPosition NGBlockLayoutAlgorithm::ComputeInflowPosition(
child_data.margins.block_end, &logical_block_offset, child_data.margins.block_end, &logical_block_offset,
&margin_strut); &margin_strut);
} else { } else {
margin_strut.Append(child_data.margins.block_end, // An empty block's end margin can "inherit" quirkiness from its start
child.Style().HasMarginAfterQuirk()); // margin. E.g.
// <ol style="margin-bottom: 20px"></ol>
bool is_quirky = (is_empty_block && child.Style().HasMarginBeforeQuirk()) ||
child.Style().HasMarginAfterQuirk();
margin_strut.Append(child_data.margins.block_end, is_quirky);
} }
// This flag is subtle, but in order to determine our size correctly we need // This flag is subtle, but in order to determine our size correctly we need
......
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