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

[LayoutNG] Get the missing ListMarkers back

ListMarker won't be shown under these two situation:
1. We update marker text in WillCollectInlines(), it won't be called
when ListItem isn't ChildrenInline. Call WillCollectInlines() manually
if ListItem only has block children.
2. If marker isn't the child of LI, both LI and marker_parent won't paint
marker. So make marker as a direct child of LI.

Bug: 715288
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I994fc9980c73cf00f983142d86b4ba49687d72f6
Reviewed-on: https://chromium-review.googlesource.com/1088333Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: cathie chen <cathiechen@tencent.com>
Cr-Commit-Position: refs/heads/master@{#565613}
parent 899b95e4
......@@ -168,9 +168,6 @@ crbug.com/591099 external/wpt/css/CSS2/normal-flow/block-in-inline-remove-006.xh
crbug.com/591099 external/wpt/css/CSS2/normal-flow/root-box-001.xht [ Failure ]
crbug.com/591099 external/wpt/css/CSS2/text/white-space-mixed-003.xht [ Pass ]
crbug.com/591099 external/wpt/css/css-backgrounds/box-shadow-syntax-001.xht [ Failure ]
crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-list-001-inline.html [ Failure ]
crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-list-001-none.html [ Failure ]
crbug.com/591099 external/wpt/css/css-display/display-contents-list-001.html [ Failure ]
crbug.com/591099 external/wpt/css/css-filter/filtered-inline-is-container.html [ Crash ]
crbug.com/714962 external/wpt/css/css-fonts/font-features-across-space-1.html [ Pass ]
crbug.com/714962 external/wpt/css/css-fonts/font-features-across-space-3.html [ Pass ]
......
......@@ -13,8 +13,9 @@ layer at (0,0) size 800x262
text run at (124,0) width 274: " be a green bar stacked on top of a blue bar."
LayoutNGListItem {DIV} at (0,36) size 784x202 [color=#00FF00] [bgcolor=#00FF00]
LayoutNGBlockFlow (anonymous) at (0,0) size 784x101
LayoutInline (anonymous) at (0,0) size 0x0
LayoutText (anonymous) at (0,0) size 0x0
LayoutInline (anonymous) at (0,0) size 30x97
LayoutText (anonymous) at (-1,2) size 30x97
text run at (-1,2) width 30: "\x{2022}"
LayoutNGBlockFlow {DIV} at (0,101) size 784x101 [bgcolor=#0000FF]
LayoutText {#text} at (0,2) size 21x97
text run at (0,2) width 21: " "
......@@ -63,6 +63,15 @@ void LayoutNGListItem::OrdinalValueChanged() {
}
void LayoutNGListItem::SubtreeDidChange() {
if (!marker_)
return;
// Make sure marker is the direct child of ListItem.
if (marker_->Parent() && marker_->Parent() != this) {
marker_->Remove();
AddChild(marker_, FirstChild());
}
UpdateMarkerContentIfNeeded();
}
......@@ -239,8 +248,7 @@ String LayoutNGListItem::MarkerTextWithoutSuffix() const {
}
void LayoutNGListItem::UpdateMarkerContentIfNeeded() {
if (!marker_)
return;
DCHECK(marker_);
LayoutObject* child = marker_->SlowFirstChild();
if (IsMarkerImage()) {
......
......@@ -955,6 +955,13 @@ bool NGBlockLayoutAlgorithm::HandleInflow(
bool is_non_empty_inline =
child.IsInline() && !ToNGInlineNode(child).IsEmptyInline();
// We update marker text in WillCollectInlines(). If ListItem isn't
// ChildrenInline(), we should WillCollectInlines() manually.
if (Node().IsListItem() && !child.IsInline()) {
LayoutBlockFlow* block = ToLayoutBlockFlow(Node().GetLayoutObject());
block->WillCollectInlines();
}
bool has_clearance_past_adjoining_floats =
child.IsBlock() &&
HasClearancePastAdjoiningFloats(container_builder_.AdjoiningFloatTypes(),
......
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