summaryrefslogtreecommitdiffstats
path: root/dom/inputmethod/mochitest/file_inputmethod.html
blob: 193cb050567c9d7033dda9434061e2cc94eea066 (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
<html>
<body>
<script>
  var im = navigator.mozInputMethod;
  if (im) {
    im.oninputcontextchange = onIcc;

    if (im.inputcontext) {
      onIcc();
    }
  }

  function onIcc() {
    var ctx = im.inputcontext;
    if (ctx) {
      ctx.replaceSurroundingText(location.hash).then(function() {
        /* Happy flow */
      }, function(err) {
        dump('ReplaceSurroundingText failed ' + err + '\n');
      });
    }
  }
</script>
</body>
</html>