Commit 09f60d66 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Don't allow line height quirk inside list items.

This makes us match legacy engine behavior more closely, and both Edge
and Firefox have something similar, although Firefox triggers based on
element type (LI), and not display type (list-item). There's currently
nothing in the spec [1] that suggests such special behavior for list
items.

[1] https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk

This fix makes the line height differences go away in the test
tables/mozilla/bugs/bug23235.html (but note that it will still require
a rebaseline, because of minor text rendering differences between
legacy and NG).

See https://github.com/whatwg/quirks/issues/38 for spec discussion.

Change-Id: I396c0c85454feeaa45a0a5953b9e6b7c475d131e
Reviewed-on: https://chromium-review.googlesource.com/c/1379897
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618304}
parent f99469b2
......@@ -191,10 +191,11 @@ void NGInlineLayoutAlgorithm::CreateLine(NGLineInfo* line_info,
bool has_out_of_flow_positioned_items = false;
// In order to match other browsers when list-style-type: none, pretend
// there's an invisible marker here.
if (line_style.Display() == EDisplay::kListItem &&
line_style.ListStyleType() == EListStyleType::kNone)
// List items trigger strict line height, i.e. we make room for the line box
// strut, for *every* line. This matches other browsers. The intention may
// have been to make sure that there's always room for the list item marker,
// but that doesn't explain why it's done for every line...
if (quirks_mode_ && line_style.Display() == EDisplay::kListItem)
box->ComputeTextMetrics(line_style, baseline_type_);
for (NGInlineItemResult& item_result : *line_items) {
......
......@@ -298,7 +298,6 @@ crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
crbug.com/591099 svg/zoom/page/zoom-svg-float-border-padding.xml [ Pass ]
crbug.com/591099 tables/mozilla/bugs/bug101674.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug14159-1.html [ Pass ]
crbug.com/591099 tables/mozilla/bugs/bug23235.html [ Failure ]
crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Pass ]
crbug.com/591099 virtual/android/rootscroller/set-root-scroller.html [ Pass ]
crbug.com/591099 virtual/android/rootscroller/set-rootscroller-before-load.html [ Pass ]
......
<!-- quirks mode -->
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<link rel="help" href="https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk">
<link rel="match" href="reference/green-100px-square-no-red.html">
<meta name="assert" content="List items force strict line height; see https://github.com/whatwg/quirks/issues/38">
<p>There should be a filled green square below, and no red.</p>
<div style="width:100px; height:100px; background:red;">
<li style="line-height:50px; color:green; background:green;">
<br>
<div style="display:inline-block; width:1px; height:1px;"></div>
</li>
</div>
<!-- quirks mode -->
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org">
<p>There should be a filled green square below, and no red.</p>
<div style="width:100px; height:100px; background:green;"></div>
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