layout/forms/test/bug477700_subframe.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE html>
     2 <html>
     3   <head>
     4     <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     5     <script>
     6       function doIs(arg1, arg2, arg3) {
     7         window.parent.postMessage("t " + encodeURIComponent(arg1) + " " +
     8                                   encodeURIComponent(arg2) + " " +
     9                                   encodeURIComponent(arg3), "*");
    10       }
    12       function $(arg) { return document.getElementById(arg); }
    14       window.addEventListener("message",
    15         function(evt) {
    16           doIs(evt.data, "start", "Unexpected message");
    17           $("target").focus();
    18           sendString("Test");
    19           var t = $("target");
    20           doIs(t.value, "Test", "Typing should work");
    21           (function() {
    22             SpecialPowers.wrap(t).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor.undo(1);
    23           })()
    24           doIs(t.value, "", "Undo should work");
    25           (function() {
    26             SpecialPowers.wrap(t).QueryInterface(SpecialPowers.Ci.nsIDOMNSEditableElement).editor.redo(1);
    27           })()
    28           doIs(t.value, "Test", "Redo should work");
    29           window.parent.postMessage("f", "*");
    30         },
    31         "false");
    33     </script>
    34   </head>
    35   <body>
    36     <input id="target">
    37   </body>
    38 </html>

mercurial