From 7cc0fb918af8d28650a52542194a97d2e6cceb5a Mon Sep 17 00:00:00 2001
From: libm
Date: Wed, 2 Jul 2014 14:10:06 +0800
Subject: [PATCH] Fixed issue #1973
https://github.com/rogerwang/node-webkit/issues/1973 Some attributes should
be available even after the frame is destroyed.
---
Source/bindings/v8/custom/V8WindowCustom.cpp | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/Source/bindings/v8/custom/V8WindowCustom.cpp b/Source/bindings/v8/custom/V8WindowCustom.cpp
index 30bad6868be..daba518f92e 100644
--- a/Source/bindings/v8/custom/V8WindowCustom.cpp
+++ b/Source/bindings/v8/custom/V8WindowCustom.cpp
@@ -158,8 +158,7 @@ void V8Window::parentAttributeGetterCustom(const v8::PropertyCallbackInfoframe();
- ASSERT(frame);
- if (frame->isNwFakeTop()) {
+ if (frame && frame->isNwFakeTop()) {
v8SetReturnValue(info, toV8(imp, info.Holder(), info.GetIsolate()));
return;
}
@@ -170,7 +169,7 @@ void V8Window::topAttributeGetterCustom(const v8::PropertyCallbackInfoframe();
- ASSERT(frame);
+
for (LocalFrame* f = frame; f; f = f->tree().parent()) {
if (f->isNwFakeTop()) {
v8SetReturnValue(info, toV8(f->document()->domWindow(), info.Holder(), info.GetIsolate()));
@@ -240,18 +239,17 @@ void V8Window::eventAttributeSetterCustom(v8::Local value, const v8::
void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo& info)
{
DOMWindow* impl = V8Window::toNative(info.Holder());
- LocalFrame* frame = impl->frame();
- if (frame->isNwFakeTop()) {
- v8SetReturnValue(info, v8::Null(info.GetIsolate()));
- return;
- }
ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Window", info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), impl->frameElement(), exceptionState)) {
v8SetReturnValueNull(info);
exceptionState.throwIfNeeded();
return;
}
-
+ LocalFrame* frame = impl->frame();
+ if (frame->isNwFakeTop()) {
+ v8SetReturnValue(info, v8::Null(info.GetIsolate()));
+ return;
+ }
// The wrapper for an