Files
sousa-gecko/testing/web-platform/tests/html/rendering/widgets/placeholder-scroll.html
T
Emilio Cobos Álvarez 3cf5d675af Bug 2045660 - Prevent placeholder from creating overflow in <input>. r=TYLin
This matches other browsers and allows text-overflow: ellipsis to work
as it used pre-regression. Added tests for both things.

Differential Revision: https://phabricator.services.mozilla.com/D306606
2026-06-13 16:30:12 +00:00

23 lines
750 B
HTML

<!doctype html>
<meta charset="utf-8">
<title>Placeholder overflow behavior for input and textarea</title>
<link rel="help" href="https://html.spec.whatwg.org/#the-input-element-as-a-text-entry-widget">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
::placeholder {
white-space: nowrap;
}
</style>
<input id=i placeholder="something very very very very long">
<textarea id=t placeholder="something very very very very long"></textarea>
<script>
test(() => {
assert_equals(i.scrollWidth, i.clientWidth);
}, "Placeholder does not cause overflow on input");
test(() => {
assert_greater_than(t.scrollWidth, t.clientWidth);
}, "Placeholder causes overflow on textarea");
</script>