blob: 9436ba6cb723dc485f6498810f050831fc09e8d2 (
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
|
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<input id="input"><input id="input2">
<script>
description("This tests inputMethodContext attribute which is an additional interface for HTMLElement.");
var html = document.documentElement;
// Checks creating an InputMethodContext object via new throws exception.
shouldThrow('new InputMethodContext()');
// Checks existence of .inputMethodContext attribute.
shouldBeNonNull(html.inputMethodContext);
shouldBeEqualToString('typeof(html.inputMethodContext)', 'object');
// Checks inputMethodContext returns an InputMethodContext object.
var context = html.inputMethodContext;
shouldBeTrue('context instanceof InputMethodContext');
// Checks the same InputMethodContext objects are returned from an element.
var context2 = html.inputMethodContext;
shouldBeTrue('context2 instanceof InputMethodContext');
shouldBeTrue('context === context2');
// Checks if contexts for different elements are different.
var inputContext = document.getElementById('input').inputMethodContext;
var input2Context = document.getElementById('input2').inputMethodContext;
shouldNotBe('inputContext', 'input2Context');
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
|