dom/tests/mochitest/dom-level0/child_ip_address.html
author vladimir@pobox.com
Tue, 18 Mar 2008 13:30:16 -0700
changeset 13263 601ea65a1056a0594fb2514e6c8387d2794c99f1
parent 11364 e178412af25d5af6d62e6fb7da4afd4403f96141
child 14898 c29d990c4499d37578a6a4c8679a5c9e80f02ccf
permissions -rw-r--r--
b=422661, long table border rendered incompletely (wrong coordinate conditioning in gfxRect), r+sr=roc

<!DOCTYPE html>
<html>
<head>
  <title>Child window at 127.0.0.1</title>
  <script type="application/javascript">
function run()
{
  var target = document.getElementById("location");
  target.textContent = location.hostname + ":" + (location.port || 80);

  var message = "child-response";

  var domain = document.domain;
  if (domain !== "127.0.0.1")
    message += " wrong-initial-domain(" + domain + ")";

  try
  {
    document.domain = "0.0.1";
    domain = document.domain;
    message += " ip-address-shortened-to(" + domain + ")";
  }
  catch (e)
  {
    domain = document.domain;
    if (domain !== "127.0.0.1")
      message += " ip-address-mutated-on-throw(" + domain + ")";
  }

  window.parent.postMessage(message);
}

window.addEventListener("load", run, false);
  </script>
</head>
<body>
<h1 id="location">Somewhere!</h1>
</body>
</html>