binding: Window-returning attributes return null if a Window is detached.

Makes the attributes that return a WindowProxy return null if the
browsing context of the Window is detached in order to avoid crashes
that are caused by accessing to a ScriptState for the detached browsing
context.

This is a kind of first aid, and not the right fix.  The spec requires
DOM attributes such as Window.parent or top to return the WindowProxy
of the browsing context if it's detached.  I.e. we need to fully support
detached frames.

BUG=621730,621577

Review-Url: https://codereview.chromium.org/2085983002
Cr-Commit-Position: refs/heads/master@{#401007}
2 files changed