1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-29 01:45:34 +00:00
Commit Graph

156 Commits

Author SHA1 Message Date
Miciah Dashiel Butler Masters
91947860f2 Check session- and domain-specific settings for many options
Pass the session with some get_opt_* calls.  These are the low-hanging fruit.  Some places will be difficult because we don't have the session or for other reasons.
2007-08-30 21:11:51 +00:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Kalle Olavi Niemitalo
2437d35904 Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.13
There were conflicts in src/document/css/ because 0.12.GIT switched
to LIST_OF(struct css_selector) and 0.13.GIT switched to struct
css_selector_set.  Resolved by using LIST_OF(struct css_selector)
inside struct css_selector_set.
2007-07-28 03:22:29 +03:00
Kalle Olavi Niemitalo
d3d2bb26c5 New macro LIST_OF for better Doxygen support. 2007-07-26 22:45:51 +03:00
Kalle Olavi Niemitalo
eccc8c23f0 Merge with http://elinks.cz/elinks.git#elinks-0.12 2007-07-09 16:03:06 +03:00
Kalle Olavi Niemitalo
1ea44dcda5 Bug 957: if_assert_failed in ecmascript_put_interpreter.
[ Forward ported from commit 566039624f
  in ELinks 0.11.3.GIT.  --KON ]
2007-07-02 23:46:54 +03:00
Kalle Olavi Niemitalo
871a1befad Bug 755: Save the form_state index in a reserved slot, not as private data.
The previous code cast the integer (long actually) to void * and gave
that to JS_SetPrivate.  This did not work because JS_SetPrivate
expects pointers to be aligned and replaces the least significant bit
with a tag.  By using JS_SetReservedSlot instead, we get control of
the jsval conversions and can store the integer properly.
2007-06-24 18:46:22 +03:00
Witold Filipczyk
057c3be77c bug 957 fixed. 2007-06-21 22:33:19 +03:00
Kalle Olavi Niemitalo
58e3ebf2e7 Bug 957: Assert that the ECMAScript interpreter is not running.
Add ecmascript_interpreter.backend_nesting, increment it when
beginning to evaluate an expression, and decrement it when evaluation
finishes.  Then assert that it is zero in ecmascript_put_interpreter.
This detects bug 957 and similar ones before they corrupt memory.
2007-06-21 21:34:36 +03:00
Kalle Olavi Niemitalo
c7b3a8c423 SEE: Always use SEE_no_enumerator instead of NULL.
Although <see/object.h> of SEE 2.0.1131 has a comment saying that
SEE_objectclass.enumerator is optional and may be left NULL, SEE
crashes if one tries to enumerate the properties of an object created
from such a class.  Conveniently, it provides a suitable stub function.

http://www.adaptive-enterprises.com.au/bugs/show_bug.cgi?id=75
2007-06-10 15:10:32 +03:00
Kalle Olavi Niemitalo
c9b2fbbd46 SMJS: Fix error "forms.namedItem is not a function".
Commit 63752c854b303f5f58636a512a137bf3702e051b on 2004-12-27
seems to have broken this.
2007-06-10 13:11:53 +03:00
Kalle Olavi Niemitalo
619c90588d SMJS: Correct sense of JS_ValueToInt32 return value test.
I made this bug in commit b53525e98e.
2007-05-30 03:11:27 +03:00
Witold Filipczyk
ac3608bda0 ECMAScript: evaluating onclick, onsubmit etc. done in the right way.
Scripts such as onsubmit are called as a function not as a script.

[ From commit 688ca8cf31 on the witekfl
  branch.  --KON ]
2007-05-30 02:35:18 +03:00
Witold Filipczyk
e741932d58 SEE: Renamed ELinks functions with the "SEE" prefix to distinguish them
from SEE functions.

[ Backported from commit c5b102ba08 on
  the witekfl branch.  --KON ]
2007-05-30 02:35:06 +03:00
Kalle Olavi Niemitalo
26766defe7 SMJS: Assert that form_number of input_class is in range. 2007-05-27 19:18:44 +03:00
Kalle Olavi Niemitalo
33b5884821 SEE: Assert that js_input.form_number is in range. 2007-05-27 19:10:44 +03:00
Kalle Olavi Niemitalo
a38b22b356 SEE: Define the synthetic argv as an array.
This does not change the behaviour but perhaps makes the code clearer.
2007-05-27 18:53:31 +03:00
Kalle Olavi Niemitalo
9743729cb1 SMJS: comment changes 2007-05-27 18:36:31 +03:00
Kalle Olavi Niemitalo
99f648b911 SMJS: Use JS_GetInstancePrivate where applicable.
This is a further precaution against reading a pointer from the wrong
type of object.  All of the JS_GetPrivate calls were already protected
with JS_InstanceOf checks if assertions are enabled, and many of them
also if assertions are not enabled.
2007-05-27 18:32:53 +03:00
Kalle Olavi Niemitalo
b53525e98e SMJS: Check return values of JS_ValueToInt32. 2007-05-27 18:09:37 +03:00
Witold Filipczyk
ecc03ad608 bug 755: Fixed.
Remember the index of struct form_state in vs->form_info
instead of the pointer to it. The pointer may change,
the index is persistent.
The field ecmascript_obj of the struct form_state is unused.
2007-05-27 14:44:46 +03:00
Witold Filipczyk
d43fe19224 SEE: bug 755 doesn't occur. 2007-05-27 14:44:35 +03:00
Witold Filipczyk
b53aa7812a ecmascript: Convert numbers using JS_ValueToInt32. 2007-05-27 14:44:28 +03:00
Witold Filipczyk
984613ade1 bug 755: attempt to fix this bug. 2007-05-27 14:44:20 +03:00
Kalle Olavi Niemitalo
5e83337d49 Bug 784: Keep form_control.default_value in the document charset.
Previously, html_special_form_control converted
form_control.default_value to the terminal charset, and init_form_state
then copied the value to form_state.value.  However, when CONFIG_UTF8
is defined and UTF-8 I/O is enabled, form_state.value is supposed to
be in UTF-8, rather than in the terminal charset.

This mismatch could not be conveniently fixed in
html_special_form_control because that does not know which terminal is
being used and whether UTF-8 I/O is enabled there.  Also, constructing
a conversion table from the document charset to form_state.value could
have ruined renderer_context.convert_table, because src/intl/charsets.c
does not support multiple concurrent conversion tables.

So instead, we now keep form_control.default_value in the document
charset, and convert it in the viewer each time it is needed.  Because
the result of the conversion is kept in form_state.value between
incremental renderings, this shouldn't even slow things down too much.

I am not implementing the proper charset conversions for the DOM
defaultValue property yet, because the current code doesn't have
them for other string properties either, and bug 805 is already open
for that.
2007-04-29 22:01:13 +03:00
Laurent MONIN
0b98c5051b Fix trailing whitespaces 2007-04-26 15:02:04 +02:00
Laurent MONIN
90980a944e Mark all module names for translation and include needed header files. 2007-03-21 11:01:06 +01:00
Kalle Olavi Niemitalo
7645a836fc Cast the NULL argument of straconcat to unsigned char *.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to straconcat.  This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
2007-03-11 12:59:11 +02:00
Kalle Olavi Niemitalo
801d520ddd Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-03-11 12:22:02 +02:00
Witold Filipczyk
cf86e2e72f Added SEE_CFLAGS to the Makefile.config. Use SEE_CFLAGS only when necessary. 2007-02-18 17:09:32 +02:00
Kalle Olavi Niemitalo
92d079de82 Set ecmascript.enable = 0 by default.
ECMAScript support is still considered experimental, and there are
several known vulnerabilities (bugs 548, 755, 771).
2006-12-29 23:24:42 +02:00
Kalle Olavi Niemitalo
49c3c89dcb Add an initial comment as commanded in doc/hacking.txt. 2006-12-23 01:44:26 +02:00
Kalle Olavi Niemitalo
846a8f9a4e Bug 846, SEE: Add checktype.c and checktype.h.
These should have been in commit 8bc3d7a798.
2006-12-10 17:12:27 +02:00
Kalle Olavi Niemitalo
8bc3d7a798 Bug 846, SEE: Check thisobj->objectclass before casting. 2006-12-10 01:09:06 +02:00
Kalle Olavi Niemitalo
d731fe2db0 Renumber all tinyids of SMJS properties to negative integers.
This change does not fix any bug, but the SMJS builtin classes use
negative tinyids already, so I presume this is the preferred practice.
At least it means the tinyids won't have to be renumbered later if
some of these objects are changed to behave as arrays.
2006-12-06 23:09:14 +02:00
Kalle Olavi Niemitalo
7894e30ace Bug 870: Don't panic if an SMJS property ID is unrecognized.
If ECMAScript code does obj[42], then the getProperty or setProperty
function of the JSClass of obj gets 42 as the property ID and must not
treat that as an internal error.
2006-12-03 12:07:07 +02:00
Kalle Olavi Niemitalo
aa410301f1 Bug 846: {get,set}Property check JS_InstanceOf without asserting.
The getProperty and setProperty functions of a JSClass must not assume
that the obj parameter points to an instance of that class.  It might
instead point to another object that merely has an instance of the
class in its prototype chain.  Thus, do not assert that JS_InstanceOf
returns true there.  Instead, run the check even with CONFIG_FASTMEM,
and just return JS_FALSE if it fails.
2006-12-03 11:17:48 +02:00
Kalle Olavi Niemitalo
bddafe5f7e Document how timer callbacks erase timer IDs; add some assertions.
Tangential to bug 868.
2006-12-02 18:35:03 +02:00
Kalle Olavi Niemitalo
7e52d23d2f Bug 846: Document the expected parents of form_elements_class instances.
This should have been in commit 36f5f73a60.
The corresponding commit e76e047196 in the
REL_0_10 branch does include it.
2006-11-26 17:35:33 +02:00
Kalle Olavi Niemitalo
47dce0922b Bug 846: Add plenty of JS_InstanceOf assertions and checks. 2006-11-25 16:09:38 +02:00
Kalle Olavi Niemitalo
bbf0d478e9 Bug 846: Separate JS_GetParent & JS_GetPrivate calls from initializations.
This will allow the types of objects to be checked before those calls.
2006-11-25 15:55:25 +02:00
Kalle Olavi Niemitalo
98a120b3d5 Bug 846: Rename some local variables.
Rename parent to parent_win if it points to an instance of window_class.
2006-11-25 14:57:44 +02:00
Kalle Olavi Niemitalo
356678dd80 Bug 846: Document the JSClass assumed in each JS_{Set,Get}Private call. 2006-11-25 14:52:58 +02:00
Kalle Olavi Niemitalo
36f5f73a60 Bug 846: Document the expected parents of SMJS class instances. 2006-11-25 14:42:20 +02:00
Kalle Olavi Niemitalo
670ad939c3 Bug 846: Comments on the relations between JSClasses and functions. 2006-11-25 13:36:28 +02:00
Kalle Olavi Niemitalo
d6ea143f36 Bug 846: Document the private data in each SMJS class. 2006-11-25 13:19:35 +02:00
Petr Baudis
eab3cb762f ECMAScript: Fix a leak in case of setTimeout(..., 0)
identified by Jonas seconds after I pushed the original fix out. *blush*
2006-11-23 01:24:56 +01:00
Petr Baudis
e66b6737db ECMAScript: Fix crash on setTimeout(..., 0) 2006-11-21 08:01:36 +01:00
Petr Baudis
8ecf87b7b7 setTimeout: Fix da assert
Yeah, Miciah, I'm an idiot, don't walk around the fact.
2006-11-05 01:13:29 +01:00
Petr Baudis
da5ec748b6 setTimeout: kill previous timer when planting a new one
Otherwise if the page installs multiple timers the old one would live
on unreferenced and possibly (likely) trigger after the document's death
and everything would go to hell.
2006-11-05 00:53:04 +01:00