summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/validation-message-on-range.html
blob: 2494e60f5fb1f950c1f553e3bc27398d267c5c2e (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
36
37
38
39
40
41
<!DOCTYPE html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
<script src="resources/common.js"></script>
</head>
<body>
<p>Check if the position of a validation message for a range control is good.</p>

<form action="validation-message-on-range.html">
<input type=range id=host required>
<input type=submit id=submit>
</form>

<div id="console"></div>
<script>
function check() {
    hostRect = getAbsoluteRect(host);
    bubbleRect = getAbsoluteRect(getValidationMessageBubbleNode(host));
    debug('The top of the bubble should be on the bottom of the host node:');
    shouldBe('bubbleRect.top', 'hostRect.bottom');
    debug('');

    finishJSTest();
}

var host = $('host');
var hostRect;
var bubbleRect;
host.setCustomValidity('Invalid Value');
$('submit').click();
if (window.testRunner) {
    setTimeout(check, 0);
} else {
    debug('The test requires testRunner.');
}

var jsTestIsAsync = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>