diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 00:38:59 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 00:38:59 +0000 |
commit | 0ff03ae3f1bf6f877a4aa32263f6418f2c5797d2 (patch) | |
tree | d617e74942b96732377eea966d146309743b1c3d | |
parent | 3fbfa3fb89128ea61adf02c63f2cf4e1121c7933 (diff) | |
download | chromium_src-0ff03ae3f1bf6f877a4aa32263f6418f2c5797d2.zip chromium_src-0ff03ae3f1bf6f877a4aa32263f6418f2c5797d2.tar.gz chromium_src-0ff03ae3f1bf6f877a4aa32263f6418f2c5797d2.tar.bz2 |
Rollback 10840.
Review URL: http://codereview.chromium.org/40075
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10846 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | webkit/build/V8Bindings/SConscript | 2 | ||||
-rw-r--r-- | webkit/build/V8Bindings/V8Bindings.vcproj | 8 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.cpp | 39 | ||||
-rw-r--r-- | webkit/port/bindings/v8/v8_custom.h | 8 | ||||
-rw-r--r-- | webkit/webkit.gyp | 1 |
6 files changed, 44 insertions, 16 deletions
@@ -19,7 +19,7 @@ deps = { "http://googletest.googlecode.com/svn/trunk@167", "src/third_party/WebKit": - "/trunk/deps/third_party/WebKit@10829", + "/trunk/deps/third_party/WebKit@10784", "src/third_party/icu38": "/trunk/deps/third_party/icu38@10692", diff --git a/webkit/build/V8Bindings/SConscript b/webkit/build/V8Bindings/SConscript index a1763aa..e3b0415 100644 --- a/webkit/build/V8Bindings/SConscript +++ b/webkit/build/V8Bindings/SConscript @@ -358,12 +358,10 @@ 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 6246f35..2308aa4 100644 --- a/webkit/build/V8Bindings/V8Bindings.vcproj +++ b/webkit/build/V8Bindings/V8Bindings.vcproj @@ -148,10 +148,6 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\v8\custom\V8DocumentCustom.cpp" - > - </File> - <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\v8\custom\V8DOMParserConstructor.cpp" > </File> @@ -168,10 +164,6 @@ > </File> <File - RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\v8\custom\V8HTMLCanvasElementCustom.cpp" - > - </File> - <File RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\v8\custom\V8HTMLCollectionCustom.cpp" > </File> diff --git a/webkit/port/bindings/v8/v8_custom.cpp b/webkit/port/bindings/v8/v8_custom.cpp index 7b4ccdd..ecbe1b8 100644 --- a/webkit/port/bindings/v8/v8_custom.cpp +++ b/webkit/port/bindings/v8/v8_custom.cpp @@ -970,8 +970,47 @@ CALLBACK_FUNC_DECL(HTMLDocumentOpen) { return args.Holder(); } +// Document -------------------------------------------------------------------- +CALLBACK_FUNC_DECL(DocumentEvaluate) { + INC_STATS("DOM.Document.evaluate()"); + Document* imp = V8Proxy::DOMWrapperToNode<Document>(args.Holder()); + ExceptionCode ec = 0; + String expression = ToWebCoreString(args[0]); + Node* contextNode = NULL; + if (V8Node::HasInstance(args[1])) { + contextNode = V8Proxy::DOMWrapperToNode<Node>(args[1]); + } + // Find the XPath + XPathNSResolver* resolver = NULL; + if (V8XPathNSResolver::HasInstance(args[2])) { + resolver = V8Proxy::ToNativeObject<XPathNSResolver>( + V8ClassIndex::XPATHNSRESOLVER, args[2]); + } else if (args[2]->IsObject()) { + v8::Handle<v8::Object> obj = args[2]->ToObject(); + resolver = new JSXPathNSResolver(obj); + } else if (!args[2]->IsNull() && !args[2]->IsUndefined()) { + V8Proxy::SetDOMException(TYPE_MISMATCH_ERR); + return v8::Handle<v8::Value>(); + } + int type = ToInt32(args[3]); + XPathResult* inResult = NULL; + if (V8XPathResult::HasInstance(args[4])) { + inResult = V8Proxy::ToNativeObject<XPathResult>( + V8ClassIndex::XPATHRESULT, args[4]); + } + + v8::TryCatch try_catch; + RefPtr<XPathResult> 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<v8::Value>(); + } + 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 16e9359..2afbfc8 100644 --- a/webkit/port/bindings/v8/v8_custom.h +++ b/webkit/port/bindings/v8/v8_custom.h @@ -228,9 +228,6 @@ 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) @@ -274,7 +271,10 @@ DECLARE_CALLBACK(HTMLDocumentOpen) // Document customized functions DECLARE_CALLBACK(DocumentEvaluate) -DECLARE_CALLBACK(DocumentGetCSSCanvasContext) +DECLARE_CALLBACK(DocumentQuerySelector) +DECLARE_CALLBACK(DocumentQuerySelectorAll) +DECLARE_CALLBACK(DocumentFragmentQuerySelector) +DECLARE_CALLBACK(DocumentFragmentQuerySelectorAll) // Window customized functions DECLARE_CALLBACK(DOMWindowAddEventListener) diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index cb21aac..7c2e33c 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -976,7 +976,6 @@ '../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', |