diff options
Diffstat (limited to 'Source/WebCore/bindings')
11 files changed, 43 insertions, 11 deletions
diff --git a/Source/WebCore/bindings/js/GCController.cpp b/Source/WebCore/bindings/js/GCController.cpp index f193b2e..fe0e36f 100644 --- a/Source/WebCore/bindings/js/GCController.cpp +++ b/Source/WebCore/bindings/js/GCController.cpp @@ -29,7 +29,7 @@ #include "JSDOMWindow.h" #include <runtime/JSGlobalData.h> #include <runtime/JSLock.h> -#include <runtime/Collector.h> +#include <runtime/Heap.h> #include <wtf/StdLibExtras.h> #if USE(PTHREADS) diff --git a/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp b/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp index a0e0455..ceb3ccb 100644 --- a/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp +++ b/Source/WebCore/bindings/js/JSDirectoryEntryCustom.cpp @@ -34,6 +34,7 @@ #include "JSDirectoryEntry.h" +#include "ExceptionCode.h" #include "JSDOMBinding.h" #include "JSEntryCallback.h" #include "JSErrorCallback.h" diff --git a/Source/WebCore/bindings/js/JSDocumentCustom.cpp b/Source/WebCore/bindings/js/JSDocumentCustom.cpp index 5f61e2a..4cc176c 100644 --- a/Source/WebCore/bindings/js/JSDocumentCustom.cpp +++ b/Source/WebCore/bindings/js/JSDocumentCustom.cpp @@ -31,8 +31,11 @@ #include "JSDOMWindowCustom.h" #include "JSHTMLDocument.h" #include "JSLocation.h" +#include "JSTouch.h" +#include "JSTouchList.h" #include "Location.h" #include "ScriptController.h" +#include "TouchList.h" #if ENABLE(SVG) #include "JSSVGDocument.h" @@ -124,4 +127,16 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Document* documen return wrapper; } +#if ENABLE(TOUCH_EVENTS) +JSValue JSDocument::createTouchList(ExecState* exec) +{ + RefPtr<TouchList> touchList = TouchList::create(); + + for (int i = 0; i < exec->argumentCount(); i++) + touchList->append(toTouch(exec->argument(i))); + + return toJS(exec, touchList.release()); +} +#endif + } // namespace WebCore diff --git a/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp b/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp index de72dea..971098d 100644 --- a/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp +++ b/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp @@ -199,8 +199,7 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* scriptState) if (!canAccessInspectedWindow(scriptState)) return InjectedScript(); - ASSERT(!m_injectedScriptSource.isEmpty()); - pair<long, ScriptObject> injectedScriptObject = injectScript(m_injectedScriptSource, scriptState); + pair<long, ScriptObject> injectedScriptObject = injectScript(injectedScriptSource(), scriptState); globalObject->setInjectedScript(injectedScriptObject.second.jsObject()); InjectedScript result(injectedScriptObject.second); m_idToInjectedScript.set(injectedScriptObject.first, result); diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp index 10df223..9845277 100644 --- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp +++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp @@ -287,12 +287,11 @@ void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, con String sourceID = ustringToString(JSC::UString::number(source.provider()->asID())); String url = ustringToString(source.provider()->url()); String data = ustringToString(JSC::UString(source.data(), source.length())); - int firstLine = source.firstLine(); Vector<ScriptDebugListener*> copy; copyToVector(listeners, copy); for (size_t i = 0; i < copy.size(); ++i) - copy[i]->didParseSource(sourceID, url, data, firstLine, worldType); + copy[i]->didParseSource(sourceID, url, data, source.firstLine() - 1, source.firstColumn() - 1, worldType); } void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, const SourceCode& source, int errorLine, const String& errorMessage) diff --git a/Source/WebCore/bindings/js/ScriptGCEvent.cpp b/Source/WebCore/bindings/js/ScriptGCEvent.cpp index 4b39799..b7fc7b3 100644 --- a/Source/WebCore/bindings/js/ScriptGCEvent.cpp +++ b/Source/WebCore/bindings/js/ScriptGCEvent.cpp @@ -34,7 +34,7 @@ #if ENABLE(INSPECTOR) #include "JSDOMWindow.h" -#include <runtime/Collector.h> +#include <runtime/Heap.h> #include <runtime/JSGlobalData.h> #include <wtf/CurrentTime.h> diff --git a/Source/WebCore/bindings/js/ScriptSourceCode.h b/Source/WebCore/bindings/js/ScriptSourceCode.h index 092eeb8..6cf3987 100644 --- a/Source/WebCore/bindings/js/ScriptSourceCode.h +++ b/Source/WebCore/bindings/js/ScriptSourceCode.h @@ -44,7 +44,7 @@ class ScriptSourceCode { public: ScriptSourceCode(const String& source, const KURL& url = KURL(), const TextPosition1& startPosition = TextPosition1::minimumPosition()) : m_provider(StringSourceProvider::create(source, url.isNull() ? String() : url.string())) - , m_code(m_provider, startPosition.m_line.oneBasedInt()) + , m_code(m_provider, startPosition) , m_url(url) { } diff --git a/Source/WebCore/bindings/v8/DebuggerScript.js b/Source/WebCore/bindings/v8/DebuggerScript.js index 50f791d..8c9d98e 100644 --- a/Source/WebCore/bindings/v8/DebuggerScript.js +++ b/Source/WebCore/bindings/v8/DebuggerScript.js @@ -83,8 +83,8 @@ DebuggerScript._formatScript = function(script) id: script.id, name: script.nameOrSourceURL(), source: script.source, - lineOffset: DebuggerScript._v8ToWebkitLineNumber(script.line_offset), - lineCount: script.lineCount(), + lineOffset: script.line_offset, + columnOffset: script.column_offset, scriptWorldType: scriptWorldType }; } diff --git a/Source/WebCore/bindings/v8/ScriptDebugServer.cpp b/Source/WebCore/bindings/v8/ScriptDebugServer.cpp index 4b4611a..1c70a0e 100644 --- a/Source/WebCore/bindings/v8/ScriptDebugServer.cpp +++ b/Source/WebCore/bindings/v8/ScriptDebugServer.cpp @@ -447,6 +447,7 @@ void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8 toWebCoreStringWithNullOrUndefinedCheck(object->Get(v8::String::New("name"))), toWebCoreStringWithNullOrUndefinedCheck(object->Get(v8::String::New("source"))), object->Get(v8::String::New("lineOffset"))->ToInteger()->Value(), + object->Get(v8::String::New("columnOffset"))->ToInteger()->Value(), static_cast<ScriptWorldType>(object->Get(v8::String::New("scriptWorldType"))->Int32Value())); } diff --git a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp index 9fa9f80..cda0737 100644 --- a/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp @@ -35,6 +35,7 @@ #include "Document.h" #include "ExceptionCode.h" #include "Node.h" +#include "TouchList.h" #include "XPathNSResolver.h" #include "XPathResult.h" @@ -46,6 +47,8 @@ #include "V8IsolatedContext.h" #include "V8Node.h" #include "V8Proxy.h" +#include "V8Touch.h" +#include "V8TouchList.h" #if ENABLE(3D_CANVAS) #include "V8WebGLRenderingContext.h" #endif @@ -163,4 +166,19 @@ v8::Handle<v8::Value> toV8(Document* impl, bool forceNewObject) return wrapper; } +#if ENABLE(TOUCH_EVENTS) +v8::Handle<v8::Value> V8Document::createTouchListCallback(const v8::Arguments& args) +{ + 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())); + } + + return toV8(touchList.release()); +} +#endif + } // namespace WebCore diff --git a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp index 81ad955..6bd5abb 100644 --- a/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp @@ -241,8 +241,7 @@ InjectedScript InjectedScriptHost::injectedScriptFor(ScriptState* inspectedScrip if (!canAccessInspectedWindow(inspectedScriptState)) return InjectedScript(); - ASSERT(!m_injectedScriptSource.isEmpty()); - pair<long, ScriptObject> injectedScript = injectScript(m_injectedScriptSource, inspectedScriptState); + pair<long, ScriptObject> injectedScript = injectScript(injectedScriptSource(), inspectedScriptState); InjectedScript result(injectedScript.second); m_idToInjectedScript.set(injectedScript.first, result); global->SetHiddenValue(key, injectedScript.second.v8Object()); |