<!DOCTYPE html>
<meta charset=utf-8>
<title>Realm for constructed objects</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
function object_realm(dp) {
  // Note that browsers use the URL of the relevant global object's associated
  // Document.
  // https://github.com/w3c/DOM-Parsing/issues/46
  var url = DOMParser.prototype.parseFromString.call(dp, "x", "text/html").documentURI;
  var file = url.slice(url.lastIndex