1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

DOM, ecmascript: Defined FIELDSET functions.

This commit is contained in:
Witold Filipczyk 2007-06-11 11:33:21 +02:00 committed by Witold Filipczyk
parent 3f99ea9896
commit 9b23b1d013
3 changed files with 38 additions and 3 deletions

View File

@ -42,7 +42,6 @@ void done_HTMLElement(void *data);
#define make_DFN_object make_HTMLElement
#define make_DT_object make_HTMLElement
#define make_EM_object make_HTMLElement
#define make_FIELDSET_object make_HTMLElement
#define make_I_object make_HTMLElement
#define make_INS_object make_HTMLElement
#define make_KBD_object make_HTMLElement
@ -82,7 +81,6 @@ void done_HTMLElement(void *data);
#define done_DFN_object NULL
#define done_DT_object NULL
#define done_EM_object NULL
#define done_FIELDSET_object NULL
#define done_I_object NULL
#define done_INS_object NULL
#define done_KBD_object NULL

View File

@ -8,13 +8,27 @@
#include "document/dom/ecmascript/spidermonkey/Node.h"
#include "document/dom/ecmascript/spidermonkey/html/HTMLElement.h"
#include "document/dom/ecmascript/spidermonkey/html/HTMLFieldSetElement.h"
#include "dom/node.h"
static JSBool
HTMLFieldSetElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct dom_node *node;
struct FIELDSET_struct *html;
if (!JSVAL_IS_INT(id))
return JS_TRUE;
if (!obj || (!JS_InstanceOf(ctx, obj, (JSClass *)&HTMLFieldSetElement_class, NULL)))
return JS_FALSE;
node = JS_GetPrivate(ctx, obj);
if (!node)
return JS_FALSE;
html = node->data.element.html_data;
if (!html)
return JS_FALSE;
switch (JSVAL_TO_INT(id)) {
case JSP_HTML_FIELD_SET_ELEMENT_FORM:
/* Write me! */
@ -38,7 +52,22 @@ const JSClass HTMLFieldSetElement_class = {
"HTMLFieldSetElement",
JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub,
HTMLFieldSetElement_getProperty, JS_PropertyStub,
HTMLFieldSetElement_getProperty, HTMLElement_setProperty,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Node_finalize
};
void
make_FIELDSET_object(JSContext *ctx, struct dom_node *node)
{
struct html_objects *o = JS_GetContextPrivate(ctx);
node->data.element.html_data = mem_calloc(1, sizeof(struct FIELDSET_struct));
if (node->data.element.html_data) {
node->ecmascript_obj = JS_NewObject(ctx, (JSClass *)&HTMLFieldSetElement_class, o->HTMLElement_object, NULL);
}
}
void
done_FIELDSET_object(void *data)
{
}

View File

@ -7,4 +7,12 @@ extern const JSClass HTMLFieldSetElement_class;
extern const JSFunctionSpec HTMLFieldSetElement_funcs[];
extern const JSPropertySpec HTMLFieldSetElement_props[];
struct FIELDSET_struct {
struct HTMLElement_struct html;
unsigned char *form; /* FIXME: proper type */
};
void make_FIELDSET_object(JSContext *ctx, struct dom_node *node);
void done_FIELDSET_object(void *data);
#endif