summaryrefslogtreecommitdiff
path: root/Source/WebCore/bindings/js
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
commit79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch)
tree0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebCore/bindings/js
parent682ab87480e7757346802ce7f54cfdbdfeb2339e (diff)
downloadqtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebCore/bindings/js')
-rw-r--r--Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp4
-rw-r--r--Source/WebCore/bindings/js/JSNodeListCustom.cpp2
-rw-r--r--Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp59
-rw-r--r--Source/WebCore/bindings/js/ScriptDebugServer.cpp15
-rw-r--r--Source/WebCore/bindings/js/ScriptDebugServer.h5
-rw-r--r--Source/WebCore/bindings/js/ScriptObject.cpp6
-rw-r--r--Source/WebCore/bindings/js/ScriptObject.h3
-rw-r--r--Source/WebCore/bindings/js/ScriptProfiler.h9
-rw-r--r--Source/WebCore/bindings/js/ScriptWrappable.h6
9 files changed, 43 insertions, 66 deletions
diff --git a/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp b/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
index ec7871d51..5a0ff7d73 100644
--- a/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
@@ -29,7 +29,7 @@
#include "JSDeviceOrientationEvent.h"
-#include "DeviceOrientation.h"
+#include "DeviceOrientationData.h"
#include "DeviceOrientationEvent.h"
using namespace JSC;
@@ -83,7 +83,7 @@ JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
double gamma = exec->argument(5).toNumber(exec);
bool absoluteProvided = !exec->argument(5).isUndefinedOrNull();
bool absolute = exec->argument(6).toBoolean();
- RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute);
+ RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute);
DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
return jsUndefined();
diff --git a/Source/WebCore/bindings/js/JSNodeListCustom.cpp b/Source/WebCore/bindings/js/JSNodeListCustom.cpp
index ff37978f7..741615970 100644
--- a/Source/WebCore/bindings/js/JSNodeListCustom.cpp
+++ b/Source/WebCore/bindings/js/JSNodeListCustom.cpp
@@ -43,7 +43,7 @@ bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handl
return false;
if (!jsNodeList->impl()->isDynamicNodeList())
return false;
- return visitor.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->node()));
+ return visitor.containsOpaqueRoot(root(static_cast<DynamicNodeList*>(jsNodeList->impl())->ownerNode()));
}
bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, PropertyName propertyName)
diff --git a/Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp b/Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp
index 39a246a15..41ffafc36 100644
--- a/Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp
@@ -34,15 +34,9 @@
#include "JSWebKitMutationObserver.h"
-#include "ExceptionCode.h"
-#include "JSDictionary.h"
#include "JSMutationCallback.h"
-#include "JSNode.h"
-#include "Node.h"
#include "WebKitMutationObserver.h"
#include <runtime/Error.h>
-#include <wtf/HashSet.h>
-#include <wtf/text/AtomicString.h>
using namespace JSC;
@@ -64,59 +58,6 @@ EncodedJSValue JSC_HOST_CALL JSWebKitMutationObserverConstructor::constructJSWeb
return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), WebKitMutationObserver::create(callback.release()))));
}
-struct BooleanOption {
- const char* name;
- MutationObserverOptions value;
-};
-
-static const BooleanOption booleanOptions[] = {
- { "childList", WebKitMutationObserver::ChildList },
- { "attributes", WebKitMutationObserver::Attributes },
- { "characterData", WebKitMutationObserver::CharacterData },
- { "subtree", WebKitMutationObserver::Subtree },
- { "attributeOldValue", WebKitMutationObserver::AttributeOldValue },
- { "characterDataOldValue", WebKitMutationObserver::CharacterDataOldValue }
-};
-
-static const size_t numBooleanOptions = sizeof(booleanOptions) / sizeof(BooleanOption);
-
-JSValue JSWebKitMutationObserver::observe(ExecState* exec)
-{
- if (exec->argumentCount() < 2)
- return throwError(exec, createNotEnoughArgumentsError(exec));
- Node* target = toNode(exec->argument(0));
- if (exec->hadException())
- return jsUndefined();
-
- JSObject* optionsObject = exec->argument(1).getObject();
- if (!optionsObject) {
- setDOMException(exec, TYPE_MISMATCH_ERR);
- return jsUndefined();
- }
-
- JSDictionary dictionary(exec, optionsObject);
- MutationObserverOptions options = 0;
- for (unsigned i = 0; i < numBooleanOptions; ++i) {
- bool option = false;
- if (!dictionary.tryGetProperty(booleanOptions[i].name, option))
- return jsUndefined();
- if (option)
- options |= booleanOptions[i].value;
- }
-
- HashSet<AtomicString> attributeFilter;
- if (!dictionary.tryGetProperty("attributeFilter", attributeFilter))
- return jsUndefined();
- if (!attributeFilter.isEmpty())
- options |= WebKitMutationObserver::AttributeFilter;
-
- ExceptionCode ec = 0;
- impl()->observe(target, options, attributeFilter, ec);
- if (ec)
- setDOMException(exec, ec);
- return jsUndefined();
-}
-
} // namespace WebCore
#endif // ENABLE(MUTATION_OBSERVERS)
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
index 2d91d8a5e..f2227c745 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -472,6 +472,21 @@ void ScriptDebugServer::recompileAllJSFunctionsSoon()
m_recompileTimer.startOneShot(0);
}
+void ScriptDebugServer::compileScript(ScriptState*, const String&, const String&, String*, String*)
+{
+ // FIXME(89652): implement this.
+}
+
+void ScriptDebugServer::clearCompiledScripts()
+{
+ // FIXME(89652): implement this.
+}
+
+void ScriptDebugServer::runScript(ScriptState*, const String&, ScriptValue*, bool*, String*)
+{
+ // FIXME(89652): implement this.
+}
+
} // namespace WebCore
#endif // ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.h b/Source/WebCore/bindings/js/ScriptDebugServer.h
index fad261174..84fba5c67 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.h
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.h
@@ -86,12 +86,17 @@ public:
void updateCallStack(ScriptValue* callFrame);
bool causesRecompilation() { return true; }
+ bool supportsSeparateScriptCompilationAndExecution() { return false; }
void recompileAllJSFunctionsSoon();
virtual void recompileAllJSFunctions(Timer<ScriptDebugServer>* = 0) = 0;
bool isPaused() { return m_paused; }
+ void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage);
+ void clearCompiledScripts();
+ void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage);
+
class Task {
public:
virtual ~Task() { }
diff --git a/Source/WebCore/bindings/js/ScriptObject.cpp b/Source/WebCore/bindings/js/ScriptObject.cpp
index 1fcd9cb80..0cfb82b6e 100644
--- a/Source/WebCore/bindings/js/ScriptObject.cpp
+++ b/Source/WebCore/bindings/js/ScriptObject.cpp
@@ -50,6 +50,12 @@ ScriptObject::ScriptObject(ScriptState* scriptState, JSObject* object)
{
}
+ScriptObject::ScriptObject(ScriptState* scriptState, const ScriptValue& scriptValue)
+ : ScriptValue(scriptState->globalData(), scriptValue.jsValue())
+ , m_scriptState(scriptState)
+{
+}
+
static bool handleException(ScriptState* scriptState)
{
if (!scriptState->hadException())
diff --git a/Source/WebCore/bindings/js/ScriptObject.h b/Source/WebCore/bindings/js/ScriptObject.h
index eb02e9b7a..2c1ae4d33 100644
--- a/Source/WebCore/bindings/js/ScriptObject.h
+++ b/Source/WebCore/bindings/js/ScriptObject.h
@@ -44,7 +44,8 @@ namespace WebCore {
class ScriptObject : public ScriptValue {
public:
ScriptObject(ScriptState*, JSC::JSObject*);
- ScriptObject() {}
+ ScriptObject(ScriptState*, const ScriptValue&);
+ ScriptObject() { }
JSC::JSObject* jsObject() const { return asObject(jsValue()); }
ScriptState* scriptState() const { return m_scriptState; }
diff --git a/Source/WebCore/bindings/js/ScriptProfiler.h b/Source/WebCore/bindings/js/ScriptProfiler.h
index 04a615ddb..57685354f 100644
--- a/Source/WebCore/bindings/js/ScriptProfiler.h
+++ b/Source/WebCore/bindings/js/ScriptProfiler.h
@@ -36,7 +36,9 @@
namespace WebCore {
-class DOMWrapperVisitor;
+class ExternalArrayVisitor;
+class ExternalStringVisitor;
+class NodeWrapperVisitor;
class Page;
class ScriptObject;
class ScriptValue;
@@ -72,8 +74,9 @@ public:
static bool isSampling() { return false; }
static bool hasHeapProfiler() { return false; }
// FIXME: Implement this counter for JSC. See bug 73936 for more details.
- static void visitJSDOMWrappers(DOMWrapperVisitor*) { }
- static void visitExternalJSStrings(DOMWrapperVisitor*) { }
+ static void visitNodeWrappers(NodeWrapperVisitor*) { }
+ static void visitExternalStrings(ExternalStringVisitor*) { }
+ static void visitExternalArrays(ExternalArrayVisitor*) { }
static size_t profilerSnapshotsSize() { return 0; }
};
diff --git a/Source/WebCore/bindings/js/ScriptWrappable.h b/Source/WebCore/bindings/js/ScriptWrappable.h
index 508a93700..2d92bb455 100644
--- a/Source/WebCore/bindings/js/ScriptWrappable.h
+++ b/Source/WebCore/bindings/js/ScriptWrappable.h
@@ -54,6 +54,12 @@ public:
weakClear(m_wrapper, wrapper);
}
+ void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+ {
+ memoryObjectInfo->reportObjectInfo(this, MemoryInstrumentation::DOM);
+ memoryObjectInfo->reportObject(m_wrapper);
+ }
+
private:
JSC::Weak<JSDOMWrapper> m_wrapper;
};