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

Unified Diff: Source/bindings/v8/V8AbstractEventListener.cpp

Issue 22893051: Add support for BeforeUnloadEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test failures Created 7 years, 4 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 | « LayoutTests/webexposed/global-constructors-listing-expected.txt ('k') | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8AbstractEventListener.cpp
diff --git a/Source/bindings/v8/V8AbstractEventListener.cpp b/Source/bindings/v8/V8AbstractEventListener.cpp
index f1f0c8aa7ea2b6925c1c6338417a4a8739945394..64c057cf63d21d90531360d33925b2acf65f6e9d 100644
--- a/Source/bindings/v8/V8AbstractEventListener.cpp
+++ b/Source/bindings/v8/V8AbstractEventListener.cpp
@@ -37,6 +37,7 @@
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8EventListenerList.h"
#include "bindings/v8/V8HiddenPropertyName.h"
+#include "core/dom/BeforeUnloadEvent.h"
#include "core/dom/Document.h"
#include "core/dom/Event.h"
#include "core/dom/EventNames.h"
@@ -157,8 +158,8 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context
if (returnValue.IsEmpty())
return;
- if (!returnValue->IsNull() && !returnValue->IsUndefined() && event->storesResultAsString())
- event->storeResult(toWebCoreString(returnValue));
+ if (!returnValue->IsNull() && !returnValue->IsUndefined() && event->isBeforeUnloadEvent())
+ toBeforeUnloadEvent(event)->setReturnValue(toWebCoreString(returnValue));
if (m_isAttribute && shouldPreventDefault(returnValue))
event->preventDefault();
« no previous file with comments | « LayoutTests/webexposed/global-constructors-listing-expected.txt ('k') | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698