Commit b3c636bf authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

Limit table cell width calculation quirk to images

This patch fixes a regression in r724125 crrev.com/c/1959907
which mistakenly applied the table cell width calculation
quirk[1] to all atomic inlines. It should apply only to
images.

[1] https://quirks.spec.whatwg.org/#the-table-cell-width-calculation-quirk

Bug: 1049401
Change-Id: Iddb25c26efef2379e85773880d33af6aea859e56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040793Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738859}
parent 7d601fbe
...@@ -1387,7 +1387,11 @@ void NGLineBreaker::HandleAtomicInline( ...@@ -1387,7 +1387,11 @@ void NGLineBreaker::HandleAtomicInline(
} }
item_result->should_create_line_box = true; item_result->should_create_line_box = true;
item_result->can_break_after = auto_wrap_ && !sticky_images_quirk_; // Atomic inlines have break opportunities before and after, even when the
// adjacent character is U+00A0 NO-BREAK SPACE character, except when sticky
// images quirk is applied.
item_result->can_break_after =
auto_wrap_ && !(sticky_images_quirk_ && item.IsImage());
position_ += item_result->inline_size; position_ += item_result->inline_size;
trailing_whitespace_ = WhitespaceState::kNone; trailing_whitespace_ = WhitespaceState::kNone;
......
<title>The table cell width calculation quirk should not apply to inline blocks</title>
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<style>
inline-block {
display: inline-block;
}
</style>
<body>
<table style="width:80px" data-expected-width=80>
<tr>
<td><inline-block style="width:50px">50</inline-block><inline-block style="width:50px">50</inline-block></td>
</tr>
</table>
<script>checkLayout('table');</script>
</body>
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