diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-21 15:16:52 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-21 15:16:52 (GMT) |
commit | bd45c688b3d3aad5d62b85457ce943eaadf989ae (patch) | |
tree | 831d54da85c85f3e998be70241f8ffc3fed7f924 /src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp | |
parent | a52fb3364968e31a1a15c85ac45b68d9f531687b (diff) | |
download | uscxml-bd45c688b3d3aad5d62b85457ce943eaadf989ae.zip uscxml-bd45c688b3d3aad5d62b85457ce943eaadf989ae.tar.gz uscxml-bd45c688b3d3aad5d62b85457ce943eaadf989ae.tar.bz2 |
Added WebStorage object to document
Some refinements to DotWriter
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp index c6fdce1..52d6a88 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCDocumentCustom.cpp @@ -1,4 +1,5 @@ #include "JSCDocument.h" +#include "JSCStorage.h" #include "JSCXPathResult.h" #include "JSCNode.h" #include <XPath/XPath.hpp> @@ -6,6 +7,23 @@ namespace Arabica { namespace DOM { +JSValueRef JSCDocument::localStorageCustomAttrGetter(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) { + struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); + + if (!privData->dom->storage) { + return JSValueMakeUndefined(ctx); + } + + JSClassRef retClass = JSCStorage::getTmpl(); + struct JSCStorage::JSCStoragePrivate* retPrivData = new JSCStorage::JSCStoragePrivate(); + retPrivData->dom = privData->dom; + retPrivData->nativeObj = retPrivData->dom->storage; + + JSObjectRef arbaicaRetObj = JSObjectMake(ctx, retClass, retPrivData); + return arbaicaRetObj; + +} + JSValueRef JSCDocument::evaluateCustomCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef object, size_t argumentCount, const JSValueRef* arguments, JSValueRef* exception) { struct JSCDocumentPrivate* privData = (struct JSCDocumentPrivate*)JSObjectGetPrivate(object); |