Bug 860344 - Define mocks based on document domain

Instead of inferring the document's domain from the `location` object,
query the global `document.domain` string. This approach acheives the
desired behavior for iFrames that do not declare a `src` attribute (in
such cases, `location.toString()` yeilds "about:blank", but
`document.domain` correctly returns the domain of the parent document.