mirror of
https://github.com/rkd77/elinks.git
synced 2024-08-20 20:54:47 -04:00
DOM ecmascript: data types conformable with the DOM2-HTML recomendation.
This commit is contained in:
parent
ec32eeb1d3
commit
7a55be295c
@ -57,7 +57,7 @@ HTMLAnchorElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->shape);
|
||||
break;
|
||||
case JSP_HTML_ANCHOR_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
case JSP_HTML_ANCHOR_ELEMENT_TARGET:
|
||||
string_to_jsval(ctx, vp, html->target);
|
||||
@ -120,8 +120,7 @@ HTMLAnchorElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->shape, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_ANCHOR_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
case JSP_HTML_ANCHOR_ELEMENT_TARGET:
|
||||
mem_free_set(&html->target, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -19,9 +19,9 @@ struct A_struct {
|
||||
unsigned char *rel;
|
||||
unsigned char *rev;
|
||||
unsigned char *shape;
|
||||
unsigned char *tab_index;
|
||||
unsigned char *target;
|
||||
unsigned char *type;
|
||||
int tab_index;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -48,7 +48,7 @@ HTMLAppletElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->height);
|
||||
break;
|
||||
case JSP_HTML_APPLET_ELEMENT_HSPACE:
|
||||
string_to_jsval(ctx, vp, html->hspace);
|
||||
int_to_jsval(ctx, vp, html->hspace);
|
||||
break;
|
||||
case JSP_HTML_APPLET_ELEMENT_NAME:
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
@ -57,7 +57,7 @@ HTMLAppletElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->object);
|
||||
break;
|
||||
case JSP_HTML_APPLET_ELEMENT_VSPACE:
|
||||
string_to_jsval(ctx, vp, html->vspace);
|
||||
int_to_jsval(ctx, vp, html->vspace);
|
||||
break;
|
||||
case JSP_HTML_APPLET_ELEMENT_WIDTH:
|
||||
string_to_jsval(ctx, vp, html->width);
|
||||
@ -107,8 +107,7 @@ HTMLAppletElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->height, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_APPLET_ELEMENT_HSPACE:
|
||||
mem_free_set(&html->hspace, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->hspace);
|
||||
case JSP_HTML_APPLET_ELEMENT_NAME:
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
@ -116,8 +115,7 @@ HTMLAppletElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->object, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_APPLET_ELEMENT_VSPACE:
|
||||
mem_free_set(&html->vspace, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->vspace);
|
||||
case JSP_HTML_APPLET_ELEMENT_WIDTH:
|
||||
mem_free_set(&html->width, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -16,11 +16,11 @@ struct APPLET_struct {
|
||||
unsigned char *code;
|
||||
unsigned char *code_base;
|
||||
unsigned char *height;
|
||||
unsigned char *hspace;
|
||||
unsigned char *name;
|
||||
unsigned char *object;
|
||||
unsigned char *vspace;
|
||||
unsigned char *width;
|
||||
int hspace;
|
||||
int vspace;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -42,13 +42,13 @@ HTMLAreaElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->href);
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_NO_HREF:
|
||||
string_to_jsval(ctx, vp, html->no_href);
|
||||
boolean_to_jsval(ctx, vp, html->no_href);
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_SHAPE:
|
||||
string_to_jsval(ctx, vp, html->shape);
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_TARGET:
|
||||
string_to_jsval(ctx, vp, html->target);
|
||||
@ -92,14 +92,13 @@ HTMLAreaElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->href, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_NO_HREF:
|
||||
mem_free_set(&html->no_href, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->no_href = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_SHAPE:
|
||||
mem_free_set(&html->shape, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_AREA_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
case JSP_HTML_AREA_ELEMENT_TARGET:
|
||||
mem_free_set(&html->target, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -14,10 +14,10 @@ struct AREA_struct {
|
||||
unsigned char *alt;
|
||||
unsigned char *coords;
|
||||
unsigned char *href;
|
||||
unsigned char *no_href;
|
||||
unsigned char *shape;
|
||||
unsigned char *tab_index;
|
||||
unsigned char *target;
|
||||
int tab_index;
|
||||
unsigned int no_href:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@ HTMLBaseFontElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
string_to_jsval(ctx, vp, html->face);
|
||||
break;
|
||||
case JSP_HTML_BASE_FONT_ELEMENT_SIZE:
|
||||
string_to_jsval(ctx, vp, html->size);
|
||||
int_to_jsval(ctx, vp, html->size);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -71,8 +71,7 @@ HTMLBaseFontElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
mem_free_set(&html->face, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_BASE_FONT_ELEMENT_SIZE:
|
||||
mem_free_set(&html->size, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->size);
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ struct BASEFONT_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *color;
|
||||
unsigned char *face;
|
||||
unsigned char *size;
|
||||
int size;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -37,13 +37,13 @@ HTMLButtonElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->access_key);
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_NAME:
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_TYPE:
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
@ -81,14 +81,13 @@ HTMLButtonElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->access_key, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_NAME:
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
case JSP_HTML_BUTTON_ELEMENT_VALUE:
|
||||
mem_free_set(&html->value, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -12,11 +12,11 @@ struct BUTTON_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* TODO: proper type */
|
||||
unsigned char *access_key;
|
||||
unsigned char *disabled;
|
||||
unsigned char *name;
|
||||
unsigned char *tab_index;
|
||||
unsigned char *type;
|
||||
unsigned char *value;
|
||||
int tab_index;
|
||||
unsigned char disabled:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLDListElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_DLIST_ELEMENT_COMPACT:
|
||||
string_to_jsval(ctx, vp, html->compact);
|
||||
boolean_to_jsval(ctx, vp, html->compact);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -59,7 +59,7 @@ HTMLDListElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_DLIST_ELEMENT_COMPACT:
|
||||
mem_free_set(&html->compact, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->compact = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLDListElement_props[];
|
||||
|
||||
struct DL_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *compact;
|
||||
unsigned int compact:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLDirectoryElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_DIRECTORY_ELEMENT_COMPACT:
|
||||
string_to_jsval(ctx, vp, html->compact);
|
||||
boolean_to_jsval(ctx, vp, html->compact);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -59,7 +59,7 @@ HTMLDirectoryElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_DIRECTORY_ELEMENT_COMPACT:
|
||||
mem_free_set(&html->compact, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->compact = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLDirectoryElement_props[];
|
||||
|
||||
struct DIR_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *compact;
|
||||
unsigned int compact:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -7,37 +7,54 @@
|
||||
#include "document/dom/ecmascript/spidermonkey.h"
|
||||
#include "document/dom/ecmascript/spidermonkey/Node.h"
|
||||
#include "document/dom/ecmascript/spidermonkey/html/HTMLFormElement.h"
|
||||
#include "dom/node.h"
|
||||
|
||||
static JSBool
|
||||
HTMLFormElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
struct dom_node *node;
|
||||
struct FORM_struct *html;
|
||||
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return JS_TRUE;
|
||||
|
||||
if (!obj || (!JS_InstanceOf(ctx, obj, (JSClass *)&HTMLFormElement_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;
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return JS_TRUE;
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_FORM_ELEMENT_ELEMENTS:
|
||||
string_to_jsval(ctx, vp, html->elements);
|
||||
/* Write me! */
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_LENGTH:
|
||||
/* Write me! */
|
||||
int_to_jsval(ctx, vp, html->length);
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_NAME:
|
||||
/* Write me! */
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_ACCEPT_CHARSET:
|
||||
/* Write me! */
|
||||
string_to_jsval(ctx, vp, html->accept_charset);
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_ACTION:
|
||||
/* Write me! */
|
||||
string_to_jsval(ctx, vp, html->action);
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_ENCTYPE:
|
||||
/* Write me! */
|
||||
string_to_jsval(ctx, vp, html->enctype);
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_METHOD:
|
||||
/* Write me! */
|
||||
string_to_jsval(ctx, vp, html->method);
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_TARGET:
|
||||
/* Write me! */
|
||||
string_to_jsval(ctx, vp, html->target);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -48,27 +65,42 @@ HTMLFormElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
static JSBool
|
||||
HTMLFormElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
{
|
||||
struct dom_node *node;
|
||||
struct FORM_struct *html;
|
||||
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return JS_TRUE;
|
||||
|
||||
if (!obj || (!JS_InstanceOf(ctx, obj, (JSClass *)&HTMLFormElement_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;
|
||||
if (!JSVAL_IS_INT(id))
|
||||
return JS_TRUE;
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_FORM_ELEMENT_NAME:
|
||||
/* Write me! */
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_ACCEPT_CHARSET:
|
||||
/* Write me! */
|
||||
mem_free_set(&html->accept_charset, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_ACTION:
|
||||
/* Write me! */
|
||||
mem_free_set(&html->action, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_ENCTYPE:
|
||||
/* Write me! */
|
||||
mem_free_set(&html->enctype, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_METHOD:
|
||||
/* Write me! */
|
||||
mem_free_set(&html->method, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_FORM_ELEMENT_TARGET:
|
||||
/* Write me! */
|
||||
mem_free_set(&html->target, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
|
@ -8,17 +8,16 @@ extern const JSClass HTMLFormElement_class;
|
||||
extern const JSFunctionSpec HTMLFormElement_funcs[];
|
||||
extern const JSPropertySpec HTMLFormElement_props[];
|
||||
|
||||
struct FRAME_struct {
|
||||
struct FORM_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *frame_border;
|
||||
unsigned char *long_desc;
|
||||
unsigned char *margin_height;
|
||||
unsigned char *margin_width;
|
||||
unsigned char *elements; /* FIXME: proper type */
|
||||
unsigned char *name;
|
||||
unsigned char *no_resize;
|
||||
unsigned char *scrolling;
|
||||
unsigned char *src;
|
||||
unsigned char *content_document; /* FIXME: proper type */
|
||||
unsigned char *accept_charset;
|
||||
unsigned char *action;
|
||||
unsigned char *enctype;
|
||||
unsigned char *method;
|
||||
unsigned char *target;
|
||||
int length;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -45,7 +45,7 @@ HTMLFrameElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
break;
|
||||
case JSP_HTML_FRAME_ELEMENT_NO_RESIZE:
|
||||
string_to_jsval(ctx, vp, html->no_resize);
|
||||
boolean_to_jsval(ctx, vp, html->no_resize);
|
||||
break;
|
||||
case JSP_HTML_FRAME_ELEMENT_SCROLLING:
|
||||
string_to_jsval(ctx, vp, html->scrolling);
|
||||
@ -99,7 +99,7 @@ HTMLFrameElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_FRAME_ELEMENT_NO_RESIZE:
|
||||
mem_free_set(&html->no_resize, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->no_resize = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_FRAME_ELEMENT_SCROLLING:
|
||||
mem_free_set(&html->scrolling, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -15,10 +15,10 @@ struct FRAME_struct {
|
||||
unsigned char *margin_height;
|
||||
unsigned char *margin_width;
|
||||
unsigned char *name;
|
||||
unsigned char *no_resize;
|
||||
unsigned char *scrolling;
|
||||
unsigned char *src;
|
||||
unsigned char *content_document; /* FIXME: proper type */
|
||||
unsigned int no_resize:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ HTMLHRElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->align);
|
||||
break;
|
||||
case JSP_HTML_HR_ELEMENT_NO_SHADE:
|
||||
string_to_jsval(ctx, vp, html->no_shade);
|
||||
boolean_to_jsval(ctx, vp, html->no_shade);
|
||||
break;
|
||||
case JSP_HTML_HR_ELEMENT_SIZE:
|
||||
string_to_jsval(ctx, vp, html->size);
|
||||
@ -71,7 +71,7 @@ HTMLHRElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->align, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_HR_ELEMENT_NO_SHADE:
|
||||
mem_free_set(&html->no_shade, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->no_shade = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_HR_ELEMENT_SIZE:
|
||||
mem_free_set(&html->size, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -11,9 +11,9 @@ extern const JSPropertySpec HTMLHRElement_props[];
|
||||
struct HR_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *align;
|
||||
unsigned char *no_shade;
|
||||
unsigned char *size;
|
||||
unsigned char *width;
|
||||
unsigned int no_shade:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -42,13 +42,13 @@ HTMLImageElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->border);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_HEIGHT:
|
||||
string_to_jsval(ctx, vp, html->height);
|
||||
int_to_jsval(ctx, vp, html->height);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_HSPACE:
|
||||
string_to_jsval(ctx, vp, html->hspace);
|
||||
int_to_jsval(ctx, vp, html->hspace);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_IS_MAP:
|
||||
string_to_jsval(ctx, vp, html->is_map);
|
||||
boolean_to_jsval(ctx, vp, html->is_map);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_LONG_DESC:
|
||||
string_to_jsval(ctx, vp, html->long_desc);
|
||||
@ -60,10 +60,10 @@ HTMLImageElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->use_map);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_VSPACE:
|
||||
string_to_jsval(ctx, vp, html->vspace);
|
||||
int_to_jsval(ctx, vp, html->vspace);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_WIDTH:
|
||||
string_to_jsval(ctx, vp, html->width);
|
||||
int_to_jsval(ctx, vp, html->width);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -104,13 +104,11 @@ HTMLImageElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->border, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_HEIGHT:
|
||||
mem_free_set(&html->height, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->height);
|
||||
case JSP_HTML_IMAGE_ELEMENT_HSPACE:
|
||||
mem_free_set(&html->hspace, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->hspace);
|
||||
case JSP_HTML_IMAGE_ELEMENT_IS_MAP:
|
||||
mem_free_set(&html->is_map, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->is_map = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_LONG_DESC:
|
||||
mem_free_set(&html->long_desc, stracpy(jsval_to_string(ctx, vp)));
|
||||
@ -122,11 +120,9 @@ HTMLImageElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->use_map, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_IMAGE_ELEMENT_VSPACE:
|
||||
mem_free_set(&html->vspace, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->vspace);
|
||||
case JSP_HTML_IMAGE_ELEMENT_WIDTH:
|
||||
mem_free_set(&html->width, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->width);
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
}
|
||||
|
@ -14,14 +14,14 @@ struct IMAGE_struct {
|
||||
unsigned char *align;
|
||||
unsigned char *alt;
|
||||
unsigned char *border;
|
||||
unsigned char *height;
|
||||
unsigned char *hspace;
|
||||
unsigned char *is_map;
|
||||
unsigned char *long_desc;
|
||||
unsigned char *src;
|
||||
unsigned char *use_map;
|
||||
unsigned char *vspace;
|
||||
unsigned char *width;
|
||||
int height;
|
||||
int hspace;
|
||||
int vspace;
|
||||
int width;
|
||||
unsigned int is_map:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ HTMLInputElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->default_value);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_DEFAULT_CHECKED:
|
||||
string_to_jsval(ctx, vp, html->default_checked);
|
||||
boolean_to_jsval(ctx, vp, html->default_checked);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
@ -52,30 +52,28 @@ HTMLInputElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->alt);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_CHECKED:
|
||||
string_to_jsval(ctx, vp, html->checked);
|
||||
boolean_to_jsval(ctx, vp, html->checked);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_MAX_LENGTH:
|
||||
string_to_jsval(ctx, vp, html->max_length);
|
||||
/* Write me! */
|
||||
int_to_jsval(ctx, vp, html->max_length);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_NAME:
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_READ_ONLY:
|
||||
string_to_jsval(ctx, vp, html->read_only);
|
||||
boolean_to_jsval(ctx, vp, html->read_only);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_SIZE:
|
||||
string_to_jsval(ctx, vp, html->size);
|
||||
/* Write me! */
|
||||
int_to_jsval(ctx, vp, html->size);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_SRC:
|
||||
string_to_jsval(ctx, vp, html->src);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_TYPE:
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
@ -116,7 +114,7 @@ HTMLInputElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->default_value, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_DEFAULT_CHECKED:
|
||||
mem_free_set(&html->default_checked, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->default_checked = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_ACCEPT:
|
||||
mem_free_set(&html->accept, stracpy(jsval_to_string(ctx, vp)));
|
||||
@ -131,29 +129,26 @@ HTMLInputElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->alt, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_CHECKED:
|
||||
mem_free_set(&html->checked, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->checked = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_MAX_LENGTH:
|
||||
mem_free_set(&html->max_length, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->max_length);
|
||||
case JSP_HTML_INPUT_ELEMENT_NAME:
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_READ_ONLY:
|
||||
mem_free_set(&html->read_only, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->read_only = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_SIZE:
|
||||
mem_free_set(&html->size, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->size);
|
||||
case JSP_HTML_INPUT_ELEMENT_SRC:
|
||||
mem_free_set(&html->src, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
case JSP_HTML_INPUT_ELEMENT_TYPE:
|
||||
mem_free_set(&html->type, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -11,23 +11,23 @@ extern const JSPropertySpec HTMLInputElement_props[];
|
||||
struct INPUT_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *default_value;
|
||||
unsigned char *default_checked;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
unsigned char *accept;
|
||||
unsigned char *access_key;
|
||||
unsigned char *align;
|
||||
unsigned char *alt;
|
||||
unsigned char *checked;
|
||||
unsigned char *disabled;
|
||||
unsigned char *max_length;
|
||||
unsigned char *name;
|
||||
unsigned char *read_only;
|
||||
unsigned char *size;
|
||||
unsigned char *src;
|
||||
unsigned char *tab_index;
|
||||
unsigned char *type;
|
||||
unsigned char *use_map;
|
||||
unsigned char *value;
|
||||
int max_length;
|
||||
int size;
|
||||
int tab_index;
|
||||
unsigned int default_checked:1;
|
||||
unsigned int checked:1;
|
||||
unsigned int disabled:1;
|
||||
unsigned int read_only:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@ HTMLLIElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
break;
|
||||
case JSP_HTML_LI_ELEMENT_VALUE:
|
||||
string_to_jsval(ctx, vp, html->value);
|
||||
int_to_jsval(ctx, vp, html->value);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -65,8 +65,7 @@ HTMLLIElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
mem_free_set(&html->type, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_LI_ELEMENT_VALUE:
|
||||
mem_free_set(&html->value, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->value);
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ extern const JSPropertySpec HTMLLIElement_props[];
|
||||
struct LI_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *type;
|
||||
unsigned char *value;
|
||||
int value;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLLinkElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_LINK_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_LINK_ELEMENT_CHARSET:
|
||||
string_to_jsval(ctx, vp, html->charset);
|
||||
@ -83,7 +83,7 @@ HTMLLinkElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_LINK_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_LINK_ELEMENT_CHARSET:
|
||||
mem_free_set(&html->charset, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -10,7 +10,6 @@ extern const JSPropertySpec HTMLLinkElement_props[];
|
||||
|
||||
struct LINK_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *disabled;
|
||||
unsigned char *charset;
|
||||
unsigned char *href;
|
||||
unsigned char *hreflang;
|
||||
@ -19,6 +18,7 @@ struct LINK_struct {
|
||||
unsigned char *rev;
|
||||
unsigned char *target;
|
||||
unsigned char *type;
|
||||
unsigned int disabled:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLMenuElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_MENU_ELEMENT_COMPACT:
|
||||
string_to_jsval(ctx, vp, html->compact);
|
||||
boolean_to_jsval(ctx, vp, html->compact);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -59,7 +59,7 @@ HTMLMenuElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_MENU_ELEMENT_COMPACT:
|
||||
mem_free_set(&html->compact, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->compact = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLMenuElement_props[];
|
||||
|
||||
struct MENU_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *compact;
|
||||
unsigned int compact:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,10 +30,10 @@ HTMLOListElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OLIST_ELEMENT_COMPACT:
|
||||
string_to_jsval(ctx, vp, html->compact);
|
||||
boolean_to_jsval(ctx, vp, html->compact);
|
||||
break;
|
||||
case JSP_HTML_OLIST_ELEMENT_START:
|
||||
string_to_jsval(ctx, vp, html->start);
|
||||
int_to_jsval(ctx, vp, html->start);
|
||||
break;
|
||||
case JSP_HTML_OLIST_ELEMENT_TYPE:
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
@ -65,11 +65,10 @@ HTMLOListElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OLIST_ELEMENT_COMPACT:
|
||||
mem_free_set(&html->compact, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->compact = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OLIST_ELEMENT_START:
|
||||
mem_free_set(&html->start, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->start);
|
||||
case JSP_HTML_OLIST_ELEMENT_TYPE:
|
||||
mem_free_set(&html->type, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -10,9 +10,9 @@ extern const JSPropertySpec HTMLOListElement_props[];
|
||||
|
||||
struct OL_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *compact;
|
||||
unsigned char *start;
|
||||
unsigned char *type;
|
||||
int start;
|
||||
unsigned int compact:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -55,13 +55,13 @@ HTMLObjectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->data);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_DECLARE:
|
||||
string_to_jsval(ctx, vp, html->declare);
|
||||
boolean_to_jsval(ctx, vp, html->declare);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_HEIGHT:
|
||||
string_to_jsval(ctx, vp, html->height);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_HSPACE:
|
||||
string_to_jsval(ctx, vp, html->hspace);
|
||||
int_to_jsval(ctx, vp, html->hspace);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_NAME:
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
@ -70,7 +70,7 @@ HTMLObjectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->standby);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_TYPE:
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
@ -79,7 +79,7 @@ HTMLObjectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->use_map);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_VSPACE:
|
||||
string_to_jsval(ctx, vp, html->vspace);
|
||||
int_to_jsval(ctx, vp, html->vspace);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_WIDTH:
|
||||
string_to_jsval(ctx, vp, html->width);
|
||||
@ -136,14 +136,13 @@ HTMLObjectElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->data, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_DECLARE:
|
||||
mem_free_set(&html->declare, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->declare = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_HEIGHT:
|
||||
mem_free_set(&html->height, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_HSPACE:
|
||||
mem_free_set(&html->hspace, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->hspace);
|
||||
case JSP_HTML_OBJECT_ELEMENT_NAME:
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
@ -151,8 +150,7 @@ HTMLObjectElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->standby, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
case JSP_HTML_OBJECT_ELEMENT_TYPE:
|
||||
mem_free_set(&html->type, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
@ -160,8 +158,7 @@ HTMLObjectElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->use_map, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_VSPACE:
|
||||
mem_free_set(&html->vspace, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->vspace);
|
||||
case JSP_HTML_OBJECT_ELEMENT_WIDTH:
|
||||
mem_free_set(&html->width, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -18,17 +18,17 @@ struct OBJECT_struct {
|
||||
unsigned char *code_base;
|
||||
unsigned char *code_type;
|
||||
unsigned char *data;
|
||||
unsigned char *declare;
|
||||
unsigned char *height;
|
||||
unsigned char *hspace;
|
||||
unsigned char *name;
|
||||
unsigned char *standby;
|
||||
unsigned char *tab_index;
|
||||
unsigned char *type;
|
||||
unsigned char *use_map;
|
||||
unsigned char *vspace;
|
||||
unsigned char *width;
|
||||
unsigned char *content_document; /* FIXME: proper type */
|
||||
int hspace;
|
||||
int tab_index;
|
||||
int vspace;
|
||||
unsigned int declare:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLOptGroupElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OPT_GROUP_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_OPT_GROUP_ELEMENT_LABEL:
|
||||
string_to_jsval(ctx, vp, html->label);
|
||||
@ -62,7 +62,7 @@ HTMLOptGroupElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OPT_GROUP_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OPT_GROUP_ELEMENT_LABEL:
|
||||
mem_free_set(&html->label, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -10,8 +10,8 @@ extern const JSPropertySpec HTMLOptGroupElement_props[];
|
||||
|
||||
struct OPTGROUP_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *disabled;
|
||||
unsigned char *label;
|
||||
unsigned int disabled:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -34,22 +34,22 @@ HTMLOptionElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
/* Write me! */
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_DEFAULT_SELECTED:
|
||||
string_to_jsval(ctx, vp, html->default_selected);
|
||||
boolean_to_jsval(ctx, vp, html->default_selected);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_TEXT:
|
||||
string_to_jsval(ctx, vp, html->text);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_INDEX:
|
||||
string_to_jsval(ctx, vp, html->index);
|
||||
int_to_jsval(ctx, vp, html->index);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_LABEL:
|
||||
string_to_jsval(ctx, vp, html->label);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_SELECTED:
|
||||
string_to_jsval(ctx, vp, html->selected);
|
||||
boolean_to_jsval(ctx, vp, html->selected);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_VALUE:
|
||||
string_to_jsval(ctx, vp, html->value);
|
||||
@ -81,16 +81,16 @@ HTMLOptionElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OPTION_ELEMENT_DEFAULT_SELECTED:
|
||||
mem_free_set(&html->default_selected, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->default_selected = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_LABEL:
|
||||
mem_free_set(&html->label, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_SELECTED:
|
||||
mem_free_set(&html->selected, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->selected = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_VALUE:
|
||||
mem_free_set(&html->value, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -11,13 +11,13 @@ extern const JSPropertySpec HTMLOptionElement_props[];
|
||||
struct OPTION_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
unsigned char *default_selected;
|
||||
unsigned char *text;
|
||||
unsigned char *index;
|
||||
unsigned char *disabled;
|
||||
unsigned char *label;
|
||||
unsigned char *selected;
|
||||
unsigned char *value;
|
||||
int index;
|
||||
unsigned int default_selected:1;
|
||||
unsigned int disabled:1;
|
||||
unsigned int selected:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLPreElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_PRE_ELEMENT_WIDTH:
|
||||
string_to_jsval(ctx, vp, html->width);
|
||||
int_to_jsval(ctx, vp, html->width);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -59,8 +59,7 @@ HTMLPreElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_PRE_ELEMENT_WIDTH:
|
||||
mem_free_set(&html->width, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->width);
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLPreElement_props[];
|
||||
|
||||
struct PRE_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *width;
|
||||
int width;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -42,7 +42,7 @@ HTMLScriptElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->charset);
|
||||
break;
|
||||
case JSP_HTML_SCRIPT_ELEMENT_DEFER:
|
||||
string_to_jsval(ctx, vp, html->defer);
|
||||
boolean_to_jsval(ctx, vp, html->defer);
|
||||
break;
|
||||
case JSP_HTML_SCRIPT_ELEMENT_SRC:
|
||||
string_to_jsval(ctx, vp, html->src);
|
||||
@ -89,7 +89,7 @@ HTMLScriptElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
mem_free_set(&html->charset, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_SCRIPT_ELEMENT_DEFER:
|
||||
mem_free_set(&html->defer, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->defer = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_SCRIPT_ELEMENT_SRC:
|
||||
mem_free_set(&html->src, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -14,9 +14,9 @@ struct SCRIPT_struct {
|
||||
unsigned char *html_for;
|
||||
unsigned char *event;
|
||||
unsigned char *charset;
|
||||
unsigned char *defer;
|
||||
unsigned char *src;
|
||||
unsigned char *type;
|
||||
unsigned int defer:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -33,13 +33,13 @@ HTMLSelectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_SELECTED_INDEX:
|
||||
string_to_jsval(ctx, vp, html->selected_index);
|
||||
int_to_jsval(ctx, vp, html->selected_index);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_VALUE:
|
||||
string_to_jsval(ctx, vp, html->value);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_LENGTH:
|
||||
string_to_jsval(ctx, vp, html->length);
|
||||
int_to_jsval(ctx, vp, html->length);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
@ -50,19 +50,19 @@ HTMLSelectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
/* Write me! */
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_MULTIPLE:
|
||||
string_to_jsval(ctx, vp, html->multiple);
|
||||
boolean_to_jsval(ctx, vp, html->multiple);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_NAME:
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_SIZE:
|
||||
string_to_jsval(ctx, vp, html->size);
|
||||
int_to_jsval(ctx, vp, html->size);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
@ -91,29 +91,25 @@ HTMLSelectElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_SELECT_ELEMENT_SELECTED_INDEX:
|
||||
mem_free_set(&html->selected_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->selected_index);
|
||||
case JSP_HTML_SELECT_ELEMENT_VALUE:
|
||||
mem_free_set(&html->value, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_LENGTH:
|
||||
mem_free_set(&html->length, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->length);
|
||||
case JSP_HTML_SELECT_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_MULTIPLE:
|
||||
mem_free_set(&html->multiple, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->multiple = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_NAME:
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_SIZE:
|
||||
mem_free_set(&html->size, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->size);
|
||||
case JSP_HTML_SELECT_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
default:
|
||||
return HTMLElement_setProperty(ctx, obj, id, vp);
|
||||
}
|
||||
|
@ -11,16 +11,16 @@ extern const JSPropertySpec HTMLSelectElement_props[];
|
||||
struct SELECT_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *type;
|
||||
unsigned char *selected_index;
|
||||
unsigned char *value;
|
||||
unsigned char *length;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
unsigned char *options; /* FIXME: proper type */
|
||||
unsigned char *disabled;
|
||||
unsigned char *multiple;
|
||||
unsigned char *name;
|
||||
unsigned char *size;
|
||||
unsigned char *tab_index;
|
||||
int selected_index;
|
||||
int length;
|
||||
int size;
|
||||
int tab_index;
|
||||
unsigned int disabled:1;
|
||||
unsigned int multiple:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLStyleElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_STYLE_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_STYLE_ELEMENT_MEDIA:
|
||||
string_to_jsval(ctx, vp, html->media);
|
||||
@ -65,7 +65,7 @@ HTMLStyleElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_STYLE_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_STYLE_ELEMENT_MEDIA:
|
||||
mem_free_set(&html->media, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -10,9 +10,9 @@ extern const JSPropertySpec HTMLStyleElement_props[];
|
||||
|
||||
struct STYLE_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *disabled;
|
||||
unsigned char *media;
|
||||
unsigned char *type;
|
||||
unsigned int disabled:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLTableCellElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_CELL_INDEX:
|
||||
string_to_jsval(ctx, vp, html->cell_index);
|
||||
int_to_jsval(ctx, vp, html->cell_index);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_ABBR:
|
||||
string_to_jsval(ctx, vp, html->abbr);
|
||||
@ -51,7 +51,7 @@ HTMLTableCellElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
string_to_jsval(ctx, vp, html->ch_off);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_COL_SPAN:
|
||||
string_to_jsval(ctx, vp, html->col_span);
|
||||
int_to_jsval(ctx, vp, html->col_span);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_HEADERS:
|
||||
string_to_jsval(ctx, vp, html->headers);
|
||||
@ -60,10 +60,10 @@ HTMLTableCellElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
string_to_jsval(ctx, vp, html->height);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_NO_WRAP:
|
||||
string_to_jsval(ctx, vp, html->no_wrap);
|
||||
boolean_to_jsval(ctx, vp, html->no_wrap);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_ROW_SPAN:
|
||||
string_to_jsval(ctx, vp, html->row_span);
|
||||
int_to_jsval(ctx, vp, html->row_span);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_SCOPE:
|
||||
string_to_jsval(ctx, vp, html->scope);
|
||||
@ -119,8 +119,7 @@ HTMLTableCellElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
mem_free_set(&html->ch_off, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_COL_SPAN:
|
||||
mem_free_set(&html->col_span, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->col_span);
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_HEADERS:
|
||||
mem_free_set(&html->headers, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
@ -128,11 +127,10 @@ HTMLTableCellElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval
|
||||
mem_free_set(&html->height, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_NO_WRAP:
|
||||
mem_free_set(&html->no_wrap, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->no_wrap = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_ROW_SPAN:
|
||||
mem_free_set(&html->row_span, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->row_span);
|
||||
case JSP_HTML_TABLE_CELL_ELEMENT_SCOPE:
|
||||
mem_free_set(&html->scope, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -10,21 +10,21 @@ extern const JSPropertySpec HTMLTableCellElement_props[];
|
||||
|
||||
struct TD_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *cell_index;
|
||||
unsigned char *abbr;
|
||||
unsigned char *align;
|
||||
unsigned char *axis;
|
||||
unsigned char *bgcolor;
|
||||
unsigned char *ch;
|
||||
unsigned char *ch_off;
|
||||
unsigned char *col_span;
|
||||
unsigned char *headers;
|
||||
unsigned char *height;
|
||||
unsigned char *no_wrap;
|
||||
unsigned char *row_span;
|
||||
unsigned char *scope;
|
||||
unsigned char *valign;
|
||||
unsigned char *width;
|
||||
int cell_index;
|
||||
int col_span;
|
||||
int row_span;
|
||||
unsigned int no_wrap:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -39,7 +39,7 @@ HTMLTableColElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
string_to_jsval(ctx, vp, html->ch_off);
|
||||
break;
|
||||
case JSP_HTML_TABLE_COL_ELEMENT_SPAN:
|
||||
string_to_jsval(ctx, vp, html->span);
|
||||
int_to_jsval(ctx, vp, html->span);
|
||||
break;
|
||||
case JSP_HTML_TABLE_COL_ELEMENT_VALIGN:
|
||||
string_to_jsval(ctx, vp, html->valign);
|
||||
@ -83,8 +83,7 @@ HTMLTableColElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
mem_free_set(&html->ch_off, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_TABLE_COL_ELEMENT_SPAN:
|
||||
mem_free_set(&html->span, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->span);
|
||||
case JSP_HTML_TABLE_COL_ELEMENT_VALIGN:
|
||||
mem_free_set(&html->valign, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -13,9 +13,9 @@ struct COL_struct {
|
||||
unsigned char *align;
|
||||
unsigned char *ch;
|
||||
unsigned char *ch_off;
|
||||
unsigned char *span;
|
||||
unsigned char *valign;
|
||||
unsigned char *width;
|
||||
int span;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,13 +30,14 @@ HTMLTableRowElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_TABLE_ROW_ELEMENT_ROW_INDEX:
|
||||
string_to_jsval(ctx, vp, html->row_index);
|
||||
int_to_jsval(ctx, vp, html->row_index);
|
||||
break;
|
||||
case JSP_HTML_TABLE_ROW_ELEMENT_SECTION_ROW_INDEX:
|
||||
string_to_jsval(ctx, vp, html->section_row_index);
|
||||
int_to_jsval(ctx, vp, html->section_row_index);
|
||||
break;
|
||||
case JSP_HTML_TABLE_ROW_ELEMENT_CELLS:
|
||||
string_to_jsval(ctx, vp, html->cells);
|
||||
/* Write me! */
|
||||
break;
|
||||
case JSP_HTML_TABLE_ROW_ELEMENT_ALIGN:
|
||||
string_to_jsval(ctx, vp, html->align);
|
||||
|
@ -10,14 +10,14 @@ extern const JSPropertySpec HTMLTableRowElement_props[];
|
||||
|
||||
struct TR_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *row_index;
|
||||
unsigned char *section_row_index;
|
||||
unsigned char *cells;
|
||||
unsigned char *cells; /* FIXME: proper type */
|
||||
unsigned char *align;
|
||||
unsigned char *bgcolor;
|
||||
unsigned char *ch;
|
||||
unsigned char *ch_off;
|
||||
unsigned char *valign;
|
||||
int row_index;
|
||||
int section_row_index;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -40,22 +40,22 @@ HTMLTextAreaElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
string_to_jsval(ctx, vp, html->access_key);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_COLS:
|
||||
string_to_jsval(ctx, vp, html->cols);
|
||||
int_to_jsval(ctx, vp, html->cols);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_DISABLED:
|
||||
string_to_jsval(ctx, vp, html->disabled);
|
||||
boolean_to_jsval(ctx, vp, html->disabled);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_NAME:
|
||||
string_to_jsval(ctx, vp, html->name);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_READ_ONLY:
|
||||
string_to_jsval(ctx, vp, html->read_only);
|
||||
boolean_to_jsval(ctx, vp, html->read_only);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_ROWS:
|
||||
string_to_jsval(ctx, vp, html->rows);
|
||||
int_to_jsval(ctx, vp, html->rows);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_TAB_INDEX:
|
||||
string_to_jsval(ctx, vp, html->tab_index);
|
||||
int_to_jsval(ctx, vp, html->tab_index);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_TYPE:
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
@ -96,23 +96,20 @@ HTMLTextAreaElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
mem_free_set(&html->access_key, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_COLS:
|
||||
mem_free_set(&html->cols, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->cols);
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_DISABLED:
|
||||
mem_free_set(&html->disabled, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->disabled = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_NAME:
|
||||
mem_free_set(&html->name, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_READ_ONLY:
|
||||
mem_free_set(&html->read_only, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->read_only = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_ROWS:
|
||||
mem_free_set(&html->rows, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->rows);
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_TAB_INDEX:
|
||||
mem_free_set(&html->tab_index, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
return JS_ValueToInt32(ctx, *vp, &html->tab_index);
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_VALUE:
|
||||
mem_free_set(&html->value, stracpy(jsval_to_string(ctx, vp)));
|
||||
break;
|
||||
|
@ -13,15 +13,14 @@ struct TEXTAREA_struct {
|
||||
unsigned char *default_value;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
unsigned char *access_key;
|
||||
unsigned char *cols;
|
||||
unsigned char *disabled;
|
||||
unsigned char *name;
|
||||
unsigned char *read_only;
|
||||
unsigned char *rows;
|
||||
unsigned char *tab_index;
|
||||
unsigned char *type;
|
||||
unsigned char *value;
|
||||
|
||||
int cols;
|
||||
int rows;
|
||||
int tab_index;
|
||||
unsigned int disabled:1;
|
||||
unsigned int read_only:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -30,7 +30,7 @@ HTMLUListElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_ULIST_ELEMENT_COMPACT:
|
||||
string_to_jsval(ctx, vp, html->compact);
|
||||
boolean_to_jsval(ctx, vp, html->compact);
|
||||
break;
|
||||
case JSP_HTML_ULIST_ELEMENT_TYPE:
|
||||
string_to_jsval(ctx, vp, html->type);
|
||||
@ -62,7 +62,7 @@ HTMLUListElement_setProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_ULIST_ELEMENT_COMPACT:
|
||||
mem_free_set(&html->compact, stracpy(jsval_to_string(ctx, vp)));
|
||||
html->compact = jsval_to_boolean(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_ULIST_ELEMENT_TYPE:
|
||||
mem_free_set(&html->type, stracpy(jsval_to_string(ctx, vp)));
|
||||
|
@ -10,8 +10,8 @@ extern const JSPropertySpec HTMLUListElement_props[];
|
||||
|
||||
struct UL_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *compact;
|
||||
unsigned char *type;
|
||||
unsigned int compact:1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user