diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/chromium/third_party/WebKit/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/chromium/third_party/WebKit/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp index 49f76e73080..1f1a99bf49f 100644 --- a/chromium/third_party/WebKit/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp +++ b/chromium/third_party/WebKit/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp @@ -29,20 +29,20 @@ */ #include "config.h" -#include "V8HTMLDocument.h" +#include "bindings/core/v8/V8HTMLDocument.h" -#include "HTMLNames.h" -#include "V8HTMLAllCollection.h" -#include "V8HTMLCollection.h" -#include "V8Node.h" -#include "V8Window.h" +#include "bindings/core/v8/V8HTMLAllCollection.h" +#include "bindings/core/v8/V8HTMLCollection.h" +#include "bindings/core/v8/V8Node.h" +#include "bindings/core/v8/V8Window.h" #include "bindings/v8/ScriptController.h" #include "bindings/v8/V8Binding.h" +#include "core/HTMLNames.h" +#include "core/frame/LocalFrame.h" #include "core/html/HTMLAllCollection.h" #include "core/html/HTMLCollection.h" #include "core/html/HTMLDocument.h" #include "core/html/HTMLIFrameElement.h" -#include "core/frame/Frame.h" #include "wtf/OwnPtr.h" #include "wtf/RefPtr.h" #include "wtf/StdLibExtras.h" @@ -56,15 +56,18 @@ void V8HTMLDocument::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder()); if (info.Length() > 2) { - if (RefPtr<Frame> frame = htmlDocument->frame()) { + if (RefPtr<LocalFrame> frame = htmlDocument->frame()) { // Fetch the global object for the frame. - v8::Local<v8::Context> context = frame->script().currentWorldContext(); + v8::Local<v8::Context> context = toV8Context(frame.get(), DOMWrapperWorld::current(info.GetIsolate())); // Bail out if we cannot get the context. if (context.IsEmpty()) return; v8::Local<v8::Object> global = context->Global(); // Get the open property of the global object. v8::Local<v8::Value> function = global->Get(v8AtomicString(info.GetIsolate(), "open")); + // Failed; return without throwing (new) exception. + if (function.IsEmpty()) + return; // If the open property is not a function throw a type error. if (!function->IsFunction()) { throwTypeError("open is not a function", info.GetIsolate()); @@ -80,7 +83,11 @@ void V8HTMLDocument::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& } } - htmlDocument->open(activeDOMWindow()->document()); + ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Document", info.Holder(), info.GetIsolate()); + htmlDocument->open(callingDOMWindow(info.GetIsolate())->document(), exceptionState); + if (exceptionState.throwIfNeeded()) + return; + v8SetReturnValue(info, info.Holder()); } |