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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp

Issue 2399813002: Return null when window.open blocks a popup. (Closed)
Patch Set: Created 4 years, 2 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/LayoutTests/fast/history/window-open-blocked-expected.txt ('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/bindings/core/v8/custom/V8WindowCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
index 176a6376689567713d4f45fe2c10e2f45e7a6160..7640aff78f21e0b9c9c03fed995a059038eb23e8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8WindowCustom.cpp
@@ -239,6 +239,7 @@ void V8Window::openMethodCustom(
"Window", info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()),
impl, exceptionState)) {
+ v8SetReturnValueNull(info);
return;
}
@@ -259,8 +260,10 @@ void V8Window::openMethodCustom(
DOMWindow* openedWindow = toLocalDOMWindow(impl)->open(
urlString, frameName, windowFeaturesString,
currentDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()));
- if (!openedWindow)
+ if (!openedWindow) {
+ v8SetReturnValueNull(info);
return;
+ }
v8SetReturnValueFast(info, openedWindow, impl);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/history/window-open-blocked-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698