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
23 lines
750 B
HTML
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>
|