layout/forms/test/bug287446_subframe.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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           var t = $("target");
    17           if (evt.data == "start") {
    18             doIs(t.value, "Test", "Shouldn't have lost our initial value");
    19             t.focus();
    20             sendString("Foo");
    21             doIs(t.value, "FooTest", "Typing should work");
    22             window.parent.postMessage("c", "*");
    23           } else {
    24             doIs(evt.data, "continue", "Unexpected message");
    25             doIs(t.value, "FooTest", "Shouldn't have lost our typed value");
    26             sendString("Bar");
    27             doIs(t.value, "BarFooTest", "Typing should still work");
    28             window.parent.postMessage("f", "*");
    29           }
    30         },
    31         "false");
    33     </script>
    34   </head>
    35   <body>
    36     <input id="target" value="Test">
    37   </body>
    38 </html>

mercurial