diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/frame/DOMWindow.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/frame/DOMWindow.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chromium/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/chromium/third_party/WebKit/Source/core/frame/DOMWindow.cpp index a02e3cc70b2..a64e9e20cf4 100644 --- a/chromium/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/chromium/third_party/WebKit/Source/core/frame/DOMWindow.cpp @@ -97,7 +97,10 @@ DOMWindow* DOMWindow::opener() const DOMWindow* DOMWindow::parent() const { - if (!frame()) + // TODO(yukishiino): The 'parent' attribute must return |this| + // (the WindowProxy object of the browsing context itself) when it's + // top-level or detached. + if (!isCurrentlyDisplayedInFrame()) return nullptr; Frame* parent = frame()->tree().parent(); @@ -106,7 +109,10 @@ DOMWindow* DOMWindow::parent() const DOMWindow* DOMWindow::top() const { - if (!frame()) + // TODO(yukishiino): The 'top' attribute must return |this| + // (the WindowProxy object of the browsing context itself) when it's + // top-level or detached. + if (!isCurrentlyDisplayedInFrame()) return nullptr; return frame()->tree().top()->domWindow(); |