mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
SEE: use periodic callback. SEE engine passes infinite test
This commit is contained in:
parent
0a1b522fdd
commit
b1c8eb5572
@ -60,6 +60,7 @@ static void
|
||||
see_init(struct module *xxx)
|
||||
{
|
||||
init_intern_strings();
|
||||
SEE_system.periodic = checktime;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -83,7 +83,6 @@ document_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *str;
|
||||
unsigned char *string;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
|
||||
if (p == s_cookie) {
|
||||
@ -175,7 +174,6 @@ document_put(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_value res;
|
||||
unsigned char *string;
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_forms) {
|
||||
SEE_ToObject(interp, val, &res);
|
||||
doc->forms = res.u.object;
|
||||
@ -238,7 +236,6 @@ js_document_write_do(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
|
||||
set_led_value(vs->doc_view->session->status.ecmascript_led, 'J');
|
||||
#endif
|
||||
checktime(interp);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
}
|
||||
|
||||
@ -262,7 +259,6 @@ static int
|
||||
document_canput(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_location || p == s_url || p == s_cookie)
|
||||
return 1;
|
||||
return 0;
|
||||
@ -272,7 +268,6 @@ static int
|
||||
document_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
/* all unknown properties return UNDEFINED value */
|
||||
return 1;
|
||||
}
|
||||
|
@ -176,7 +176,6 @@ input_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
assert(fc);
|
||||
assert(fc->form && fs);
|
||||
|
||||
checktime(interp);
|
||||
linknum = get_form_control_link(document, fc);
|
||||
/* Hiddens have no link. */
|
||||
if (linknum >= 0) link = &document->links[linknum];
|
||||
@ -279,7 +278,6 @@ input_put(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
assert(fc);
|
||||
assert(fc->form && fs);
|
||||
|
||||
checktime(interp);
|
||||
linknum = get_form_control_link(document, fc);
|
||||
/* Hiddens have no link. */
|
||||
if (linknum >= 0) link = &document->links[linknum];
|
||||
@ -348,7 +346,6 @@ js_input_blur(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct SEE_object *thisobj, int argc, struct SEE_value **argv,
|
||||
struct SEE_value *res)
|
||||
{
|
||||
checktime(interp);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
/* We are a text-mode browser and there *always* has to be something
|
||||
* selected. So we do nothing for now. (That was easy.) */
|
||||
@ -369,7 +366,6 @@ js_input_click(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct form_control *fc;
|
||||
int linknum;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
assert(fs);
|
||||
fc = find_form_control(document, fs);
|
||||
@ -403,7 +399,6 @@ js_input_focus(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct form_control *fc;
|
||||
int linknum;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
assert(fs);
|
||||
fc = find_form_control(document, fs);
|
||||
@ -423,7 +418,6 @@ js_input_select(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct SEE_object *thisobj, int argc, struct SEE_value **argv,
|
||||
struct SEE_value *res)
|
||||
{
|
||||
checktime(interp);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
/* We support no text selecting yet. So we do nothing for now.
|
||||
* (That was easy, too.) */
|
||||
@ -433,7 +427,6 @@ static int
|
||||
input_canput(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -442,7 +435,6 @@ input_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
/* all unknown properties return UNDEFINED value */
|
||||
checktime(interp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -452,7 +444,6 @@ js_get_input_object(struct SEE_interpreter *interp, struct js_form *jsform,
|
||||
{
|
||||
struct js_input *jsinput;
|
||||
|
||||
checktime(interp);
|
||||
|
||||
#if 0
|
||||
if (fs->ecmascript_obj)
|
||||
@ -482,7 +473,6 @@ static struct js_input *
|
||||
js_get_form_control_object(struct SEE_interpreter *interp, struct js_form *jsform,
|
||||
enum form_type type, struct form_state *fs)
|
||||
{
|
||||
checktime(interp);
|
||||
switch (type) {
|
||||
case FC_TEXT:
|
||||
case FC_PASSWORD:
|
||||
@ -528,7 +518,6 @@ js_form_elems_item(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
int counter = -1;
|
||||
int index;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
if (argc < 1)
|
||||
return;
|
||||
@ -568,7 +557,6 @@ js_form_elems_namedItem(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct form_control *fc;
|
||||
unsigned char *string;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
if (argc < 1)
|
||||
return;
|
||||
@ -602,7 +590,6 @@ form_elems_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct form_view *fv = parent_form->fv;
|
||||
struct form *form = find_form_by_form_view(document, fv);
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_length) {
|
||||
SEE_number_t length = list_size(&form->items);
|
||||
SEE_SET_NUMBER(res, length);
|
||||
@ -634,7 +621,6 @@ static int
|
||||
form_elems_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
/* all unknown properties return UNDEFINED value */
|
||||
return 1;
|
||||
}
|
||||
@ -654,7 +640,6 @@ js_forms_item(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
int counter = -1;
|
||||
int index;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
if (argc < 1)
|
||||
return;
|
||||
@ -690,7 +675,6 @@ js_forms_namedItem(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct form *form;
|
||||
unsigned char *string;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
if (argc < 1)
|
||||
return;
|
||||
@ -722,7 +706,6 @@ forms_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct document *document = doc_view->document;
|
||||
struct js_forms_object *fo = (struct js_forms_object *)o;
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_length) {
|
||||
SEE_number_t length = list_size(&document->forms);
|
||||
SEE_SET_NUMBER(res, length);
|
||||
@ -755,7 +738,6 @@ static int
|
||||
forms_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
/* all unknown properties return UNDEFINED value */
|
||||
return 1;
|
||||
}
|
||||
@ -774,7 +756,6 @@ form_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct form *form = find_form_by_form_view(doc_view->document, fv);
|
||||
struct SEE_string *str;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
|
||||
if (p == s_action) {
|
||||
@ -865,7 +846,6 @@ form_put(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct form *form = find_form_by_form_view(doc_view->document, fv);
|
||||
unsigned char *string = SEE_value_to_unsigned_char(interp, val);
|
||||
|
||||
checktime(interp);
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
@ -903,7 +883,6 @@ static int
|
||||
form_canput(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -911,7 +890,6 @@ static int
|
||||
form_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -929,7 +907,6 @@ js_form_reset(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
|
||||
assert(form);
|
||||
|
||||
checktime(interp);
|
||||
do_reset_form(doc_view, form);
|
||||
draw_forms(doc_view->session->tab->term, doc_view);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
@ -949,7 +926,6 @@ js_form_submit(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct form *form = find_form_by_form_view(doc_view->document, fv);
|
||||
|
||||
assert(form);
|
||||
checktime(interp);
|
||||
submit_given_form(ses, doc_view, form, 0);
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
}
|
||||
@ -959,7 +935,6 @@ struct js_form *js_get_form_object(struct SEE_interpreter *interp,
|
||||
{
|
||||
struct js_form *js_form;
|
||||
|
||||
checktime(interp);
|
||||
#if 0
|
||||
if (fv->ecmascript_obj)
|
||||
return fv->ecmascript_obj;
|
||||
|
@ -160,7 +160,6 @@ history_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
{
|
||||
struct js_history_object *history = (struct js_history_object *)o;
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_back) {
|
||||
SEE_SET_OBJECT(res, history->back);
|
||||
} else if (p == s_forward) {
|
||||
@ -176,7 +175,6 @@ static int
|
||||
history_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_back || p == s_forward || p == s_go)
|
||||
return 1;
|
||||
return 0;
|
||||
@ -206,7 +204,6 @@ js_history_forward(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct document_view *doc_view = vs->doc_view;
|
||||
struct session *ses = doc_view->session;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_NULL(res);
|
||||
go_unback(ses);
|
||||
}
|
||||
@ -224,7 +221,6 @@ js_history_go(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
int index;
|
||||
struct location *loc;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_NULL(res);
|
||||
if (argc < 1)
|
||||
return;
|
||||
@ -259,7 +255,6 @@ js_location_toString(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct SEE_string *str = string_to_SEE_string(interp, string);
|
||||
|
||||
mem_free_if(string);
|
||||
checktime(interp);
|
||||
|
||||
SEE_SET_STRING(res, str);
|
||||
}
|
||||
@ -270,7 +265,6 @@ location_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
{
|
||||
struct js_location_object *loc = (struct js_location_object *)o;
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_toString || p == s_toLocaleString) {
|
||||
SEE_SET_OBJECT(res, loc->toString);
|
||||
} else if (p == s_href) {
|
||||
@ -290,7 +284,6 @@ static void
|
||||
location_put(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p, struct SEE_value *val, int attr)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_href) {
|
||||
struct global_object *g = (struct global_object *)interp;
|
||||
struct view_state *vs = g->win->vs;
|
||||
@ -306,7 +299,6 @@ static int
|
||||
location_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_toString || p == s_toLocaleString || p == s_href)
|
||||
return 1;
|
||||
return 0;
|
||||
@ -316,7 +308,6 @@ static int
|
||||
location_canput(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_href)
|
||||
return 1;
|
||||
return 0;
|
||||
|
@ -69,7 +69,6 @@ navigator_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
{
|
||||
struct SEE_string *str;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_UNDEFINED(res);
|
||||
if (p == s_appCodeName) {
|
||||
SEE_SET_STRING(res, s_Mozilla);
|
||||
@ -122,7 +121,6 @@ static int
|
||||
navigator_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_appCodeName || p == s_appName || p == s_appVersion
|
||||
|| p == s_language || p == s_platform || p == s_userAgent)
|
||||
return 1;
|
||||
|
@ -95,7 +95,6 @@ unibar_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct js_unibar_object *obj = (struct js_unibar_object *)o;
|
||||
unsigned char bar = obj->bar;
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_visible) {
|
||||
#define unibar_fetch(bar) \
|
||||
SEE_SET_BOOLEAN(res, status->force_show_##bar##_bar >= 0 \
|
||||
@ -122,7 +121,6 @@ static void
|
||||
unibar_put(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p, struct SEE_value *val, int attr)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_location) {
|
||||
struct global_object *g = (struct global_object *)interp;
|
||||
struct view_state *vs = g->win->vs;
|
||||
@ -151,7 +149,6 @@ static int
|
||||
unibar_canput(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_visible)
|
||||
return 1;
|
||||
return 0;
|
||||
@ -161,7 +158,6 @@ static int
|
||||
unibar_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_visible)
|
||||
return 1;
|
||||
return 0;
|
||||
|
@ -100,7 +100,6 @@ window_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct js_window_object *win = (struct js_window_object *)o;
|
||||
struct view_state *vs = win->vs;
|
||||
|
||||
checktime(interp);
|
||||
if (p == s_closed) {
|
||||
SEE_SET_BOOLEAN(res, 0);
|
||||
} else if (p == s_self || p == s_parent || p == s_top) {
|
||||
@ -157,7 +156,6 @@ static void
|
||||
window_put(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p, struct SEE_value *val, int attr)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_location) {
|
||||
struct js_window_object *win = (struct js_window_object *)o;
|
||||
struct view_state *vs = win->vs;
|
||||
@ -175,7 +173,6 @@ static int
|
||||
window_canput(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
if (p == s_location)
|
||||
return 1;
|
||||
return 0;
|
||||
@ -185,7 +182,6 @@ static int
|
||||
window_hasproperty(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
struct SEE_string *p)
|
||||
{
|
||||
checktime(interp);
|
||||
/* all unknown properties return UNDEFINED value */
|
||||
return 1;
|
||||
}
|
||||
@ -201,7 +197,6 @@ js_window_alert(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
struct view_state *vs = win->vs;
|
||||
unsigned char *string;
|
||||
|
||||
checktime(interp);
|
||||
SEE_SET_BOOLEAN(res, 1);
|
||||
if (argc < 1)
|
||||
return;
|
||||
@ -236,7 +231,6 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
|
||||
static time_t ratelimit_start;
|
||||
static int ratelimit_count;
|
||||
#endif
|
||||
checktime(interp);
|
||||
SEE_SET_OBJECT(res, (struct SEE_object *)win);
|
||||
if (get_opt_bool("ecmascript.block_window_opening")) {
|
||||
#ifdef CONFIG_LEDS
|
||||
|
Loading…
x
Reference in New Issue
Block a user