summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/input/placeholder-wrongly-placed-if-too-tall.html
blob: 523f5691f4c198a8b70249605ac9b375ef976d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<style>
input {
    height: 26px;
    line-height: 29px;
    padding: 0 5px;
    border: none;
    border-bottom: 1px solid #888;
    outline: none;
}
</style>
<div>Both inputs should be of the same size and the placeholder should be at the same place.</div>
<div id="console"></div>
<input type="text" placeholder="placeholder">
<input type="text" placeholder="placeholder">
<script>
window.jsTestIsAsync = true;

var inputs = document.getElementsByTagName("input");

function checkInputs()
{
    rect0 = inputs[0].getBoundingClientRect();
    rect1 = inputs[1].getBoundingClientRect();
    shouldBe("rect0.top", "rect1.top");
    shouldBe("rect0.height", "rect1.height");

    finishJSTest();
}

inputs[1].focus();
// Forcing a layout in this frame makes the issue disappear.
window.requestAnimationFrame(checkInputs);
</script>
<script src="../../resources/js-test.js"></script>