| Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| index e871c8ecf676f20c475382f282e344ecf1c897e5..233d4e4736d575c1c847afdf66ea1a830fb0d5b8 100644
|
| --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
|
| @@ -103,7 +103,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();
|
| @@ -112,7 +115,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();
|
|
|