summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings')
-rw-r--r--WebCore/bindings/generic/ActiveDOMCallback.cpp2
-rw-r--r--WebCore/bindings/js/JSDOMBinding.h7
-rw-r--r--WebCore/bindings/js/JSDirectoryEntryCustom.cpp141
-rw-r--r--WebCore/bindings/js/JSEntryCustom.cpp61
-rw-r--r--WebCore/bindings/js/JSEventCustom.cpp4
-rw-r--r--WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp2
-rw-r--r--WebCore/bindings/js/JSSVGPODListCustom.h8
-rw-r--r--WebCore/bindings/js/JSSVGPathSegListCustom.cpp8
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.cpp2
-rw-r--r--WebCore/bindings/js/SerializedScriptValue.cpp75
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm9
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm18
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp6
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h4
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp2
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.h4
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm6
-rw-r--r--WebCore/bindings/scripts/test/TestObj.idl10
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.cpp22
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.h31
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp101
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.h31
-rw-r--r--WebCore/bindings/v8/DebuggerScript.js290
-rw-r--r--WebCore/bindings/v8/NPV8Object.cpp2
-rw-r--r--WebCore/bindings/v8/ScriptCachedFrameData.h2
-rw-r--r--WebCore/bindings/v8/ScriptController.cpp4
-rw-r--r--WebCore/bindings/v8/ScriptController.h14
-rw-r--r--WebCore/bindings/v8/ScriptControllerQt.cpp49
-rw-r--r--[-rwxr-xr-x]WebCore/bindings/v8/ScriptValue.cpp0
-rw-r--r--WebCore/bindings/v8/SerializedScriptValue.cpp6
-rw-r--r--WebCore/bindings/v8/V8Binding.cpp2
-rw-r--r--WebCore/bindings/v8/V8Helpers.h2
-rw-r--r--WebCore/bindings/v8/V8NPObject.h2
-rw-r--r--WebCore/bindings/v8/V8NPUtils.h2
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp1
-rw-r--r--WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp13
-rw-r--r--WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp15
-rw-r--r--WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp139
-rw-r--r--WebCore/bindings/v8/custom/V8EntryCustom.cpp61
-rw-r--r--WebCore/bindings/v8/custom/V8EventCustom.cpp3
-rw-r--r--WebCore/bindings/v8/npruntime_internal.h12
42 files changed, 1042 insertions, 133 deletions
diff --git a/WebCore/bindings/generic/ActiveDOMCallback.cpp b/WebCore/bindings/generic/ActiveDOMCallback.cpp
index f62bf83..bc93de5 100644
--- a/WebCore/bindings/generic/ActiveDOMCallback.cpp
+++ b/WebCore/bindings/generic/ActiveDOMCallback.cpp
@@ -76,7 +76,7 @@ public:
ActiveDOMObject::contextDestroyed();
}
virtual bool canSuspend() const { return false; }
- virtual void suspend()
+ virtual void suspend(ReasonForSuspension)
{
MutexLocker locker(m_mutex);
m_suspended = true;
diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h
index 749b0d7..f0bd2e2 100644
--- a/WebCore/bindings/js/JSDOMBinding.h
+++ b/WebCore/bindings/js/JSDOMBinding.h
@@ -267,6 +267,13 @@ namespace WebCore {
String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null
String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined
+ inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool& okay)
+ {
+ double number = value.toNumber(exec);
+ okay = isfinite(number);
+ return JSC::toInt32(number);
+ }
+
// Returns a Date instance for the specified value, or null if the value is NaN or infinity.
JSC::JSValue jsDateOrNull(JSC::ExecState*, double);
// NaN if the value can't be converted to a date.
diff --git a/WebCore/bindings/js/JSDirectoryEntryCustom.cpp b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
new file mode 100644
index 0000000..35a6c32
--- /dev/null
+++ b/WebCore/bindings/js/JSDirectoryEntryCustom.cpp
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "JSDirectoryEntry.h"
+
+#include "JSDOMBinding.h"
+#include "JSEntryCallback.h"
+#include "JSErrorCallback.h"
+#include "JSFlags.h"
+#include <wtf/Assertions.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue JSDirectoryEntry::getFile(ExecState* exec)
+{
+ DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
+ const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+ if (exec->hadException())
+ return jsUndefined();
+
+ int argsCount = exec->argumentCount();
+ if (argsCount <= 1) {
+ imp->getFile(path);
+ return jsUndefined();
+ }
+
+ RefPtr<Flags> flags;
+ if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
+ JSObject* object = exec->argument(1).getObject();
+ flags = Flags::create();
+ JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
+ flags->setCreate(jsCreate.toBoolean(exec));
+ JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
+ flags->setExclusive(jsExclusive.toBoolean(exec));
+ } else
+ flags = adoptRef(toFlags(exec->argument(1)));
+ if (exec->hadException())
+ return jsUndefined();
+ RefPtr<EntryCallback> successCallback;
+ if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
+ if (!exec->argument(2).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
+ if (!exec->argument(3).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
+ }
+
+ imp->getFile(path, flags, successCallback, errorCallback);
+ return jsUndefined();
+}
+
+JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
+{
+ DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
+ const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
+ if (exec->hadException())
+ return jsUndefined();
+
+ int argsCount = exec->argumentCount();
+ if (argsCount <= 1) {
+ imp->getDirectory(path);
+ return jsUndefined();
+ }
+
+ RefPtr<Flags> flags;
+ if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
+ JSObject* object = exec->argument(1).getObject();
+ flags = Flags::create();
+ JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
+ flags->setCreate(jsCreate.toBoolean(exec));
+ JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
+ flags->setExclusive(jsExclusive.toBoolean(exec));
+ } else
+ flags = adoptRef(toFlags(exec->argument(1)));
+ if (exec->hadException())
+ return jsUndefined();
+ RefPtr<EntryCallback> successCallback;
+ if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
+ if (!exec->argument(2).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
+ if (!exec->argument(3).isObject()) {
+ setDOMException(exec, TYPE_MISMATCH_ERR);
+ return jsUndefined();
+ }
+ errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
+ }
+
+ imp->getDirectory(path, flags, successCallback, errorCallback);
+ return jsUndefined();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/js/JSEntryCustom.cpp b/WebCore/bindings/js/JSEntryCustom.cpp
new file mode 100644
index 0000000..59d7e3c
--- /dev/null
+++ b/WebCore/bindings/js/JSEntryCustom.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "JSEntry.h"
+
+#include "Entry.h"
+#include "JSDOMBinding.h"
+#include "JSDirectoryEntry.h"
+#include "JSFileEntry.h"
+#include <wtf/Assertions.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Entry* entry)
+{
+ if (!entry)
+ return jsNull();
+
+ if (entry->isFile())
+ return getDOMObjectWrapper<JSFileEntry>(exec, globalObject, static_cast<FileEntry*>(entry));
+
+ ASSERT(entry->isDirectory());
+ return getDOMObjectWrapper<JSDirectoryEntry>(exec, globalObject, static_cast<DirectoryEntry*>(entry));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/js/JSEventCustom.cpp b/WebCore/bindings/js/JSEventCustom.cpp
index 7479020..d2e9d61 100644
--- a/WebCore/bindings/js/JSEventCustom.cpp
+++ b/WebCore/bindings/js/JSEventCustom.cpp
@@ -42,6 +42,7 @@
#include "JSDeviceMotionEvent.h"
#include "JSDeviceOrientationEvent.h"
#include "JSErrorEvent.h"
+#include "JSHashChangeEvent.h"
#include "JSKeyboardEvent.h"
#include "JSMessageEvent.h"
#include "JSMouseEvent.h"
@@ -58,6 +59,7 @@
#include "JSXMLHttpRequestProgressEvent.h"
#include "BeforeLoadEvent.h"
#include "ErrorEvent.h"
+#include "HashChangeEvent.h"
#include "KeyboardEvent.h"
#include "MessageEvent.h"
#include "MouseEvent.h"
@@ -170,6 +172,8 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event)
else if (event->isErrorEvent())
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, ErrorEvent, event);
#endif
+ else if (event->isHashChangeEvent())
+ wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HashChangeEvent, event);
else if (event->isPopStateEvent())
wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, PopStateEvent, event);
else if (event->isCustomEvent())
diff --git a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
index dc2f7cb..6143c1e 100644
--- a/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
@@ -76,7 +76,7 @@ JSValue JSHTMLOptionsCollection::add(ExecState* exec)
imp->add(option, ec);
else {
bool ok;
- int index = exec->argument(1).toInt32(exec, ok);
+ int index = finiteInt32Value(exec->argument(1), exec, ok);
if (exec->hadException())
return jsUndefined();
if (!ok)
diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
index 2a504d3..e9a97ed 100644
--- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
+++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
JSValue JSSQLResultSetRowList::item(ExecState* exec)
{
bool indexOk;
- int index = exec->argument(0).toInt32(exec, indexOk);
+ int index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
diff --git a/WebCore/bindings/js/JSSVGPODListCustom.h b/WebCore/bindings/js/JSSVGPODListCustom.h
index 9db5618..c2af93f 100644
--- a/WebCore/bindings/js/JSSVGPODListCustom.h
+++ b/WebCore/bindings/js/JSSVGPODListCustom.h
@@ -119,7 +119,7 @@ static JSC::JSValue getItem(JSPODListType* wrapper, JSC::ExecState* exec,
typename JSSVGPODListTraits<PODType>::ConversionCallback)
{
bool indexOk = false;
- unsigned index = exec->argument(0).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
@@ -136,7 +136,7 @@ static JSC::JSValue insertItemBefore(JSPODListType* wrapper, JSC::ExecState* exe
typename JSSVGPODListTraits<PODType>::ConversionCallback conversion)
{
bool indexOk = false;
- unsigned index = exec->argument(1).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
@@ -153,7 +153,7 @@ static JSC::JSValue replaceItem(JSPODListType* wrapper, JSC::ExecState* exec,
typename JSSVGPODListTraits<PODType>::ConversionCallback conversion)
{
bool indexOk = false;
- unsigned index = exec->argument(1).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
@@ -170,7 +170,7 @@ static JSC::JSValue removeItem(JSPODListType* wrapper, JSC::ExecState* exec,
typename JSSVGPODListTraits<PODType>::ConversionCallback)
{
bool indexOk = false;
- unsigned index = exec->argument(0).toUInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return JSC::jsUndefined();
diff --git a/WebCore/bindings/js/JSSVGPathSegListCustom.cpp b/WebCore/bindings/js/JSSVGPathSegListCustom.cpp
index 850e533..9767c1a 100644
--- a/WebCore/bindings/js/JSSVGPathSegListCustom.cpp
+++ b/WebCore/bindings/js/JSSVGPathSegListCustom.cpp
@@ -71,7 +71,7 @@ JSValue JSSVGPathSegList::getItem(ExecState* exec)
ExceptionCode ec = 0;
bool indexOk;
- unsigned index = exec->argument(0).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -92,7 +92,7 @@ JSValue JSSVGPathSegList::insertItemBefore(ExecState* exec)
SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0));
bool indexOk;
- unsigned index = exec->argument(1).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -114,7 +114,7 @@ JSValue JSSVGPathSegList::replaceItem(ExecState* exec)
SVGPathSeg* newItem = toSVGPathSeg(exec->argument(0));
bool indexOk;
- unsigned index = exec->argument(1).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(1), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
@@ -135,7 +135,7 @@ JSValue JSSVGPathSegList::removeItem(ExecState* exec)
ExceptionCode ec = 0;
bool indexOk;
- unsigned index = exec->argument(0).toInt32(exec, indexOk);
+ unsigned index = finiteInt32Value(exec->argument(0), exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index ecb7fa6..1decefa 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -406,7 +406,7 @@ void ScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused)
Document* document = frame->document();
if (paused)
- document->suspendActiveDOMObjects();
+ document->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused);
else
document->resumeActiveDOMObjects();
diff --git a/WebCore/bindings/js/SerializedScriptValue.cpp b/WebCore/bindings/js/SerializedScriptValue.cpp
index fcd3314..8ccaf9c 100644
--- a/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -762,6 +762,25 @@ public:
}
private:
+ struct CachedString {
+ CachedString(const UString& string)
+ : m_string(string)
+ {
+ }
+
+ JSValue jsString(ExecState* exec)
+ {
+ if (!m_jsString)
+ m_jsString = JSC::jsString(exec, m_string);
+ return m_jsString;
+ }
+ const UString& ustring() { return m_string; }
+
+ private:
+ UString m_string;
+ JSValue m_jsString;
+ };
+
CloneDeserializer(ExecState* exec, JSGlobalObject* globalObject, const Vector<uint8_t>& buffer)
: CloneBase(exec)
, m_globalObject(globalObject)
@@ -903,13 +922,13 @@ private:
return true;
}
- bool readStringData(Identifier& ident)
+ bool readStringData(CachedString*& cachedString)
{
bool scratch;
- return readStringData(ident, scratch);
+ return readStringData(cachedString, scratch);
}
- bool readStringData(Identifier& ident, bool& wasTerminator)
+ bool readStringData(CachedString*& cachedString, bool& wasTerminator)
{
if (m_failed)
return false;
@@ -930,7 +949,7 @@ private:
fail();
return false;
}
- ident = m_constantPool[index];
+ cachedString = &m_constantPool[index];
return true;
}
UString str;
@@ -938,8 +957,8 @@ private:
fail();
return false;
}
- ident = Identifier(m_exec, str);
- m_constantPool.append(ident);
+ m_constantPool.append(str);
+ cachedString = &m_constantPool.last();
return true;
}
@@ -958,26 +977,24 @@ private:
array->put(m_exec, index, value);
}
- void putProperty(JSObject* object, Identifier& property, JSValue value)
+ void putProperty(JSObject* object, const Identifier& property, JSValue value)
{
object->putDirect(property, value);
}
bool readFile(RefPtr<File>& file)
{
- Identifier path;
+ CachedString* path = 0;
if (!readStringData(path))
return 0;
- Identifier url;
+ CachedString* url = 0;
if (!readStringData(url))
return 0;
- Identifier type;
+ CachedString* type = 0;
if (!readStringData(type))
return 0;
- if (m_isDOMGlobalObject) {
- ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
- file = File::create(scriptExecutionContext, String(path.ustring().impl()), KURL(KURL(), String(url.ustring().impl())), String(type.ustring().impl()));
- }
+ if (m_isDOMGlobalObject)
+ file = File::create(String(path->ustring().impl()), KURL(KURL(), String(url->ustring().impl())), String(type->ustring().impl()));
return true;
}
@@ -1063,10 +1080,10 @@ private:
return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), result.get());
}
case BlobTag: {
- Identifier url;
+ CachedString* url = 0;
if (!readStringData(url))
return JSValue();
- Identifier type;
+ CachedString* type = 0;
if (!readStringData(type))
return JSValue();
unsigned long long size = 0;
@@ -1074,26 +1091,24 @@ private:
return JSValue();
if (!m_isDOMGlobalObject)
return jsNull();
- ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject())->scriptExecutionContext();
- ASSERT(scriptExecutionContext);
- return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), Blob::create(scriptExecutionContext, KURL(KURL(), url.ustring().impl()), String(type.ustring().impl()), size));
+ return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), Blob::create(KURL(KURL(), url->ustring().impl()), String(type->ustring().impl()), size));
}
case StringTag: {
- Identifier ident;
- if (!readStringData(ident))
+ CachedString* cachedString = 0;
+ if (!readStringData(cachedString))
return JSValue();
- return jsString(m_exec, ident.ustring());
+ return cachedString->jsString(m_exec);
}
case EmptyStringTag:
return jsEmptyString(&m_exec->globalData());
case RegExpTag: {
- Identifier pattern;
+ CachedString* pattern = 0;
if (!readStringData(pattern))
return JSValue();
- Identifier flags;
+ CachedString* flags = 0;
if (!readStringData(flags))
return JSValue();
- RefPtr<RegExp> regExp = RegExp::create(&m_exec->globalData(), pattern.ustring(), flags.ustring());
+ RefPtr<RegExp> regExp = RegExp::create(&m_exec->globalData(), pattern->ustring(), flags->ustring());
return new (m_exec) RegExpObject(m_exec->lexicalGlobalObject(), m_globalObject->regExpStructure(), regExp);
}
default:
@@ -1107,7 +1122,7 @@ private:
const uint8_t* m_ptr;
const uint8_t* m_end;
unsigned m_version;
- Vector<Identifier> m_constantPool;
+ Vector<CachedString> m_constantPool;
};
JSValue CloneDeserializer::deserialize()
@@ -1196,9 +1211,9 @@ JSValue CloneDeserializer::deserialize()
tickCount = ticksUntilNextCheck();
}
- Identifier ident;
+ CachedString* cachedString = 0;
bool wasTerminator = false;
- if (!readStringData(ident, wasTerminator)) {
+ if (!readStringData(cachedString, wasTerminator)) {
if (!wasTerminator)
goto error;
JSObject* outObject = outputObjectStack.last();
@@ -1209,11 +1224,11 @@ JSValue CloneDeserializer::deserialize()
}
if (JSValue terminal = readTerminal()) {
- putProperty(outputObjectStack.last(), ident, terminal);
+ putProperty(outputObjectStack.last(), Identifier(m_exec, cachedString->ustring()), terminal);
goto objectStartVisitMember;
}
stateStack.append(ObjectEndVisitMember);
- propertyNameStack.append(ident);
+ propertyNameStack.append(Identifier(m_exec, cachedString->ustring()));
goto stateUnknown;
}
case ObjectEndVisitMember: {
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index adc47d0..ec762b6 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -344,10 +344,6 @@ sub WK_ucfirst
my $ret = ucfirst($param);
$ret =~ s/Xml/XML/ if $ret =~ /^Xml[^a-z]/;
- # For HTML5 FileSystem API Flags attributes.
- $ret =~ s/^CREATE/Create/ if $ret =~ /^CREATE$/;
- $ret =~ s/^EXCLUSIVE/Exclusive/ if $ret =~ /^EXCLUSIVE$/;
-
return $ret;
}
@@ -364,8 +360,9 @@ sub WK_lcfirst
$ret =~ s/xSLT/xslt/ if $ret =~ /^xSLT/;
# For HTML5 FileSystem API Flags attributes.
- $ret =~ s/^cREATE/isCreate/ if $ret =~ /^cREATE$/;
- $ret =~ s/^eXCLUSIVE/isExclusive/ if $ret =~ /^eXCLUSIVE$/;
+ # (create is widely used to instantiate an object and must be avoided.)
+ $ret =~ s/^create/isCreate/ if $ret =~ /^create$/;
+ $ret =~ s/^exclusive/isExclusive/ if $ret =~ /^exclusive$/;
return $ret;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 06bce04..f74f2b1 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1984,8 +1984,7 @@ END
# Setup the enable-at-runtime attrs if we have them
foreach my $runtime_attr (@enabledAtRuntime) {
- # A function named RuntimeEnabledFeatures::{methodName}Enabled() need to be written by hand.
- $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($runtime_attr->signature->name) . "Enabled";
+ my $enable_function = GetRuntimeEnableFunctionName($runtime_attr->signature);
my $conditionalString = GenerateConditionalString($runtime_attr->signature);
push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
push(@implContent, " if (${enable_function}()) {\n");
@@ -2034,7 +2033,7 @@ END
my $conditional = "";
if ($attrExt->{"EnabledAtRuntime"}) {
# Only call Set()/SetAccessor() if this method should be enabled
- $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($function->signature->name) . "Enabled";
+ $enable_function = GetRuntimeEnableFunctionName($function->signature);
$conditional = "if (${enable_function}())\n ";
}
@@ -2509,6 +2508,7 @@ sub HasCustomToV8Implementation {
# We generate a custom converter (but JSC doesn't) for the following:
return 1 if $interfaceName eq "CSSStyleSheet";
return 1 if $interfaceName eq "CanvasPixelArray";
+ return 1 if $interfaceName eq "DOMStringMap";
return 1 if $interfaceName eq "DOMWindow";
return 1 if $interfaceName eq "Element";
return 1 if $interfaceName eq "HTMLDocument";
@@ -3389,6 +3389,18 @@ sub ConvertToV8Parameter
}
}
+# Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled.
+sub GetRuntimeEnableFunctionName
+{
+ my $signature = shift;
+
+ # If a parameter is given (e.g. "EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::{FeatureName}Enabled() method.
+ return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->extendedAttributes->{"EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"EnabledAtRuntime"} && $signature->extendedAttributes->{"EnabledAtRuntime"} ne "1");
+
+ # Otherwise return a function named RuntimeEnabledFeatures::{methodName}Enabled().
+ return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled";
+}
+
sub DebugPrint
{
my $output = shift;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index 9cceb3c..579295f 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -199,7 +199,7 @@ void WebDOMTestObj::setXMLObjAttr(const WebDOMTestObj& newXMLObjAttr)
impl()->setXMLObjAttr(toWebCore(newXMLObjAttr));
}
-bool WebDOMTestObj::CREATE() const
+bool WebDOMTestObj::create() const
{
if (!impl())
return false;
@@ -207,12 +207,12 @@ bool WebDOMTestObj::CREATE() const
return impl()->isCreate();
}
-void WebDOMTestObj::setCREATE(bool newCREATE)
+void WebDOMTestObj::setCreate(bool newCreate)
{
if (!impl())
return;
- impl()->setCreate(newCREATE);
+ impl()->setCreate(newCreate);
}
WebDOMString WebDOMTestObj::reflectedStringAttr() const
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 037a1d3..cd6caaa 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -72,8 +72,8 @@ public:
void setTestObjAttr(const WebDOMTestObj&);
WebDOMTestObj XMLObjAttr() const;
void setXMLObjAttr(const WebDOMTestObj&);
- bool CREATE() const;
- void setCREATE(bool);
+ bool create() const;
+ void setCreate(bool);
WebDOMString reflectedStringAttr() const;
void setReflectedStringAttr(const WebDOMString&);
int reflectedIntegralAttr() const;
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 63bc368..5236267 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -63,7 +63,7 @@ static const HashTableValue JSTestObjTableValues[34] =
{ "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
{ "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
{ "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr THUNK_GENERATOR(0) },
- { "CREATE", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
+ { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
{ "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
{ "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
{ "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) },
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 132b215..1ad29cb 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -64,8 +64,8 @@ enum {
- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr;
- (DOMTestObj *)XMLObjAttr;
- (void)setXMLObjAttr:(DOMTestObj *)newXMLObjAttr;
-- (BOOL)CREATE;
-- (void)setCREATE:(BOOL)newCREATE;
+- (BOOL)create;
+- (void)setCreate:(BOOL)newCreate;
- (NSString *)reflectedStringAttr;
- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
- (int)reflectedIntegralAttr;
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index 9725b24..6788075 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -168,16 +168,16 @@
IMPL->setXMLObjAttr(core(newXMLObjAttr));
}
-- (BOOL)CREATE
+- (BOOL)create
{
WebCore::JSMainThreadNullState state;
return IMPL->isCreate();
}
-- (void)setCREATE:(BOOL)newCREATE
+- (void)setCreate:(BOOL)newCreate
{
WebCore::JSMainThreadNullState state;
- IMPL->setCreate(newCREATE);
+ IMPL->setCreate(newCreate);
}
- (NSString *)reflectedStringAttr
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 89dfdf7..22ed680 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -44,7 +44,7 @@ module test {
JS, V8
// WK_ucfirst, WK_lcfirst exceptional cases.
attribute TestObj XMLObjAttr;
- attribute boolean CREATE;
+ attribute boolean create;
// Reflected DOM attributes
attribute [Reflect] DOMString reflectedStringAttr;
@@ -142,6 +142,14 @@ module test {
[ClassMethod] void classMethod();
[ClassMethod] long classMethodWithOptional(in [Optional] long arg);
+#if defined(TESTING_V8)
+ // 'EnabledAtRuntime' methods and attributes.
+ [EnabledAtRuntime] void enabledAtRuntimeMethod1(in int intArg);
+ [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in int intArg);
+ attribute [EnabledAtRuntime] long enabledAtRuntimeAttr1;
+ attribute [EnabledAtRuntime=FeatureName] long enabledAtRuntimeAttr2;
+#endif
+
// ObjectiveC reserved words.
readonly attribute long description;
attribute long id;
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index 340dca7..267f1f0 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -70,24 +70,16 @@ v8::Persistent<v8::FunctionTemplate> V8TestInterface::GetTemplate()
return V8TestInterfaceCache;
}
-TestInterface* V8TestInterface::toNative(v8::Handle<v8::Object> object)
-{
- return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-}
-
bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value)
{
return GetRawTemplate()->HasInstance(value);
}
-v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
+v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl)
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = getDOMObjectMap().get(impl);
- if (!wrapper.IsEmpty())
- return wrapper;
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
if (wrapper.IsEmpty())
return wrapper;
@@ -97,18 +89,6 @@ v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
return wrapper;
}
-v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface > impl)
-{
- return toV8(impl.get());
-}
-
-v8::Handle<v8::Value> toV8(TestInterface* impl)
-{
- if (!impl)
- return v8::Null();
- return V8TestInterface::wrap(impl);
-}
-
void V8TestInterface::derefObject(void* object)
{
static_cast<TestInterface*>(object)->deref();
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index afdf381..c1e319b 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -24,6 +24,7 @@
#define V8TestInterface_h
#include "TestInterface.h"
+#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include "wtf/text/StringHash.h"
#include <v8.h>
@@ -37,16 +38,38 @@ public:
static bool HasInstance(v8::Handle<v8::Value> value);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
- static TestInterface* toNative(v8::Handle<v8::Object>);
- static v8::Handle<v8::Object> wrap(TestInterface*);
+ static TestInterface* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestInterface*);
static void derefObject(void*);
static WrapperTypeInfo info;
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestInterface*);
};
-v8::Handle<v8::Value> toV8(TestInterface*);
-v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >);
+
+v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestInterface::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterface* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestInterface::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl)
+{
+ return toV8(impl.get());
+}
}
#endif // V8TestInterface_h
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 8f824d9..44f0d3e 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -35,6 +35,7 @@
#include "V8IsolatedContext.h"
#include "V8Proxy.h"
#include "V8TestCallback.h"
+#include "V8int.h"
#include "V8log.h"
#include <wtf/GetPtr.h>
#include <wtf/RefCounted.h>
@@ -172,16 +173,16 @@ static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
return;
}
-static v8::Handle<v8::Value> CREATEAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.CREATE._get");
+ INC_STATS("DOM.TestObj.create._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
return v8Boolean(imp->isCreate());
}
-static void CREATEAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.CREATE._set");
+ INC_STATS("DOM.TestObj.create._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
bool v = value->BooleanValue();
imp->setCreate(v);
@@ -515,6 +516,38 @@ static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
#endif // ENABLE(Condition1) || ENABLE(Condition2)
+static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->enabledAtRuntimeAttr1());
+}
+
+static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setEnabledAtRuntimeAttr1(v);
+ return;
+}
+
+static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->enabledAtRuntimeAttr2());
+}
+
+static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setEnabledAtRuntimeAttr2(v);
+ return;
+}
+
static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.description._get");
@@ -1020,6 +1053,24 @@ static v8::Handle<v8::Value> classMethodWithOptionalCallback(const v8::Arguments
return v8::Integer::New(TestObj::classMethodWithOptional(arg));
}
+static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->enabledAtRuntimeMethod1(intArg);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->enabledAtRuntimeMethod2(intArg);
+ return v8::Handle<v8::Value>();
+}
+
} // namespace TestObjInternal
static const BatchedAttribute TestObjAttrs[] = {
@@ -1041,8 +1092,8 @@ static const BatchedAttribute TestObjAttrs[] = {
{"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
{"XMLObjAttr", TestObjInternal::XMLObjAttrAttrGetter, TestObjInternal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'CREATE' (Type: 'attribute' ExtAttr: '')
- {"CREATE", TestObjInternal::CREATEAttrGetter, TestObjInternal::CREATEAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'create' (Type: 'attribute' ExtAttr: '')
+ {"create", TestObjInternal::createAttrGetter, TestObjInternal::createAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
{"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
@@ -1157,6 +1208,18 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
+ static const BatchedAttribute attrData =\
+ // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
+ {"enabledAtRuntimeAttr1", TestObjInternal::enabledAtRuntimeAttr1AttrGetter, TestObjInternal::enabledAtRuntimeAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ configureAttribute(instance, proto, attrData);
+ }
+ if (RuntimeEnabledFeatures::featureNameEnabled()) {
+ static const BatchedAttribute attrData =\
+ // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
+ {"enabledAtRuntimeAttr2", TestObjInternal::enabledAtRuntimeAttr2AttrGetter, TestObjInternal::enabledAtRuntimeAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ configureAttribute(instance, proto, attrData);
+ }
// Custom Signature 'voidMethodWithArgs'
const int voidMethodWithArgsArgc = 3;
@@ -1195,6 +1258,10 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
proto->Set(v8::String::New("customArgsAndException"), v8::FunctionTemplate::New(TestObjInternal::customArgsAndExceptionCallback, v8::Handle<v8::Value>(), customArgsAndExceptionSignature));
desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
+ if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
+ proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
+ if (RuntimeEnabledFeatures::featureNameEnabled())
+ proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts));
// Custom toString template
@@ -1214,24 +1281,16 @@ v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate()
return V8TestObjCache;
}
-TestObj* V8TestObj::toNative(v8::Handle<v8::Object> object)
-{
- return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-}
-
bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
{
return GetRawTemplate()->HasInstance(value);
}
-v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+v8::Handle<v8::Object> V8TestObj::wrapSlow(TestObj* impl)
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = getDOMObjectMap().get(impl);
- if (!wrapper.IsEmpty())
- return wrapper;
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
if (wrapper.IsEmpty())
return wrapper;
@@ -1241,18 +1300,6 @@ v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
return wrapper;
}
-v8::Handle<v8::Value> toV8(PassRefPtr<TestObj > impl)
-{
- return toV8(impl.get());
-}
-
-v8::Handle<v8::Value> toV8(TestObj* impl)
-{
- if (!impl)
- return v8::Null();
- return V8TestObj::wrap(impl);
-}
-
void V8TestObj::derefObject(void* object)
{
static_cast<TestObj*>(object)->deref();
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.h b/WebCore/bindings/scripts/test/V8/V8TestObj.h
index d9715c9..1e60488 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.h
@@ -22,6 +22,7 @@
#define V8TestObj_h
#include "TestObj.h"
+#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include "wtf/text/StringHash.h"
#include <v8.h>
@@ -35,8 +36,11 @@ public:
static bool HasInstance(v8::Handle<v8::Value> value);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
- static TestObj* toNative(v8::Handle<v8::Object>);
- static v8::Handle<v8::Object> wrap(TestObj*);
+ static TestObj* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestObj*);
static void derefObject(void*);
static WrapperTypeInfo info;
static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&);
@@ -44,10 +48,29 @@ public:
static v8::Handle<v8::Value> customAttrAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestObj*);
};
-v8::Handle<v8::Value> toV8(TestObj*);
-v8::Handle<v8::Value> toV8(PassRefPtr<TestObj >);
+
+v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestObj::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestObj* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestObj::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl)
+{
+ return toV8(impl.get());
+}
}
#endif // V8TestObj_h
diff --git a/WebCore/bindings/v8/DebuggerScript.js b/WebCore/bindings/v8/DebuggerScript.js
new file mode 100644
index 0000000..0222296
--- /dev/null
+++ b/WebCore/bindings/v8/DebuggerScript.js
@@ -0,0 +1,290 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+(function () {
+
+var DebuggerScript = {};
+DebuggerScript._breakpoints = {};
+
+DebuggerScript.PauseOnExceptionsState = {
+ DontPauseOnExceptions : 0,
+ PauseOnAllExceptions : 1,
+ PauseOnUncaughtExceptions: 2
+};
+
+DebuggerScript.ScriptWorldType = {
+ MainWorld : 0,
+ ExtensionsWorld : 1
+};
+
+DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.DontPauseOnExceptions;
+Debug.clearBreakOnException();
+Debug.clearBreakOnUncaughtException();
+
+DebuggerScript.getAfterCompileScript = function(eventData)
+{
+ return DebuggerScript._formatScript(eventData.script_.script_);
+}
+
+DebuggerScript.getScripts = function(contextData)
+{
+ var result = [];
+
+ if (!contextData)
+ return result;
+ var comma = contextData.indexOf(",");
+ if (comma === -1)
+ return result;
+ // Context data is a string in the following format:
+ // ("page"|"injected")","<page id>
+ var idSuffix = contextData.substring(comma); // including the comma
+
+ var scripts = Debug.scripts();
+ for (var i = 0; i < scripts.length; ++i) {
+ var script = scripts[i];
+ if (script.context_data && script.context_data.lastIndexOf(idSuffix) != -1)
+ result.push(DebuggerScript._formatScript(script));
+ }
+ return result;
+}
+
+DebuggerScript._formatScript = function(script)
+{
+ var scriptWorldType = DebuggerScript.ScriptWorldType.MainWorld;
+ if (script.context_data && script.context_data.indexOf("injected") == 0)
+ scriptWorldType = DebuggerScript.ScriptWorldType.ExtensionsWorld;
+ return {
+ id: script.id,
+ name: script.nameOrSourceURL(),
+ source: script.source,
+ lineOffset: DebuggerScript._v8ToWebkitLineNumber(script.line_offset),
+ lineCount: script.lineCount(),
+ scriptWorldType: scriptWorldType
+ };
+}
+
+DebuggerScript.setBreakpoint = function(execState, args)
+{
+ args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber);
+ var breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition);
+ if (!args.enabled)
+ Debug.disableScriptBreakPoint(breakId);
+
+ var locations = Debug.findBreakPointActualLocations(breakId);
+ var actualLineNumber = locations.length ? locations[0].line : args.lineNumber;
+
+ var key = args.scriptId + ":" + actualLineNumber;
+ if (key in DebuggerScript._breakpoints) {
+ // Remove old breakpoint.
+ Debug.findBreakPoint(DebuggerScript._breakpoints[key], true);
+ }
+ DebuggerScript._breakpoints[key] = breakId;
+ return DebuggerScript._v8ToWebkitLineNumber(actualLineNumber);
+}
+
+DebuggerScript.removeBreakpoint = function(execState, args)
+{
+ args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber);
+ var key = args.scriptId + ":" + args.lineNumber;
+ var breakId = DebuggerScript._breakpoints[key];
+ if (breakId)
+ Debug.findBreakPoint(breakId, true);
+ delete DebuggerScript._breakpoints[key];
+}
+
+DebuggerScript.pauseOnExceptionsState = function()
+{
+ return DebuggerScript._pauseOnExceptionsState;
+}
+
+DebuggerScript.setPauseOnExceptionsState = function(newState)
+{
+ DebuggerScript._pauseOnExceptionsState = newState;
+
+ if (DebuggerScript.PauseOnExceptionsState.PauseOnAllExceptions === newState)
+ Debug.setBreakOnException();
+ else
+ Debug.clearBreakOnException();
+
+ if (DebuggerScript.PauseOnExceptionsState.PauseOnUncaughtExceptions === newState)
+ Debug.setBreakOnUncaughtException();
+ else
+ Debug.clearBreakOnUncaughtException();
+}
+
+DebuggerScript.currentCallFrame = function(execState, args)
+{
+ var frameCount = execState.frameCount();
+ if (frameCount === 0)
+ return undefined;
+
+ var topFrame;
+ for (var i = frameCount - 1; i >= 0; i--) {
+ var frameMirror = execState.frame(i);
+ topFrame = DebuggerScript._frameMirrorToJSCallFrame(frameMirror, topFrame);
+ }
+ return topFrame;
+}
+
+DebuggerScript.stepIntoStatement = function(execState)
+{
+ execState.prepareStep(Debug.StepAction.StepIn, 1);
+}
+
+DebuggerScript.stepOverStatement = function(execState)
+{
+ execState.prepareStep(Debug.StepAction.StepNext, 1);
+}
+
+DebuggerScript.stepOutOfFunction = function(execState)
+{
+ execState.prepareStep(Debug.StepAction.StepOut, 1);
+}
+
+DebuggerScript.editScriptSource = function(scriptId, newSource)
+{
+ var scripts = Debug.scripts();
+ var scriptToEdit = null;
+ for (var i = 0; i < scripts.length; i++) {
+ if (scripts[i].id == scriptId) {
+ scriptToEdit = scripts[i];
+ break;
+ }
+ }
+ if (!scriptToEdit)
+ throw("Script not found");
+
+ var changeLog = [];
+ Debug.LiveEdit.SetScriptSource(scriptToEdit, newSource, false, changeLog);
+ return scriptToEdit.source;
+}
+
+DebuggerScript.clearBreakpoints = function(execState, args)
+{
+ for (var key in DebuggerScript._breakpoints) {
+ var breakId = DebuggerScript._breakpoints[key];
+ Debug.findBreakPoint(breakId, true);
+ }
+ DebuggerScript._breakpoints = {};
+}
+
+DebuggerScript.setBreakpointsActivated = function(execState, args)
+{
+ Debug.debuggerFlags().breakPointsActive.setValue(args.enabled);
+}
+
+DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
+{
+ // Get function name.
+ var func;
+ try {
+ func = frameMirror.func();
+ } catch(e) {
+ }
+ var functionName;
+ if (func)
+ functionName = func.name() || func.inferredName();
+
+ // Get script ID.
+ var script = func.script();
+ var sourceID = script && script.id();
+
+ // Get line number.
+ var line = DebuggerScript._v8ToWebkitLineNumber(frameMirror.sourceLine());
+
+ // Get this object.
+ var thisObject = frameMirror.details_.receiver();
+
+ // Get scope chain array in format: [<scope type>, <scope object>, <scope type>, <scope object>,...]
+ var scopeChain = [];
+ var scopeType = [];
+ for (var i = 0; i < frameMirror.scopeCount(); i++) {
+ var scopeMirror = frameMirror.scope(i);
+ var scopeObjectMirror = scopeMirror.scopeObject();
+
+ var scopeObject;
+ switch (scopeMirror.scopeType()) {
+ case ScopeType.Local:
+ case ScopeType.Closure:
+ // For transient objects we create a "persistent" copy that contains
+ // the same properties.
+ scopeObject = {};
+ // Reset scope object prototype to null so that the proto properties
+ // don't appear in the local scope section.
+ scopeObject.__proto__ = null;
+ var properties = scopeObjectMirror.properties();
+ for (var j = 0; j < properties.length; j++) {
+ var name = properties[j].name();
+ if (name.charAt(0) === ".")
+ continue; // Skip internal variables like ".arguments"
+ scopeObject[name] = properties[j].value_;
+ }
+ break;
+ case ScopeType.Global:
+ case ScopeType.With:
+ case ScopeType.Catch:
+ scopeObject = scopeMirror.details_.object();
+ break;
+ }
+
+ scopeType.push(scopeMirror.scopeType());
+ scopeChain.push(scopeObject);
+ }
+
+ function evaluate(expression) {
+ return frameMirror.evaluate(expression, false).value();
+ }
+
+ return {
+ "sourceID": sourceID,
+ "line": line,
+ "functionName": functionName,
+ "type": "function",
+ "thisObject": thisObject,
+ "scopeChain": scopeChain,
+ "scopeType": scopeType,
+ "evaluate": evaluate,
+ "caller": callerFrame
+ };
+}
+
+DebuggerScript._webkitToV8LineNumber = function(line)
+{
+ return line - 1;
+};
+
+DebuggerScript._v8ToWebkitLineNumber = function(line)
+{
+ return line + 1;
+};
+
+return DebuggerScript;
+
+})();
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index 15382ad..fb97d59 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -107,7 +107,7 @@ NPObject* v8ObjectToNPObject(v8::Handle<v8::Object> object)
static NPClass V8NPObjectClass = { NP_CLASS_STRUCT_VERSION,
allocV8NPObject,
freeV8NPObject,
- 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// NPAPI's npruntime functions.
NPClass* npScriptObjectClass = &V8NPObjectClass;
diff --git a/WebCore/bindings/v8/ScriptCachedFrameData.h b/WebCore/bindings/v8/ScriptCachedFrameData.h
index f700a48..1aa1f62 100644
--- a/WebCore/bindings/v8/ScriptCachedFrameData.h
+++ b/WebCore/bindings/v8/ScriptCachedFrameData.h
@@ -51,7 +51,7 @@ public:
} // namespace WebCore
-#elif PLATFORM(ANDROID)
+#elif PLATFORM(ANDROID) || PLATFORM(QT)
// FIXME: the right guard should be ENABLE(PAGE_CACHE). Replace with the right guard, once
// https://bugs.webkit.org/show_bug.cgi?id=35061 is fixed.
//
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index 903b11c..5023254 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -64,6 +64,10 @@
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
+#if PLATFORM(QT)
+#include <QScriptEngine>
+#endif
+
namespace WebCore {
void ScriptController::initializeThreading()
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 525476d..3bc42ef 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -44,6 +44,13 @@
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
+#if PLATFORM(QT)
+#include <qglobal.h>
+QT_BEGIN_NAMESPACE
+class QScriptEngine;
+QT_END_NAMESPACE
+#endif
+
struct NPObject;
namespace WebCore {
@@ -178,6 +185,10 @@ public:
NPObject* windowScriptNPObject();
#endif
+#if PLATFORM(QT)
+ QScriptEngine* qtScriptEngine();
+#endif
+
// Dummy method to avoid a bunch of ifdef's in WebCore.
void evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*);
static void getAllWorlds(Vector<DOMWrapperWorld*>& worlds);
@@ -193,6 +204,9 @@ private:
OwnPtr<V8Proxy> m_proxy;
typedef HashMap<Widget*, NPObject*> PluginObjectMap;
+#if PLATFORM(QT)
+ OwnPtr<QScriptEngine> m_qtScriptEngine;
+#endif
// A mapping between Widgets and their corresponding script object.
// This list is used so that when the plugin dies, we can immediately
diff --git a/WebCore/bindings/v8/ScriptControllerQt.cpp b/WebCore/bindings/v8/ScriptControllerQt.cpp
new file mode 100644
index 0000000..246921e
--- /dev/null
+++ b/WebCore/bindings/v8/ScriptControllerQt.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScriptController.h"
+
+#include <QScriptEngine>
+
+namespace WebCore {
+
+QScriptEngine* ScriptController::qtScriptEngine()
+{
+ if (!m_qtScriptEngine) {
+ v8::HandleScope handleScope;
+ v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(m_frame);
+ v8::Context::Scope scope(v8Context);
+ if (v8Context.IsEmpty())
+ return 0;
+ m_qtScriptEngine = new QScriptEngine(QScriptEngine::AdoptCurrentContext);
+ }
+ return m_qtScriptEngine.get();
+}
+
+}
+// vim: ts=4 sw=4 et
diff --git a/WebCore/bindings/v8/ScriptValue.cpp b/WebCore/bindings/v8/ScriptValue.cpp
index ebe9ccc..ebe9ccc 100755..100644
--- a/WebCore/bindings/v8/ScriptValue.cpp
+++ b/WebCore/bindings/v8/ScriptValue.cpp
diff --git a/WebCore/bindings/v8/SerializedScriptValue.cpp b/WebCore/bindings/v8/SerializedScriptValue.cpp
index 0b908b8..4e5354e 100644
--- a/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -879,7 +879,7 @@ private:
return false;
if (!doReadUint64(&size))
return false;
- PassRefPtr<Blob> blob = Blob::create(getScriptExecutionContext(), KURL(ParsedURLString, url), type, size);
+ PassRefPtr<Blob> blob = Blob::create(KURL(ParsedURLString, url), type, size);
*value = toV8(blob);
return true;
}
@@ -895,7 +895,7 @@ private:
return false;
if (!readWebCoreString(&type))
return false;
- PassRefPtr<File> file = File::create(getScriptExecutionContext(), path, KURL(ParsedURLString, url), type);
+ PassRefPtr<File> file = File::create(path, KURL(ParsedURLString, url), type);
*value = toV8(file);
return true;
}
@@ -916,7 +916,7 @@ private:
return false;
if (!readWebCoreString(&type))
return false;
- fileList->append(File::create(getScriptExecutionContext(), path, KURL(ParsedURLString, urlString), type));
+ fileList->append(File::create(path, KURL(ParsedURLString, urlString), type));
}
*value = toV8(fileList);
return true;
diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp
index bfbc647..d0bf0ca 100644
--- a/WebCore/bindings/v8/V8Binding.cpp
+++ b/WebCore/bindings/v8/V8Binding.cpp
@@ -61,7 +61,7 @@ public:
}
explicit WebCoreStringResource(const AtomicString& string)
- : m_plainString(string)
+ : m_plainString(string.string())
, m_atomicString(string)
{
#ifndef NDEBUG
diff --git a/WebCore/bindings/v8/V8Helpers.h b/WebCore/bindings/v8/V8Helpers.h
index e90f5d6..43d765a 100644
--- a/WebCore/bindings/v8/V8Helpers.h
+++ b/WebCore/bindings/v8/V8Helpers.h
@@ -31,7 +31,7 @@
#ifndef V8Helpers_h
#define V8Helpers_h
-#include "npruntime.h"
+#include "npruntime_internal.h"
#include <v8.h>
namespace WebCore {
diff --git a/WebCore/bindings/v8/V8NPObject.h b/WebCore/bindings/v8/V8NPObject.h
index a540ca9..832d649 100644
--- a/WebCore/bindings/v8/V8NPObject.h
+++ b/WebCore/bindings/v8/V8NPObject.h
@@ -34,7 +34,7 @@
#if PLATFORM(CHROMIUM)
#include <bindings/npruntime.h>
#else
-#include "npruntime.h"
+#include "npruntime_internal.h"
#endif
#include <v8.h>
diff --git a/WebCore/bindings/v8/V8NPUtils.h b/WebCore/bindings/v8/V8NPUtils.h
index 78414b4..dc6185b 100644
--- a/WebCore/bindings/v8/V8NPUtils.h
+++ b/WebCore/bindings/v8/V8NPUtils.h
@@ -33,7 +33,7 @@
#if PLATFORM(CHROMIUM)
#include <bindings/npruntime.h>
#else
-#include "npruntime.h"
+#include "npruntime_internal.h"
#endif
#include <v8.h>
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index b9e4b7f..27e09e6 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -77,6 +77,7 @@
#include <wtf/StdLibExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/UnusedParam.h>
+#include <wtf/text/CString.h>
#ifdef ANDROID_INSTRUMENT
#include "TimeCounter.h"
diff --git a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
index 7ca18ab..c8a975b 100644
--- a/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp
@@ -33,6 +33,7 @@
#include "DOMStringMap.h"
#include "V8Binding.h"
+#include "V8DOMWrapper.h"
namespace WebCore {
@@ -93,4 +94,16 @@ v8::Handle<v8::Value> V8DOMStringMap::namedPropertySetter(v8::Local<v8::String>
return value;
}
+v8::Handle<v8::Value> toV8(DOMStringMap* impl)
+{
+ if (!impl)
+ return v8::Null();
+ v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl);
+ // Add a hidden reference from the element to the DOMStringMap.
+ Element* element = impl->element();
+ if (!wrapper.IsEmpty() && element)
+ V8DOMWrapper::setHiddenWindowReference(element->document()->frame(), wrapper);
+ return wrapper;
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 45cb1b4..f7c75f7 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -605,9 +605,11 @@ bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::V
if (key->IsString()) {
String name = toWebCoreString(key);
-
- // Allow access of GET and HAS if index is a subframe.
- if ((type == v8::ACCESS_GET || type == v8::ACCESS_HAS) && target->tree()->child(name))
+ // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
+ // because that would generate infinite recursion.
+ if (type == v8::ACCESS_HAS && target->tree()->child(name))
+ return true;
+ if (type == v8::ACCESS_GET && target->tree()->child(name) && !host->HasRealNamedProperty(key->ToString()))
return true;
}
@@ -628,8 +630,11 @@ bool V8DOMWindow::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t inde
if (!target)
return false;
- // Allow access of GET and HAS if index is a subframe.
- if ((type == v8::ACCESS_GET || type == v8::ACCESS_HAS) && target->tree()->child(index))
+ // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
+ // because that would generate infinite recursion.
+ if (type == v8::ACCESS_HAS && target->tree()->child(index))
+ return true;
+ if (type == v8::ACCESS_GET && target->tree()->child(index) && !host->HasRealIndexedProperty(index))
return true;
return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), target, false);
diff --git a/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
new file mode 100644
index 0000000..286b154
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8DirectoryEntry.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "DirectoryEntry.h"
+#include "ExceptionCode.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8EntryCallback.h"
+#include "V8ErrorCallback.h"
+#include "V8Flags.h"
+#include "V8Proxy.h"
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8DirectoryEntry::getDirectoryCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.DirectoryEntry.getDirectory");
+ DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
+ if (args.Length() <= 1) {
+ imp->getDirectory(path);
+ return v8::Handle<v8::Value>();
+ }
+ RefPtr<Flags> flags;
+ if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8Flags::HasInstance(args[1])) {
+ EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
+ flags = Flags::create();
+ v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
+ if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
+ EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
+ flags->setCreate(isCreate);
+ }
+ v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
+ if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
+ EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
+ flags->setExclusive(isExclusive);
+ }
+ } else {
+ EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+ flags = adoptRef(tmp_flags);
+ }
+ RefPtr<EntryCallback> successCallback;
+ if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
+ if (!args[2]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
+ if (!args[3]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
+ }
+ imp->getDirectory(path, flags, successCallback, errorCallback);
+ return v8::Handle<v8::Value>();
+}
+
+v8::Handle<v8::Value> V8DirectoryEntry::getFileCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.DirectoryEntry.getFile");
+ DirectoryEntry* imp = V8DirectoryEntry::toNative(args.Holder());
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, path, args[0]);
+ if (args.Length() <= 1) {
+ imp->getFile(path);
+ return v8::Handle<v8::Value>();
+ }
+ RefPtr<Flags> flags;
+ if (!isUndefinedOrNull(args[1]) && args[1]->IsObject() && !V8Flags::HasInstance(args[1])) {
+ EXCEPTION_BLOCK(v8::Handle<v8::Object>, object, v8::Handle<v8::Object>::Cast(args[1]));
+ flags = Flags::create();
+ v8::Local<v8::Value> v8Create = object->Get(v8::String::New("create"));
+ if (!v8Create.IsEmpty() && !isUndefinedOrNull(v8Create)) {
+ EXCEPTION_BLOCK(bool, isCreate, v8Create->BooleanValue());
+ flags->setCreate(isCreate);
+ }
+ v8::Local<v8::Value> v8Exclusive = object->Get(v8::String::New("exclusive"));
+ if (!v8Exclusive.IsEmpty() && !isUndefinedOrNull(v8Exclusive)) {
+ EXCEPTION_BLOCK(bool, isExclusive, v8Exclusive->BooleanValue());
+ flags->setExclusive(isExclusive);
+ }
+ } else {
+ EXCEPTION_BLOCK(Flags*, tmp_flags, V8Flags::HasInstance(args[1]) ? V8Flags::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
+ flags = adoptRef(tmp_flags);
+ }
+ RefPtr<EntryCallback> successCallback;
+ if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
+ if (!args[2]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
+ }
+ RefPtr<ErrorCallback> errorCallback;
+ if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
+ if (!args[3]->IsObject())
+ return throwError(TYPE_MISMATCH_ERR);
+ errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
+ }
+ imp->getFile(path, flags, successCallback, errorCallback);
+ return v8::Handle<v8::Value>();
+}
+
+
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/v8/custom/V8EntryCustom.cpp b/WebCore/bindings/v8/custom/V8EntryCustom.cpp
new file mode 100644
index 0000000..c02cd6f
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8EntryCustom.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Entry.h"
+
+#if ENABLE(FILE_SYSTEM)
+
+#include "V8Attr.h"
+#include "V8Binding.h"
+#include "V8BindingState.h"
+#include "V8DirectoryEntry.h"
+#include "V8Entry.h"
+#include "V8FileEntry.h"
+#include "V8Proxy.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+v8::Handle<v8::Value> toV8(Entry* impl)
+{
+ if (!impl)
+ return v8::Null();
+
+ if (impl->isFile())
+ return toV8(static_cast<FileEntry*>(impl));
+
+ ASSERT(impl->isDirectory());
+ return toV8(static_cast<DirectoryEntry*>(impl));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILE_SYSTEM)
diff --git a/WebCore/bindings/v8/custom/V8EventCustom.cpp b/WebCore/bindings/v8/custom/V8EventCustom.cpp
index e0bb02b..f96ba7a 100644
--- a/WebCore/bindings/v8/custom/V8EventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8EventCustom.cpp
@@ -43,6 +43,7 @@
#include "V8DeviceMotionEvent.h"
#include "V8DeviceOrientationEvent.h"
#include "V8ErrorEvent.h"
+#include "V8HashChangeEvent.h"
#include "V8IDBErrorEvent.h"
#include "V8IDBSuccessEvent.h"
#include "V8KeyboardEvent.h"
@@ -120,6 +121,8 @@ v8::Handle<v8::Value> toV8(Event* impl)
#endif
return toV8(static_cast<UIEvent*>(impl));
}
+ if (impl->isHashChangeEvent())
+ return toV8(static_cast<HashChangeEvent*>(impl));
if (impl->isMutationEvent())
return toV8(static_cast<MutationEvent*>(impl));
if (impl->isOverflowEvent())
diff --git a/WebCore/bindings/v8/npruntime_internal.h b/WebCore/bindings/v8/npruntime_internal.h
index 75bf2b0..40d639f 100644
--- a/WebCore/bindings/v8/npruntime_internal.h
+++ b/WebCore/bindings/v8/npruntime_internal.h
@@ -38,4 +38,16 @@
#undef Auto
#undef Complex
#undef Status
+ #undef CursorShape
+ #undef FocusIn
+ #undef FocusOut
+ #undef KeyPress
+ #undef KeyRelease
+ #undef Unsorted
+ #undef Bool
+ #undef FontChange
+ #undef GrayScale
+ #undef NormalState
+ #undef True
+ #undef False
#endif