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

3205 Commits

Author SHA1 Message Date
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
Kalle Olavi Niemitalo
887a751441 1033: Mention in NEWS. 2008-07-16 17:15:12 +03:00
Witold Filipczyk
e9f3a4a9d3 1033: Fixed memory leak in open(...). 2008-07-16 16:38:50 +03:00
Kalle Olavi Niemitalo
2668602edc 1031: Mention in NEWS. 2008-07-16 14:55:31 +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
f479d6e82a Explain in config.h.in what a hack _ALLOCA_H is 2008-07-15 22:53:26 +03:00
Witold Filipczyk
37ce1ca658 Here is a patch, which adds support for tcc's alloca. 2008-07-15 22:28:01 +03:00
Kalle Olavi Niemitalo
e9d4d3aef2 Fix crash after a tab was opened during reload.
Commit 0b99fa70ca "Bug 620: Reset form
fields to default values on reload" made render_document() decrement
vs->form_info_len to 0 while vs->form_info remained non-NULL.
copy_vs() then copied the whole structure with copy_struct and did not
change form_info because form_info_len was 0.  Both view_state
structures had form_info pointing to the same memory block, causing a
segfault when destroy_vs() tried to free that block a second time.

Reported by أحمد المحمودي.
2008-07-15 11:43:03 +03:00
Kalle Olavi Niemitalo
6b05cdb3a0 1030: List the bug in NEWS.
(cherry picked from commit 295c7760f7)
2008-07-14 22:38:52 +03:00
Kalle Olavi Niemitalo
e287ca9265 1030: Wrap get_search_region_from_search_nodes in #ifdef HAVE_REGEX_H
This change avoids the following error:

gcc -DHAVE_CONFIG_H -I../../.. -I/home/Kalle/src/elinks-0.11/src -I/home/Kalle/prefix/include -I/usr/include/smjs -I/usr/include -I/usr/include/lua50 -I/usr/include -I/usr/include -O0 -ggdb -Wall -Wall -Werror -fno-strict-aliasing -Wno-pointer-sign -Wno-address -fno-strict-overflow -o search.o -c /home/Kalle/src/elinks-0.11/src/viewer/text/search.c
cc1: warnings being treated as errors
/home/Kalle/src/elinks-0.11/src/viewer/text/search.c:257: warning: 'get_search_region_from_search_nodes' defined but not used
make[3]: *** [search.o] Error 1
make[3]: Leaving directory `/home/Kalle/build/i686-pc-linux-gnu/elinks-0.11/src/viewer/text'

get_search_region_from_search_nodes is called only from
search_for_pattern, which already was inside #ifdef HAVE_REGEX_H.
(cherry picked from commit 2aec302d47)
2008-07-14 22:38:08 +03:00
Witold Filipczyk
e83f76b79e 1030: Fixed issue with undefined HAVE_REGEX_H.
(cherry picked from commit 442b0d83b0)
2008-07-14 22:36:52 +03:00
Jonas Fonseca
46e76e0688 Minor documentation improvements 2008-07-13 15:25:41 +02:00
Kalle Olavi Niemitalo
ddd36cafb4 Bug 1029: List in NEWS. 2008-07-12 01:59:18 +03:00
Kalle Olavi Niemitalo
c5a012eca5 Bug 1029: Use JS_CallFunctionValue in keybinding.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

elinks.keymaps.main["\""] = function() {
    elinks.keymaps.main["e"] = function() {
	elinks.alert("hello!");
    };
}
2008-07-12 01:54:49 +03:00
Kalle Olavi Niemitalo
e3830cfd67 Bug 1029: Use JS_CallFunctionValue in elinks_object.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

function set_suffix(suffix) {
    elinks.preformat_html = function(cached, vs) {
	cached.content += suffix;
    }
}
set_suffix("hello");
2008-07-12 01:49:08 +03:00
Kalle Olavi Niemitalo
079b97d21b Bug 1026: Protect callback of elinks.load_uri from GC 2008-07-12 01:37:51 +03:00
Kalle Olavi Niemitalo
b2c387f1f4 Bug 1029: Use JS_CallFunctionValue in load_uri.c
JS_CallFunction does not support closures in SpiderMonkey versions
earlier than 1.8.  Test case:

elinks.keymaps.main["!"] = function() {
    elinks.load_uri("http://www.eldar.org/cgi-bin/fortune.pl?text_format=yes",
		    function (cached) { elinks.alert(cached.content); });
}
2008-07-12 01:24:51 +03:00
Kalle Olavi Niemitalo
12bb8fdfe7 NEWS: sync from 0.11.4.GIT
http://elinks.cz/release.html is generated from NEWS of elinks-0.12;
thus we should have all the news of 0.11.4.GIT here too.
2008-07-11 22:22:27 +03:00
Kalle Olavi Niemitalo
4649d0ccba Bug 951 should not be removed from NEWS before 0.12.0.
That's because the bug was in 0.11.4 as well.
2008-07-11 19:09:07 +03:00
Kalle Olavi Niemitalo
fd27acf784 Bug 1027, SMJS: make null mean "none" in elinks.keymaps
elinks.keymaps.main["/"] = null;
used to crash ELinks with a segfault in JS_ObjectIsFunction.
Fix that by recognizing JSVAL_NULL explicitly and treating it as "none".
Likewise, if keymap_get_property would return "none" to ECMAScript,
return JSVAL_NULL instead.
2008-07-11 17:08:35 +03:00
Kalle Olavi Niemitalo
5251441fdc doc/smjs-scripting: add version info, rephrase risk 2008-07-10 21:11:45 +03:00
Kalle Olavi Niemitalo
9954d37a68 Move most of contrib/smjs/README into the manual.
Also document elinks.vs and elinks.action.

<kahmalo> Miciah: IMO most of contrib/smjs/README should be moved into
    the ELinks manual.  Specifically the parts that do not depend on
    contrib/smjs/hooks.js.  However manual.txt contains a notice:
    "Hold blameless the authors.  Any lawful use is allowed."  Will
    you allow that also for what is now in contrib/smjs/README?
<Miciah> Absolutely.
<Miciah> In fact, I would allow some lawless uses.
<Miciah> It seems a little silly to say that lawful uses are allowed.
2008-07-10 20:31:22 +03:00
Kalle Olavi Niemitalo
8ee5e8c4a1 Bug 951: Revert "Garbage-collect SMJS objects before flushing caches."
This reverts commit c33d195ff4.
ELinks no longer needs to collect garbage in this situation
because it can now free cache entries even if the corresponding
SMJS objects remain.
2008-07-08 15:21:07 +03:00
Kalle Olavi Niemitalo
06c39a8ac4 Bug 951: Lock the cache entry while the hook runs. 2008-07-08 15:20:38 +03:00
Kalle Olavi Niemitalo
314a41588c Bug 951: weaken pointer from JSObject to cache_entry
The SpiderMonkey scripting module handles the "pre-format-html" event
by constructing a JSObject for the struct cache_entry and then calling
elinks.preformat_html(cache_entry, view_state) if such a function
exists.  The problem with this was that each such JSObject kept the
struct cache_entry locked until SpiderMonkey garbage-collected the
JSObject, even if the user had not defined an elinks.preformat_html
function and the JSObject was thus never needed at all.  To work
around that, the SpiderMonkey scripting module ran a garbage
collection whenever the user told ELinks to flush caches.

Remove the SpiderMonkey scripting module's use of object_lock and
object_unlock on struct cache_entry, and instead make the pointers
weak so that ELinks can free the cache_entry whenever it wants even if
a JSObject is pointing to it.  Each cache_entry now has a pointer back
to the JSObject; done_cache_entry calls smjs_detach_cache_entry_object,
which follows the pointer and detaches the cache_entry and the JSObject
from each other.

This commit does not yet remove the workaround mentioned above.
2008-07-07 23:24:43 +03:00
Kalle Olavi Niemitalo
01d5501228 po/Makefile: preset Project-Id-Version 2008-07-07 23:24:38 +03:00
Kalle Olavi Niemitalo
38779902a0 po/Makefile: removed && between commands
It is not necessary: when a rule has multiple commands in it, GNU Make
(which ELinks requires anyway) runs them one at a time, regardless of
the -j option, and skips the remaining commands when one of them
fails, regardless of the -k option.  These options take effect at the
level of targets rather than individual commands.
2008-07-07 23:24:34 +03:00
Kalle Olavi Niemitalo
8bd7d6b61a faq: rewording 2008-07-07 23:24:03 +03:00
Kalle Olavi Niemitalo
6c7986e118 faq: character droppings 2008-07-05 18:16:36 +03:00
Kalle Olavi Niemitalo
749dcb09ee po/Makefile: use xgettext --msgid-bugs-address
http://elinks.cz/community.html says bugs should be reported
to elinks-users but patches should be sent to elinks-dev.
I guess elinks-users is more appropriate here.
2008-07-05 18:12:42 +03:00
Kalle Olavi Niemitalo
3a978bd0d8 po/Makefile: put potfiles.list in build tree, not source
This is so that contrib/mkdist need not delete that explicitly
(although it still does, in order to do the right thing with
a few older versions too).

The file could apparently be removed altogether (see recent
emails on elinks-dev) but a small change like this is less
likely to cause any surprises.
2008-07-05 15:59:44 +03:00
Kalle Olavi Niemitalo
4ffe6a1b6d mkdist: include po/elinks.pot 2008-07-04 23:56:10 +03:00
Kalle Olavi Niemitalo
9c73f02083 NEWS: mention bug 1021, sync with 0.11.4.GIT
Because http://elinks.cz/release.html is made from this file,
I think we'll have to list both 0.11.4.GIT and 0.12pre1.GIT
even though it's a bit difficult to explain which fixes are
in which releases.
2008-07-04 23:01:42 +03:00
Kalle Olavi Niemitalo
5c0128d82d Bug 1021: initialize version in http_got_header
gcc-4.3 -O2 was complaining that http_got_header may use uninitialized
version.major and version.minor.  That indeed happened with HTTP/0.9
servers, and the PRE_HTTP_1_1(version) check then had an undefined
result, so http->close could remain 0 even though it should have
become 1; fortunately, it was then set to 1 anyway, because there was
no Content-Length header.  The undefined version was also saved in
http->recv_version, but it appears nothing ever reads that.  So in the
end, the bug did not cause any symptoms at runtime, but the warning
broke the build on gcc-4.3 if ELinks was configured with --enable-debug.
2008-07-04 16:42:35 +03:00
Kalle Olavi Niemitalo
aa681786d9 NEWS: list bug 955; add 0.12pre1.GIT section 2008-07-03 13:48:08 +03:00
Miciah Dashiel Butler Masters
5733f17856 goto_current_link: do nothing on input buttons
The following is in the HTML 4 standard
(<http://www.w3.org/TR/html401/interact/forms.html#push-button>):

    push buttons: Push buttons have no default behavior. Each push
    button may have client-side scripts associated with the element's
    event attributes. When an event occurs (e.g., the user presses the
    button, releases it, etc.), the associated script is triggered.

Currently, a button such created by such HTML as "<input type="button"
value="foo" />" submits the form by default in ELinks.  According to
the above, it shouldn't.
2008-07-03 13:48:08 +03:00
Witold Filipczyk
429e08e073 bug 955: Do not call onsubmit for RESET. 2008-07-03 13:48:07 +03:00
Jonas Fonseca
a5574ce37e Continue if a test fails 2008-07-03 01:55:03 +02:00
Jonas Fonseca
26e8e52f23 Fix sgml-parser so it compiles
The test does however segfault in the incremental parsing test.
2008-07-03 01:45:45 +02:00
Kalle Olavi Niemitalo
3f8dee5a5e AUTHORS: Taking credit. 2008-07-02 20:35:09 +03:00
Kalle Olavi Niemitalo
14cb43f403 grafthistory: support curl
Mac OS X comes with curl (in the com.apple.pkg.BSD package)
but not with wget.
2008-07-02 20:31:11 +03:00
Kalle Olavi Niemitalo
45f237a26c release: more like what I actually did with 0.12pre1
In particular:
- mkdist takes options and need not be run at elinks.cz
- git push just the single tag, rather than all --tags
- explicitly avoid multipart/signed
- add the release date from the elinks-users archive to NEWS
- update download.txt, release.html, and bugzilla/milestones/elinks.html
2008-07-02 01:06:43 +03:00
Kalle Olavi Niemitalo
d5dcdb4d92 mkdist: separate md5 file for each file
md5sum -c exits with code 1 if some of the files listed in the md5
file are missing, so each md5 file should list only those files that
the user is supposed to download together.  This is also how
elinks-web/download.html has been set up.
2008-07-02 01:06:43 +03:00
Jonas Fonseca
0fa88b1c05 Update Danish translation 2008-07-01 15:13:54 +02:00