fune/testing/web-platform/tests/css/css-overflow/scrollable-overflow-input-001.html
Ting-Yu Lin 73a9108de9 Bug 1715291 - Fix text in <input> is clipped by inline-end padding. r=emilio
The fix in Bug 1696885 is not correct when the width of the text in
<input> is shorter than the width of the <input>, but is long enough to
be covered by its inline-end padding.

This patch's idea is similar to the old code [1] before applying bug
1696885, but only tweak the scrollable overflow area in the inline axis.

[1] https://searchfox.org/mozilla-central/rev/c3ee9188d2f9020764db9daf8fa47a07fa3311c9/layout/generic/nsGfxScrollFrame.cpp#785-806

Differential Revision: https://phabricator.services.mozilla.com/D123244
2021-08-20 21:41:46 +00:00

28 lines
916 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Overflow Test: Test the text in an input is not clipped and reachable</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#scrollable">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1715291">
<link rel="match" href="scrollable-overflow-input-001-ref.html">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
input {
box-sizing: border-box;
width: 160px;
padding-inline: 20px 60px;
background: yellow;
font: 20px/1 Ahem;
border: 0;
}
</style>
<!-- The total width of the text (120px) must be less than the <input>'s
width (160px) to reproduce this bug. -->
<input id="input" value="X XpX">
<script>
document.getElementById('input').scrollLeft = 1000;
</script>