Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 2085983002: binding: Window-returning attributes return null if a Window is detached. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698