Commit b164f843 authored by cathiechen's avatar cathiechen Committed by Commit Bot

To restore the height of marker container it should be auto

If the zero-height marker container is triggered in the previous layout
pass, and in this layout pass, marker become inside or marker container
has other child, we need recover from zero-height, the height of marker
container should be restored to auto not the height of li.
This test passes in Firefox, WebKit as well as LayoutNG.

Bug: 918488
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I3c65a2d27f1b8dfef13c41bfe804cd1f9aab89c5
Reviewed-on: https://chromium-review.googlesource.com/c/1393129
Commit-Queue: cathie chen <cathiechen@igalia.com>
Reviewed-by: default avatarManuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#619658}
parent f5fc6a5e
......@@ -190,11 +190,11 @@ bool LayoutListItem::PrepareForBlockDirectionAlign(
// Deal with the situation of layout tree changed.
if (marker_parent && marker_parent->IsAnonymous()) {
// When list-position-style change from outside to inside, we need to
// restore LogicalHeight. So add IsInside().
// restore LogicalHeight to auto. So add IsInside().
if (marker_->IsInside() || marker_->NextSibling()) {
// Restore old marker_container LogicalHeight.
// Set marker_container's LogicalHeight to auto.
if (marker_parent->StyleRef().LogicalHeight().IsZero())
ForceLogicalHeight(*marker_parent, StyleRef().LogicalHeight());
ForceLogicalHeight(*marker_parent, Length());
// If marker_parent isn't the ancestor of line_box_parent, marker might
// generate a new empty line. We need to remove marker here.E.g:
......
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Lists: list with height</title>
<p>The test passes if "second" is in the following line of "first".</p>
<ul>
<li id="li_target" style="height:200px; border:1px solid black; width:200px">
first<div id="div_target" style="overflow:hidden;">second</div>
</li>
</ul>
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Lists: list with height</title>
<link rel=help href="https://www.w3.org/TR/CSS22/generate.html#lists">
<link rel=match href="li-with-height-001-ref.html">
<meta name="assert" content="This is to check the behavior of adding an element at the begining of li" />
<p>The test passes if "second" is in the following line of "first".</p>
<ul>
<li id="li_target" style="height:200px; border:1px solid black; width:200px">
<div id="div_target" style="overflow:hidden;">second</div>
</li>
</ul>
<script>
document.body.clientHeight;
var text_node = document.createTextNode("first");
var li_target = document.getElementById("li_target");
var div_target = document.getElementById("div_target");
li_target.insertBefore(text_node,div_target);
</script>
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