layout/forms/test/bug477700_subframe.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/test/bug477700_subframe.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +  <head>
     1.7 +    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     1.8 +    <script>
     1.9 +      function doIs(arg1, arg2, arg3) {
    1.10 +        window.parent.postMessage("t " + encodeURIComponent(arg1) + " " +
    1.11 +                                  encodeURIComponent(arg2) + " " +
    1.12 +                                  encodeURIComponent(arg3), "*");
    1.13 +      }
    1.14 +
    1.15 +      function $(arg) { return document.getElementById(arg); }
    1.16 +
    1.17 +      window.addEventListener("message",
    1.18 +        function(evt) {
    1.19 +          doIs(evt.data, "start", "Unexpected message");
    1.20 +          $("target").focus();
    1.21 +          sendString("Test");
    1.22 +          var t = $("target");
    1.23 +          doIs(t.value, "Test", "Typing should work");
    1.24 +          (function() {
    1.25 +            SpecialPowers.wrap(t).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor.undo(1);
    1.26 +          })()
    1.27 +          doIs(t.value, "", "Undo should work");
    1.28 +          (function() {
    1.29 +            SpecialPowers.wrap(t).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor.redo(1);
    1.30 +          })()
    1.31 +          doIs(t.value, "Test", "Redo should work");
    1.32 +          window.parent.postMessage("f", "*");
    1.33 +        },
    1.34 +        "false");
    1.35 +      
    1.36 +    </script>
    1.37 +  </head>
    1.38 +  <body>
    1.39 +    <input id="target">
    1.40 +  </body>
    1.41 +</html>
    1.42 +           

mercurial