From c748340691a49d901250aeac87825a1a3afcaf5c Mon Sep 17 00:00:00 2001 From: "mbelshe@google.com" Date: Tue, 3 Mar 2009 23:31:55 +0000 Subject: Unforking Document.idl and HTMLCanvasElement.idl Depends on corresponding WebKit change - will add DEPS later. Review URL: http://codereview.chromium.org/39050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10840 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/build/V8Bindings/SConscript | 2 ++ webkit/build/V8Bindings/V8Bindings.vcproj | 8 +++++++ webkit/port/bindings/v8/v8_custom.cpp | 39 ------------------------------- webkit/port/bindings/v8/v8_custom.h | 8 +++---- webkit/webkit.gyp | 1 + 5 files changed, 15 insertions(+), 43 deletions(-) (limited to 'webkit') diff --git a/webkit/build/V8Bindings/SConscript b/webkit/build/V8Bindings/SConscript index e3b0415..a1763aa 100644 --- a/webkit/build/V8Bindings/SConscript +++ b/webkit/build/V8Bindings/SConscript @@ -358,10 +358,12 @@ inputs = [ '$WEBCORE_DIR/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8ClipboardCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp', + '$WEBCORE_DIR/bindings/v8/custom/V8DocumentCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8DOMParserConstructor.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8DOMStringListCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8DOMWindowCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8EventCustom.cpp', + '$WEBCORE_DIR/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8HTMLCollectionCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8HTMLDocumentCustom.cpp', '$WEBCORE_DIR/bindings/v8/custom/V8HTMLFormElementCustom.cpp', diff --git a/webkit/build/V8Bindings/V8Bindings.vcproj b/webkit/build/V8Bindings/V8Bindings.vcproj index 2308aa4..6246f35 100644 --- a/webkit/build/V8Bindings/V8Bindings.vcproj +++ b/webkit/build/V8Bindings/V8Bindings.vcproj @@ -148,6 +148,10 @@ > + + @@ -164,6 +168,10 @@ > + + diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp index ecbe1b8..7b4ccdd 100644 --- a/webkit/port/bindings/v8/v8_custom.cpp +++ b/webkit/port/bindings/v8/v8_custom.cpp @@ -970,47 +970,8 @@ CALLBACK_FUNC_DECL(HTMLDocumentOpen) { return args.Holder(); } -// Document -------------------------------------------------------------------- -CALLBACK_FUNC_DECL(DocumentEvaluate) { - INC_STATS("DOM.Document.evaluate()"); - Document* imp = V8Proxy::DOMWrapperToNode(args.Holder()); - ExceptionCode ec = 0; - String expression = ToWebCoreString(args[0]); - Node* contextNode = NULL; - if (V8Node::HasInstance(args[1])) { - contextNode = V8Proxy::DOMWrapperToNode(args[1]); - } - // Find the XPath - XPathNSResolver* resolver = NULL; - if (V8XPathNSResolver::HasInstance(args[2])) { - resolver = V8Proxy::ToNativeObject( - V8ClassIndex::XPATHNSRESOLVER, args[2]); - } else if (args[2]->IsObject()) { - v8::Handle obj = args[2]->ToObject(); - resolver = new JSXPathNSResolver(obj); - } else if (!args[2]->IsNull() && !args[2]->IsUndefined()) { - V8Proxy::SetDOMException(TYPE_MISMATCH_ERR); - return v8::Handle(); - } - int type = ToInt32(args[3]); - XPathResult* inResult = NULL; - if (V8XPathResult::HasInstance(args[4])) { - inResult = V8Proxy::ToNativeObject( - V8ClassIndex::XPATHRESULT, args[4]); - } - - v8::TryCatch try_catch; - RefPtr result = - imp->evaluate(expression, contextNode, resolver, type, inResult, ec); - if (try_catch.HasCaught() || ec != 0) { - if (!try_catch.HasCaught()) - V8Proxy::SetDOMException(ec); - return v8::Handle(); - } - return V8Proxy::ToV8Object(V8ClassIndex::XPATHRESULT, result.get()); -} // DOMWindow ------------------------------------------------------------------- diff --git a/webkit/port/bindings/v8/v8_custom.h b/webkit/port/bindings/v8/v8_custom.h index 2afbfc8..16e9359 100644 --- a/webkit/port/bindings/v8/v8_custom.h +++ b/webkit/port/bindings/v8/v8_custom.h @@ -228,6 +228,9 @@ DECLARE_PROPERTY_ACCESSOR(DOMWindowEventHandler) // Getter/Setter for Element event handlers DECLARE_PROPERTY_ACCESSOR(ElementEventHandler) +// HTMLCanvasElement +DECLARE_CALLBACK(HTMLCanvasElementGetContext) + // Customized setter of src and location on HTMLFrameElement DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementSrc) DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementLocation) @@ -271,10 +274,7 @@ DECLARE_CALLBACK(HTMLDocumentOpen) // Document customized functions DECLARE_CALLBACK(DocumentEvaluate) -DECLARE_CALLBACK(DocumentQuerySelector) -DECLARE_CALLBACK(DocumentQuerySelectorAll) -DECLARE_CALLBACK(DocumentFragmentQuerySelector) -DECLARE_CALLBACK(DocumentFragmentQuerySelectorAll) +DECLARE_CALLBACK(DocumentGetCSSCanvasContext) // Window customized functions DECLARE_CALLBACK(DOMWindowAddEventListener) diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 7c2e33c..cb21aac 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -976,6 +976,7 @@ '../third_party/WebKit/WebCore/bindings/v8/custom/V8EventCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp', + '../third_party/WebKit/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp', '../third_party/WebKit/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp', -- cgit v1.1