mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
DOM, ecmascript: In elements that have form property, this property points to
the node which contains that form.
This commit is contained in:
parent
9b23b1d013
commit
8b19aac004
@ -30,8 +30,10 @@ HTMLButtonElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_BUTTON_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_BUTTON_ELEMENT_ACCESS_KEY:
|
||||
string_to_jsval(ctx, vp, html->access_key);
|
||||
@ -136,7 +138,7 @@ done_BUTTON_object(void *data)
|
||||
{
|
||||
struct BUTTON_struct *d = data;
|
||||
|
||||
/* form ? */
|
||||
/* form musn't be freed */
|
||||
mem_free_if(d->access_key);
|
||||
mem_free_if(d->name);
|
||||
mem_free_if(d->type);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLButtonElement_props[];
|
||||
|
||||
struct BUTTON_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* TODO: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *access_key;
|
||||
unsigned char *name;
|
||||
unsigned char *type;
|
||||
|
@ -31,7 +31,10 @@ HTMLFieldSetElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_FIELD_SET_ELEMENT_FORM:
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
default:
|
||||
return HTMLElement_getProperty(ctx, obj, id, vp);
|
||||
|
@ -9,7 +9,7 @@ extern const JSPropertySpec HTMLFieldSetElement_props[];
|
||||
|
||||
struct FIELDSET_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
};
|
||||
|
||||
void make_FIELDSET_object(JSContext *ctx, struct dom_node *node);
|
||||
|
@ -36,8 +36,10 @@ HTMLInputElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
boolean_to_jsval(ctx, vp, html->default_checked);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_INPUT_ELEMENT_ACCEPT:
|
||||
string_to_jsval(ctx, vp, html->accept);
|
||||
|
@ -11,7 +11,7 @@ extern const JSPropertySpec HTMLInputElement_props[];
|
||||
struct INPUT_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *default_value;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *accept;
|
||||
unsigned char *access_key;
|
||||
unsigned char *align;
|
||||
|
@ -30,8 +30,10 @@ HTMLIsIndexElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *v
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_IS_INDEX_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_IS_INDEX_ELEMENT_PROMPT:
|
||||
string_to_jsval(ctx, vp, html->prompt);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLIsIndexElement_props[];
|
||||
|
||||
struct ISINDEX_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *prompt;
|
||||
};
|
||||
|
||||
|
@ -30,8 +30,10 @@ HTMLLabelElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_LABEL_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_LABEL_ELEMENT_ACCESS_KEY:
|
||||
string_to_jsval(ctx, vp, html->access_key);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLLabelElement_props[];
|
||||
|
||||
struct LABEL_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *access_key;
|
||||
unsigned char *html_for;
|
||||
};
|
||||
|
@ -30,8 +30,10 @@ HTMLLegendElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_LEGEND_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_LEGEND_ELEMENT_ACCESS_KEY:
|
||||
string_to_jsval(ctx, vp, html->access_key);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLLegendElement_props[];
|
||||
|
||||
struct LEGEND_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *access_key;
|
||||
unsigned char *align;
|
||||
};
|
||||
|
@ -30,8 +30,10 @@ HTMLObjectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OBJECT_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OBJECT_ELEMENT_CODE:
|
||||
string_to_jsval(ctx, vp, html->code);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLObjectElement_props[];
|
||||
|
||||
struct OBJECT_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *code;
|
||||
unsigned char *align;
|
||||
unsigned char *archive;
|
||||
|
@ -30,8 +30,10 @@ HTMLOptionElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
|
||||
switch (JSVAL_TO_INT(id)) {
|
||||
case JSP_HTML_OPTION_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_OPTION_ELEMENT_DEFAULT_SELECTED:
|
||||
boolean_to_jsval(ctx, vp, html->default_selected);
|
||||
|
@ -10,7 +10,7 @@ extern const JSPropertySpec HTMLOptionElement_props[];
|
||||
|
||||
struct OPTION_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *text;
|
||||
unsigned char *label;
|
||||
unsigned char *value;
|
||||
|
@ -42,8 +42,10 @@ HTMLSelectElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *vp
|
||||
int_to_jsval(ctx, vp, html->length);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_SELECT_ELEMENT_OPTIONS:
|
||||
string_to_jsval(ctx, vp, html->options);
|
||||
|
@ -12,7 +12,7 @@ struct SELECT_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *type;
|
||||
unsigned char *value;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *options; /* FIXME: proper type */
|
||||
unsigned char *name;
|
||||
int selected_index;
|
||||
|
@ -33,8 +33,10 @@ HTMLTextAreaElement_getProperty(JSContext *ctx, JSObject *obj, jsval id, jsval *
|
||||
string_to_jsval(ctx, vp, html->default_value);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_FORM:
|
||||
string_to_jsval(ctx, vp, html->form);
|
||||
/* Write me! */
|
||||
if (html->form)
|
||||
object_to_jsval(ctx, vp, html->form->ecmascript_obj);
|
||||
else
|
||||
undef_to_jsval(ctx, vp);
|
||||
break;
|
||||
case JSP_HTML_TEXT_AREA_ELEMENT_ACCESS_KEY:
|
||||
string_to_jsval(ctx, vp, html->access_key);
|
||||
|
@ -11,7 +11,7 @@ extern const JSPropertySpec HTMLTextAreaElement_props[];
|
||||
struct TEXTAREA_struct {
|
||||
struct HTMLElement_struct html;
|
||||
unsigned char *default_value;
|
||||
unsigned char *form; /* FIXME: proper type */
|
||||
struct dom_node *form;
|
||||
unsigned char *access_key;
|
||||
unsigned char *name;
|
||||
unsigned char *type;
|
||||
|
Loading…
x
Reference in New Issue
Block a user