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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ToV8.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 | « no previous file | third_party/WebKit/Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ToV8.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.cpp b/third_party/WebKit/Source/bindings/core/v8/ToV8.cpp
index c499b7c9ab9e39341598849bfa127e98d83133a0..f09ab370ab8b9a4c6e9a31d3d3ee3050172ce3a1 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.cpp
@@ -20,12 +20,17 @@ v8::Local<v8::Value> toV8(DOMWindow* window, v8::Local<v8::Object> creationConte
if (UNLIKELY(!window))
return v8::Null(isolate);
- // Initializes environment of a frame, and return the global object
- // of the frame.
- Frame * frame = window->frame();
- if (!frame)
+
+ // TODO(yukishiino): There must be no case to return undefined.
+ // 'window', 'frames' and 'self' attributes in Window interface return
+ // the WindowProxy object of the browsing context, which never be undefined.
+ // 'top' and 'parent' attributes return the same when detached. Therefore,
+ // there must be no case to return undefined.
+ // See http://crbug.com/621730 and http://crbug.com/621577 .
+ if (!window->isCurrentlyDisplayedInFrame())
return v8Undefined();
+ Frame* frame = window->frame();
return frame->windowProxy(DOMWrapperWorld::current(isolate))->globalIfNotDetached();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/DOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698