diff options
author | Ben Murdoch <benm@google.com> | 2012-06-01 04:43:09 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-06-01 04:43:09 -0700 |
commit | c69907062387aaedf35962337b254c01893d398b (patch) | |
tree | 0b7232fd98dd338ec08ddc1825fecb399c7b75ea /Source | |
parent | c40f87a1970b5377976087f2ffb4f0c621d39fd5 (diff) | |
parent | 678de4acf72e6fd4c6fb9426d2c69445acc18135 (diff) | |
download | external_webkit-c69907062387aaedf35962337b254c01893d398b.zip external_webkit-c69907062387aaedf35962337b254c01893d398b.tar.gz external_webkit-c69907062387aaedf35962337b254c01893d398b.tar.bz2 |
am 678de4ac: Fix document.createTouchList crash.
* commit '678de4acf72e6fd4c6fb9426d2c69445acc18135':
Fix document.createTouchList crash.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp | 6 | ||||
-rw-r--r-- | Source/WebCore/dom/Document.cpp | 6 | ||||
-rw-r--r-- | Source/WebCore/dom/Document.h | 1 |
3 files changed, 3 insertions, 10 deletions
diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp index 7cad58e..d142a9f 100644 --- a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp @@ -43,6 +43,7 @@ #include "V8CanvasRenderingContext2D.h" #include "V8CustomXPathNSResolver.h" #include "V8DOMImplementation.h" +#include "V8DOMWrapper.h" #include "V8HTMLDocument.h" #include "V8IsolatedContext.h" #include "V8Node.h" @@ -144,9 +145,8 @@ v8::Handle<v8::Value> V8Document::createTouchListCallback(const v8::Arguments& a RefPtr<TouchList> touchList = TouchList::create(); for (int i = 0; i < args.Length(); i++) { - if (!args[i]->IsObject()) - return v8::Undefined(); - touchList->append(V8Touch::toNative(args[i]->ToObject())); + Touch* touch = V8DOMWrapper::isWrapperOfType(args[i], &V8Touch::info) ? V8Touch::toNative(args[i]->ToObject()) : 0; + touchList->append(touch); } return toV8(touchList.release()); diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index ff50390..b6a1393 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -5064,15 +5064,9 @@ PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, // http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html // when this method should throw and nor is it by inspection of iOS behavior. It would be nice to verify any cases where it throws under iOS // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=47819 - // Ditto for the createTouchList method below. Frame* frame = window ? window->frame() : this->frame(); return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY); } - -PassRefPtr<TouchList> Document::createTouchList(ExceptionCode&) const -{ - return TouchList::create(); -} #endif DocumentLoader* Document::loader() const diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h index a4fc266..ce82b2e 100644 --- a/Source/WebCore/dom/Document.h +++ b/Source/WebCore/dom/Document.h @@ -1085,7 +1085,6 @@ public: #if ENABLE(TOUCH_EVENTS) PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const; - PassRefPtr<TouchList> createTouchList(ExceptionCode&) const; #endif const DocumentTiming* timing() const { return &m_documentTiming; } |