fune/testing/web-platform/tests/css/css-overflow/text-overflow-ellipsis-rtl-001.html
Manuel Rego Casasnovas 29dbb350b7 Bug 1624121 [wpt PR 22380] - Fix ellipsis position for RTL elements, a=testonly
Automatic update from web-platform-tests
Fix ellipsis position for RTL elements

In ShapeResult::OffsetToFit() when the size to fit
matches result.origin_x we were returning
the left_character_index only if Direction() was RTL.
However if line_direction is RTL we also want that index.

With this change css/css-ui/text-overflow-028.html starts to pass
on Linus and Windows, we add new tests here too
(the RTL ones were failing before this patch).

BUG=1063319
TEST=css/css-overflow/text-overflow-ellipsis-001.html
TEST=css/css-overflow/text-overflow-ellipsis-rtl-001.html
TEST=css/css-overflow/text-overflow-ellipsis-vertical-001.html
TEST=css/css-overflow/text-overflow-ellipsis-vertical-ltr-001.html

Change-Id: Idbaed07a63d4ec6335e722b7fb7b4e91f4076564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2111152
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#752380}

--

wpt-commits: 38792095c98039542ed3a3f0d2eb384b576f6cb7
wpt-pr: 22380
2020-03-26 11:40:04 +00:00

22 lines
829 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow: text-overflow: ellipsis RTL</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-overflow-4/#ellipsis-scrolling">
<link rel="match" href="reference/text-overflow-ellipsis-rtl-001-ref.html">
<meta name="assert" content="Check that ellipsis is placed on the right position on the container boundaries in elements with 'text-overflow: ellipsis' in RTL.">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
div {
font: 100px/1 Ahem;
width: 400px;
white-space: pre;
overflow: hidden;
text-overflow: ellipsis;
direction: rtl;
}
</style>
<p>The test passes if it matches the reference.</p>
<div>ppp</div>
<div>pppp</div>
<div>ppppp</div>