1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-19 01:36:33 -04:00
Commit Graph

628 Commits

Author SHA1 Message Date
Miciah Dashiel Butler Masters
f62d2d1ae4 Add the number of interpreters to Resources box
Introduce static int interpreter_count in src/ecmascript/ecmascript.c.

Maintain interpreter_count in ecmascript_get_interpreter and
ecmascript_put_interpreter.

Introduce ecmascript_get_interpreter_count.

Display the number of ECMAScript interpreters that have been allocated
for documents in the Resources dialog box.
2008-09-06 20:18:10 +00:00
Kalle Olavi Niemitalo
a73fe73cd2 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/document/document.h
	src/encoding/encoding.c
	src/network/connection.c
	src/protocol/bittorrent/bittorrent.c
	src/protocol/bittorrent/bittorrent.h
	src/protocol/bittorrent/common.h
	src/protocol/bittorrent/connection.c
	src/protocol/bittorrent/dialogs.c
	src/protocol/bittorrent/tracker.c
	src/protocol/file/cgi.c
	src/protocol/http/http.c
2008-08-03 22:18:53 +03:00
Kalle Olavi Niemitalo
018af50f1d Rename cache_entry.id and related members.
cache_entry.id => cache_entry.cache_id
document.id => document.cache_id
ecmascript_interpreter.onload_snippets_owner => .onload_snippets_cache_id

This is a combination of:

commit 232c07aa7f
bug 1009: id variables renamed, added document_id to the document.

commit 6007043458bf8f14abfc18b9db60785bdc0279f6
Revert addition of document.document_id
2008-08-03 21:27:56 +03:00
Witold Filipczyk
7116daf43e 1038: Remove remembering last 8 URLs. It did not work.
Enable the rate limiting of opening new windows in SEE
to be consistent with SpiderMonkey.
Fixed a possible memleak (the frame variable).
2008-07-21 00:39:30 +03:00
Kalle Olavi Niemitalo
bbee237ff0 Merge branch 'elinks-0.12' into elinks-0.13 2008-07-20 14:47:40 +03:00
Kalle Olavi Niemitalo
85bfba4530 SEE: Do not check thisobj->objectclass in window functions.
init_js_window_object() copies the alert, open, and setTimeout methods
from the window object to the global object.  My fix for bug 846 on
2006-12-10 incorrectly made the corresponding C functions refuse to
work if they were not called as methods of the window object.
2008-07-20 09:26:52 +03:00
Kalle Olavi Niemitalo
ae8080b172 952, 954: Finalize form_view.ecmascript_obj for SEE 2008-07-19 14:58:11 +03:00
Kalle Olavi Niemitalo
c81e2051f8 952, 954: Finalize form_state.ecmascript_obj for SEE 2008-07-19 14:58:11 +03:00
Kalle Olavi Niemitalo
f4213ac350 952, 954: Finalize form_view.ecmascript_obj for SpiderMonkey 2008-07-19 14:58:07 +03:00
Kalle Olavi Niemitalo
2d49f6e9cd 952, 954: Finalize form_state.ecmascript_obj for SpiderMonkey
JSObject instances of input_class now again contain a private pointer
directly to struct form_state.  This pointer is cleared or updated
when appropriate.
2008-07-19 14:57:25 +03:00
Kalle Olavi Niemitalo
759fbb1142 952, 954: Add ecmascript_detach_form_view stub
Anything that frees struct form_view must now call the new function
ecmascript_detach_form_view.  This function should then clear out any
dangling pointers, but that has not yet been implemented.
2008-07-18 20:00:16 +03:00
Kalle Olavi Niemitalo
bbadb99dd1 952, 954: Add ecmascript_{detach,moved}_form_state stubs
Anything that frees or reallocates struct form_state must now call the
new functions ecmascript_detach_form_state or ecmascript_moved_form_state.
These functions should then clear out any dangling pointers, but that has
not yet been implemented.
2008-07-18 19:56:49 +03:00
Kalle Olavi Niemitalo
8f2f9e7265 952, 954: Add spidermonkey_empty_context 2008-07-18 19:24:29 +03:00
Kalle Olavi Niemitalo
5ad675e244 Remove my comment about prefixes used with SpiderMonkey 2008-07-18 19:01:48 +03:00
Witold Filipczyk
e9f3a4a9d3 1033: Fixed memory leak in open(...). 2008-07-16 16:38:50 +03:00
Kalle Olavi Niemitalo
031c1e6143 1031: Replace jsrt with spidermonkey_runtime
src/ecmascript/spidermonkey/ now uses a JSRuntime managed by
spidermonkey-shared.c.
2008-07-16 14:50:41 +03:00
Kalle Olavi Niemitalo
2024ea610b 1031: Replace smjs_rt with spidermonkey_runtime
src/scripting/smjs/ now uses a JSRuntime managed by spidermonkey-shared.c.
2008-07-16 14:28:22 +03:00
Kalle Olavi Niemitalo
32889bf908 1031: Add spidermonkey-shared.c used for both web and user scripts
Rename src/ecmascript/spidermonkey/util.c to
src/ecmascript/spidermonkey-shared.c and compile it also when
CONFIG_SCRIPTING_SMJS is enabled but CONFIG_ECMASCRIPT_SPIDERMONKEY is
not.  Then use its functions from src/scripting/smjs/ too.  Move the
corresponding declarations, as well as the inline functions needed by
src/scripting/smjs/, from src/ecmascript/spidermonkey/util.h to
src/ecmascript/spidermonkey-shared.h.

ELinks is nowadays using two JSRuntimes and SpiderMonkey has bugs that
make it crash in such use.  To work around them, ELinks will need to
be changed to use only one JSRuntime.  I am planning to define and
initialize that JSRuntime in src/ecmascript/spidermonkey-shared.c,
now that it's compiled whenever either of the modules is enabled.
2008-07-16 12:32:24 +03:00
Kalle Olavi Niemitalo
988cec481b Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	NEWS
	configure.in

The following files also conflicted, but they had not been manually
edited in the elinks-0.12 branch after the previous merge, so I just
kept the 0.13.GIT versions:

	doc/man/man1/elinks.1.in
	doc/man/man5/elinks.conf.5
	doc/man/man5/elinkskeys.5
	po/fr.po
	po/pl.po
2008-07-11 22:28:45 +03:00
Kalle Olavi Niemitalo
ed17eb18df Bug 1016: Avoid JSFunctionSpec.
(cherry picked from commit 6bfaa7ca8d)

Conflicts:

	src/ecmascript/spidermonkey/form.c
	src/scripting/smjs/elinks_object.c
2008-06-17 00:25:59 +03:00
Witold Filipczyk
232c07aa7f bug 1009: id variables renamed, added document_id to the document.
cached->id => cached->cache_id
document->id => document->cache_id
onload_snippets_owner => onload_snippets_document_id
Added the distinct document->document_id.
Always reset ecmascript when a document changes for example a next chunk
of it is loaded.
2008-04-27 23:22:08 +03:00
Laurent MONIN
f0e66866f5 Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
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
Petr Baudis
74997f772c setTimeout: A more sensibel assert 2006-11-05 00:35:04 +01:00
Petr Baudis
a3a85ef453 setTimeout: Second try to fix timer crashes 2006-11-04 13:20:29 +01:00
Petr Baudis
847feea09e setTimeout: Kill timer when it timed out, fixes random crashes 2006-11-03 20:18:31 +01:00
Miciah Dashiel Butler Masters
6a53f92179 SMJS (doc): Don't signal an error when assigning to window.status 2006-10-26 20:30:26 +00:00
Witold Filipczyk
f4e66f1fc6 ECMAScript: added writeonly property window.status 2006-10-24 20:41:25 +02:00
Witold Filipczyk
6e08e1bf5d ECMAScript: Probably superfluous kill_timer. Removed unused include. 2006-10-24 19:10:10 +02:00
Witold Filipczyk
2fe0623298 Moved the setTimeout timer to the struct document. 2006-10-24 16:47:41 +02:00
Witold Filipczyk
c76ce39a87 SpiderMonkey: added setTimeout. 2006-10-24 15:52:44 +02:00
Witold Filipczyk
e5e6727e81 SEE: setTimeout is a window object method. 2006-10-24 15:33:14 +02:00
Witold Filipczyk
cc4d02b0ae SEE: Added setTimeout function. 2006-10-23 22:45:55 +02:00
Witold Filipczyk
86bc6a534b Should be visible not location. 2006-09-26 19:40:59 +02:00
Witold Filipczyk
c961564d0b SEE: use keystr as return value. Killed warning. 2006-09-03 13:21:23 +02:00
Kalle Olavi Niemitalo
8850d85998 ECMAScript: If accessKey is a surrogate, throw an error when reading it.
Surrogates are now treated the same way as out-of-range characters
like U+110000; if a link has such an access key, then the ECMAScript
accessKey property cannot be read.  It seems currently impossible to
set such an access key though, because accesskey_string_to_unicode()
doesn't support multibyte characters yet.
2006-08-27 11:45:11 +03:00
Kalle Olavi Niemitalo
38fe5b72f7 Define and use macros for handling UTF-16 surrogates. 2006-08-24 23:30:41 +03:00
Kalle Olavi Niemitalo
2d898272c1 ECMAScript: Preserve all of Unicode when setting the accessKey property.
Well, almost all.  U+0000 cannot be used because ELinks thinks that
means the link has no access key.
2006-08-20 17:40:27 +03:00
Kalle Olavi Niemitalo
45b194d1e7 ECMAScript: Fix previous careless SEE changes. 2006-08-20 17:36:06 +03:00
Kalle Olavi Niemitalo
00a5b88371 ECMAScript: Preserve all of Unicode when reading the accessKey property.
Setting the property does not yet support Unicode.
2006-08-20 13:37:03 +03:00
Witold Filipczyk
b1c8eb5572 SEE: use periodic callback. SEE engine passes infinite test 2006-08-12 19:07:16 +02:00
Witold Filipczyk
19315e136e Ecmascript: the code adjusted for SEE-2.0 2006-08-12 18:43:31 +02:00
Witold Filipczyk
2d9e28bd68 Used dir_sep instead of hard coded '/' 2006-07-09 13:02:44 +02:00
Laurent MONIN
5acb5e6663 Trim trailing whitespaces. 2006-05-31 19:34:49 +02:00
Witold Filipczyk
9f69170c2a fixup_select_state was unnecessary 2006-05-02 12:56:05 +02:00
Witold Filipczyk
cdd86d3c20 Ecmascript: write to the variable selectedIndex. Not tested 2006-05-02 11:28:41 +02:00
Witold Filipczyk
d9d6bc23ae Ecmascript: introduced selectedIndex 2006-05-02 09:36:23 +02:00
Witold Filipczyk
c540a9ed63 Ecmascript: more id checks 2006-05-01 19:55:43 +02:00
Witold Filipczyk
8761bf04a9 Ecmascript: check also id, not only name of form controls. This is required
by scripts at http://www.ecs.com.tw/
2006-05-01 19:37:54 +02:00
Witold Filipczyk
dc8f89e5b1 SEE: see_eval_stringback returns either string when SEE_value is string
or NULL otherwise. At www.ecs.com.tw hyperlinks didn't "work".
When document.browse.forms.confirm_submit is 1 there is a problem with
big dialog box.
2006-04-15 19:22:38 +02:00
Witold Filipczyk
3feb4a55a4 SEE: window.navigator is alias for navigator 2006-04-13 22:47:32 +02:00
Witold Filipczyk
83d0d6f84a Fixed the memleak 2006-04-02 17:57:12 +02:00
Witold Filipczyk
c571aea567 Ecmascript: 8 last urls opened by window.open() remembered in a safer way. 2006-04-02 17:00:55 +02:00
Miciah Dashiel Butler Masters
d7a964efaf SMJS: fix segfault on exit
Create and immediately destroy a context when initialising the SMJS
document scripting module, because SMJS crashes on exit if there has
been no context created since it started, which is the case if one does
not load any documents.
2006-03-26 20:28:25 +00:00
Witold Filipczyk
dc075685ae ECMAScript: better handling of set action 2006-03-21 18:45:40 +01:00
witekfl
30a60caa12 SpiderMonkey: do not remember context. Maybe this time it won't hung. 2006-03-01 18:17:16 +01:00
Miciah Dashiel Butler Masters
4b3d88dd6e Delegate ECMAScript submodule initialisation the right way
Replace the ECMAScript module initialisation and de-initialisation
routines that wrapped the SMJS and SEE module initialisation and
de-initialisation routines by having the module system call the SMJS
and SEE routines its own darned self.
2006-02-26 08:51:36 +00:00
Miciah Dashiel Butler Masters
a464157d4d SEE & SMJS: document.write(ln): use all arguments
Additionally add a test to test/ecmascript/document_write.html.

Thanks to Kirk Reiser for observing that ELinks only printed the first.
2006-02-12 04:33:42 +00:00
Miciah Dashiel Butler Masters
7b092af628 SEE: document.writeln: always add new line
Add the new-line character even if SEE_value_to_unsigned_char returns
NULL.
2006-02-12 04:25:10 +00:00
witekfl
10589b04eb Base href was lost while setting form->action by ECMAScript. This is
attempt to fix it
2006-02-09 22:50:30 +01:00
witekfl
d267fcc747 SpiderMonkey: Handling both 'document.location.href ='
and 'document.location ='
2006-02-01 09:31:26 +01:00
witekfl
3c0c912198 SpiderMonkey: target was not set 2006-01-31 13:03:17 +01:00
Miciah Dashiel Butler Masters
db9768963f Merge with git+ssh://pasky.or.cz/srv/git/elinks.git
git+ssh://pasky.or.cz/srv/git/elinks.git
2006-01-30 15:42:03 +00:00
b4d9b7f5a6 Make SpiderMonkey consistent with SEE. Do not cache ecmascript_objs 2006-01-30 11:15:04 +01:00
44710bb1e9 The same trick as in SEE: Remember last 8 locations and do not open
them again
2006-01-30 10:47:24 +01:00
Miciah Dashiel Butler Masters
be07858b2b Refactor the document.write routines
Factor js_document_write_do out of js_document_write and
js_document_writeln and document_write_do out of document_write and
document_write_ln.
2006-01-28 20:39:07 +00:00
645689f1aa I have no idea why it is still crashing. This is last attempt
today to fix it
2006-01-28 19:57:40 +01:00
71871edd43 Maybe this time it won't crash 2006-01-28 17:08:45 +01:00
7c7541f4d1 parent, self and top are the same since now 2006-01-28 14:15:55 +01:00
9cc9db4e24 Handling onsubmit 2006-01-28 11:17:22 +01:00
9c9fa1d81c Defined document.write and document.writeln for SEE 2006-01-27 14:55:53 +01:00
8bf45d0ece Spidermonkey's document.write and document.writeln defined. They work,
but rendering doesn't work
2006-01-27 13:29:38 +01:00
62d42380f8 Added ret param for document.write 2006-01-27 12:07:45 +01:00
6761b3995d Avoided code duplication 2006-01-27 10:08:19 +01:00
witekfl
e5dbbff398 Set returned value. 2006-01-25 22:22:10 +01:00
Laurent MONIN
cf8de45782 Cleanup and tidy up window.open workaround. 2006-01-25 17:20:47 +01:00
Laurent MONIN
f6f66a28c8 Fix warning: variable xxx might be clobbered by longjmp or vfork, that
occur with gcc 2.95.3.
2006-01-25 17:03:15 +01:00
witekfl
c204af75fe Because of gradual rendering window.open is called many times with the same
arguments. This workaround remembers 8 last opened URLs and do not let
open them again.
2006-01-25 11:50:46 +01:00
61c43faacc Do not include see/see.h in header files 2006-01-21 22:19:22 +01:00
Jonas Fonseca
4570c4976e Use CONFIG_ECMASCRIPT_SMJS in favour of CONFIG_SPIDERMONKEY, specificity! 2006-01-20 15:56:40 +01:00
Miciah Dashiel Butler Masters
958b0d308d Re-introduce the stracpy in the correct place
See commit 836744ea84 and commit
bf3faa5c2b.
2006-01-18 20:26:01 +00:00
witekfl
bf3faa5c2b There is no reason to "stracpy" already allocated string. 2006-01-18 20:08:50 +01:00
2de1a840a6 I was wrong. self is function object, thisobj is peculiar object 2006-01-17 20:29:48 +01:00
Miciah Dashiel Butler Masters
836744ea84 js_window_open: Fix extra free that I just introduced
Assign deo->target a copy of target instead of target itself because
delayed_goto_uri_frame frees deo->target and SpiderMonkey owns target.

Reported by Jonas.
2006-01-17 03:15:56 +00:00
Miciah Dashiel Butler Masters
466bb18be0 Move delayed_open to src/terminal/tab.c
The two copies of delayed_open in src/ecmascript/spidermonkey/window.c
and in src/ecmascript/see/window.c are identical, so move them
to src/terminal/tab.c and eliminate the duplication.
2006-01-16 19:28:03 +00:00
Miciah Dashiel Butler Masters
1f68492d57 Move delayed_goto_uri_frame to src/session/task.c
Until the last change in src/ecmascript/see/window.c, the two copies
of delayed_goto_uri_frame in src/ecmascript/spidermonkey/window.c and
in src/ecmascript/see/window.c were identical. That change applies to
both versions, so move the newer one to src/session/task.c and eliminate
the duplication. Also move struct delayed_open to src/session/session.h.
2006-01-16 19:18:33 +00:00
6cd9a11fdc Use frame->name instead of target avoiding possible segfault. 2006-01-16 14:32:13 +01:00
b8126ea9de Introduced ecmascript submodules 2006-01-16 14:14:14 +01:00
8782b01659 thisobj is for function object, self is for
object
2006-01-16 13:51:08 +01:00
Jonas Fonseca
2748d043f9 Autogenerate .vimrc files and put the master in config/vimrc
This changes the init target to be idempotent: most importantly it will now
never overwrite a Makefile if it exists. Additionally 'make init' will
generate the .vimrc files. Yay, no more stupid 'added fairies' commits! ;)
2006-01-15 18:38:58 +01:00
Jonas Fonseca
b9316b3a9c Fix a few possible leaks 2006-01-14 12:06:10 +01:00
Jonas Fonseca
5d38e99465 Sort Makefile conditionals 2006-01-14 10:41:58 +01:00
Laurent MONIN
5685221512 Trim trailing whitespaces. 2006-01-13 00:11:39 +01:00
Laurent MONIN
fd39e595a3 CONFIG_SEE -> CONFIG_ECMASCRIPT_SEE. 2006-01-12 17:33:33 +01:00
witekfl
cbb1c5ea23 Fixes some bugs related with SEE 2006-01-12 15:21:32 +01:00
witekfl
0fae27fc27 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2006-01-11 20:40:57 +01:00
witekfl
80b0607167 Prevent flooding. Similar to rate_limit. What is the origin of "flood" is
unknown to me.
2006-01-11 20:40:22 +01:00
Laurent MONIN
3f9bb0d7f9 CONFIG_BEOS -> CONFIG_OS_BEOS 2006-01-11 20:12:59 +01:00
Laurent MONIN
202965d338 CONFIG_WIN32 -> CONFIG_OS_WIN32 2006-01-11 20:10:27 +01:00
Laurent MONIN
86f5f2cf48 CONFIG_UNIX -> CONFIG_OS_UNIX 2006-01-11 20:10:27 +01:00
Laurent MONIN
9eafa94fd9 CONFIG_RISCOS -> CONFIG_OS_RISCOS 2006-01-11 20:10:26 +01:00
Laurent MONIN
b6ccfc0e07 CONFIG_OS2 -> CONFIG_OS_OS2 2006-01-11 20:10:26 +01:00
Laurent MONIN
043e6aa4e7 More white lines. 2006-01-11 13:45:09 +01:00
witekfl
179fdf2bb1 Global open() and alert(). Both ECMAScript engines has similar state.
Both doesn't work with my bank account :(
2006-01-11 13:19:51 +01:00
witekfl
c2e9448f49 Fixed focus() in SEE ecmascript. 2006-01-11 09:17:17 +01:00
Jonas Fonseca
1d2a6e4d1b Introduce CONFIG_ECMASCRIPT_SMJS used for Spidermonkey document scripting
It makes it possible to build with SEE document scripting and Spidermonkey
browser scripting.
2006-01-11 02:21:53 +01:00
Jonas Fonseca
4b132e0f63 A few compile fixes
You should _always_ #include "elinks.h" before other ELinks header files,
to take care of CONFIG_DEBUG. Drop unused variable.
2006-01-11 01:57:03 +01:00
Jonas Fonseca
cd493ae7a8 Remove see.o 2006-01-10 20:38:43 +01:00
witekfl
d8592e4f99 Alternative experimental ECMAScript engine. 2006-01-10 19:17:29 +01:00
Miciah Dashiel Butler Masters
62de7cc750 In delayed_goto, do not load the page if the doc_view has changed since
the delayed_goto was registered. This fixes bug 611, the infinite loop
on Gmane.
2005-12-26 14:12:45 +00:00
Jonas Fonseca
83dca03a27 Remove indentation from option description 2005-11-27 07:29:36 +01:00
Jonas Fonseca
acf2ec806b Remove empty lines in start of header files
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00
Miciah Dashiel Butler Masters
8fb4fc437a Redraw the title when the document changes it with ECMAScript. 2005-10-30 04:33:40 +00:00
Miciah Dashiel Butler Masters
dcbb9cf909 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2005-10-24 00:32:42 +00:00
Miciah Dashiel Butler Masters
82c4d457d6 Add a boolean option ecmascript.ignore_noscript, default off,
that when enabled causes ELinks to ignore any content enclosed
with <noscript> tags.
2005-10-23 21:59:05 +00:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Jonas Fonseca
c88afeb1c2 path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
Jonas Fonseca
e39a4342d6 Include $(top_srcdir)/Makefile.lib instead of $(path_to_top)/Makefile.lib
A step towards out of tree builds ...
2005-10-20 01:11:47 +02:00
Jonas Fonseca
94ed6fa754 Finalize and cleanup the denser Makefile format
Convert remaining conditional file building to use

	OBJS-$(CONFIG_FOO) += foo.o

one problem with reverse meaining (in util/) fixed with local 'hack'.

Cleanup and remove stuff which is now default targets.
2005-09-28 12:38:17 +02:00
Jonas Fonseca
68de9e35d3 Automagically link in subdir lib.o files
It is a little ugly since I couldn't get $(wildcard) to expand *.o files
so it just checks if there are any *.c files and then link in the lib.o
based on that.
2005-09-27 22:38:00 +02:00
Jonas Fonseca
1efab31581 Simplify building of and linking with directories
Ditch the building of an archive (.a) in favour of linking all objects in a
directory into a lib.o file. This makes it easy to link in subdirectories
and more importantly keeps the build logic in the local subdirectories.

Note: after updating you will have to rm **/*.a if you do not make clean
before updating.
2005-09-27 21:38:58 +02:00
Jonas Fonseca
b30064c0d0 Rename targets: *-l -> *-local 2005-09-27 21:11:28 +02:00
Petr Baudis
204bbe5d2c Fix starting a build from a subdirectory ELBuild-wise
Now all the submakefiles contain informationa buot where in the directory
hierarchy they stay.
2005-09-16 02:07:36 +02:00
Petr Baudis
32fe41fae7 ELBuild: Use 'include' instead of '-include'
We _do_ want to error on when including .config and .lib failed.
2005-09-16 01:09:42 +02:00
Petr Baudis
fffc573769 Use all-l,install-l,clean-l targets in individual makefiles and let
Makefile.lib multiplex the real ones. That's so that the -recursive
ones always come first.
2005-09-16 00:52:54 +02:00
Petr Baudis
833770a5f7 Implicit recursiveness and clean rule
All objects defining $(OBJS) will get them and *.a deleted during
make clean.

The all, clean and install rules now implicitly imply their -recursive
counterparts - those will just do nothing in case of $(SUBDIRS) not
defined, so that's ok.
2005-09-15 23:28:56 +02:00
Petr Baudis
06ea255a22 Convert part of the build to the new build system
The root makefile is converted as well as some leaf Makefiles. This
also brings in the required infrastructure and adjusts configure.in
appropriately.

I converted only makefiles containing no configurable stuff, since
that'll require more consideration yet.
2005-09-15 21:03:56 +02:00
Jonas Fonseca
7462f22635 Remove now obsolete .cvsignore files. 2005-09-15 18:33:20 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00