1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00
Commit Graph

2156 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
cb1658f399 URI: Inline check_uri_file.
And reorder the characters in the string given to strcspn(), to match
their expected order in the URI.  This is also how strcspn() is called
elsewhere in uri.c.
2007-06-17 21:11:20 +02:00
Witold Filipczyk
b2b4e67e0d DOM, ecmascript: removed superflous assignments. 2007-06-16 18:45:54 +02:00
Witold Filipczyk
b28eeb8a38 http-equiv: Do not parse more than one http-equiv="Content-Type".
Other browsers use only the first occurence of http-equiv="Content-Type".
ELinks parsed all and used the last one for the charset.
Noticed at http://gazetaolsztynska.wm.pl/ .
2007-06-15 21:10:19 +02:00
Witold Filipczyk
cd1ebf97b7 URI file: Fixed. CGI scripts work, URI fragments work too. 2007-06-14 08:02:29 +02:00
Witold Filipczyk
1629c572b7 uri, file: Commented out broken code.
CGI scripts using GET method didn't work.
2007-06-13 23:05:56 +02:00
Witold Filipczyk
3923a8c4fc DOM: Moved invocation of done_ecmascript_obj to the done_dom_node_data. 2007-06-13 12:24:00 +02:00
Witold Filipczyk
fd1dcfd781 DOM TR,TD: register/unregister cell. 2007-06-13 11:57:29 +02:00
Witold Filipczyk
f00433f233 DOM TR: register/unregister row. 2007-06-13 11:34:45 +02:00
Witold Filipczyk
0702ea97bd DOM TABLE: Redefined register_row and unregister_row. Small fixes. 2007-06-13 11:30:07 +02:00
Witold Filipczyk
c44db5b943 DOM, TableSection: Defined some properties. 2007-06-12 22:34:51 +02:00
Witold Filipczyk
3545c7225f DOM, SELECT: The type of the options property is struct dom_node *. 2007-06-12 18:42:39 +02:00
Witold Filipczyk
6e010d76ff DOM HTMLOptionsCollection: Reused HTMLCollection.
Note that the length property is read-only now.
2007-06-12 16:49:06 +02:00
Witold Filipczyk
46584fc5c0 DOM, HTMLCollection: Defined the namedItem method. 2007-06-12 16:39:44 +02:00
Witold Filipczyk
4df27a6700 DOM forms: register and unregister functions for FORM elements.
Elements like INPUT, TEXTAREA or SELECT look for the parent FORM
and register themselves to it. When those elements are freed they
unregister themselves.
2007-06-12 15:07:43 +02:00
Witold Filipczyk
c6274851b2 DOM, ecmascript: Argument of done functions changed to struct dom_node *.
node is needed by some unregister functions.
2007-06-12 14:37:31 +02:00
Witold Filipczyk
09db7aa8a0 DOM, ecmascript: Added some helper functions for handling forms.
Defined the item function of HTMLCollection.
2007-06-12 13:01:54 +02:00
Witold Filipczyk
829a953eb2 DOM: Added field ctx to the struct dom_node_list to easy get/set
the private data of an object.
2007-06-12 11:47:56 +02:00
Witold Filipczyk
a6eca1ae60 DOM: Export del_from_dom_node_list. 2007-06-12 11:44:58 +02:00
Witold Filipczyk
8b19aac004 DOM, ecmascript: In elements that have form property, this property points to
the node which contains that form.
2007-06-11 12:06:29 +02:00
Witold Filipczyk
9b23b1d013 DOM, ecmascript: Defined FIELDSET functions. 2007-06-11 11:33:21 +02:00
Witold Filipczyk
3f99ea9896 leds: Commented out redraw_terminal. The screen flickers with frames. 2007-06-10 21:54:33 +02:00
Witold Filipczyk
ba24e154e2 bug 955 continued: Do not call onsubmit for a BUTTON, either.
Added tricky code for calling submit() from onclick() of BUTTON.
2007-06-10 19:43:59 +02:00
Witold Filipczyk
820afbee0b bug 955: Do not call onsubmit for RESET. 2007-06-10 18:13:03 +02:00
Kalle Olavi Niemitalo
e8c8e65d66 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 17:49:05 +02:00
Kalle Olavi Niemitalo
04828f08b1 SMJS: Fix error "forms.namedItem is not a function".
Commit 63752c854b303f5f58636a512a137bf3702e051b on 2004-12-27
seems to have broken this.
2007-06-10 17:48:58 +02:00
Witold Filipczyk
7b26b1dffd DOM, ecmascript: Table with functions to make and done html objects. 2007-06-10 17:26:48 +02:00
Witold Filipczyk
446eec0bd3 http chunked: Better check for overflow. 2007-06-09 18:30:42 +02:00
Witold Filipczyk
a4140594f1 http chunked: avoid unsafe cases when chunks > 2GB.
This and previous commit were inspired by Jonas' mail on elinks-dev.
2007-06-09 17:26:15 +02:00
Witold Filipczyk
eb1fe8ee5a http: use off_t for the chunk size. 2007-06-09 11:40:13 +02:00
Witold Filipczyk
9fb5595948 http: used off_t instead of int.
The progress of files bigger than 2GB is shown properly.
2007-06-07 16:16:53 +02:00
Witold Filipczyk
096ba3068e DOM, ecmascript: Defined done_ functions. They will be called
from done_dom_node.
2007-06-06 12:16:27 +02:00
Witold Filipczyk
4f68b1af47 DOM, ecmascript: Added functions for creation SpiderMonkey's objects. 2007-06-05 22:18:11 +02:00
Witold Filipczyk
7a55be295c DOM ecmascript: data types conformable with the DOM2-HTML recomendation. 2007-06-05 12:47:56 +02:00
Kalle Olavi Niemitalo
ec32eeb1d3 SMJS: Correct sense of JS_ValueToInt32 return value test.
I made this bug in commit b53525e98e.
2007-05-31 16:48:46 +02:00
Jonas Fonseca
bd2503e81b Remove unused add handler in the option_type_info struct 2007-05-28 19:34:59 +02:00
Kalle Olavi Niemitalo
ea8f4b755d SEE: Define the synthetic argv as an array.
This does not change the behaviour but perhaps makes the code clearer.
2007-05-27 21:04:36 +02:00
Kalle Olavi Niemitalo
dafba56f7e SMJS: Assert that form_number of input_class is in range. 2007-05-27 20:52:48 +02:00
Kalle Olavi Niemitalo
62257c20af SEE: Assert that js_input.form_number is in range. 2007-05-27 20:52:41 +02:00
Kalle Olavi Niemitalo
5e0b86309c SMJS: comment changes 2007-05-27 20:50:29 +02:00
Kalle Olavi Niemitalo
09d0e88878 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 20:50:20 +02:00
Kalle Olavi Niemitalo
0417d84e74 SMJS: Check return values of JS_ValueToInt32. 2007-05-27 20:50:12 +02:00
Kalle Olavi Niemitalo
3f4846add0 Compare screen_driver.name with strcmp, not memcmp.
screen_driver_change_hook was comparing only strlen(name) characters
and ignoring the '\0'.  To reproduce the bug in ELinks 0.11.3 and
ELinks 0.12.GIT:

- Run TERM=screen elinks.
- In another terminal, run TERM=scr elinks.  Quit this slave ELinks.
- Open the terminal options dialog and set 16 colors.
- Open the option manager and change the terminal.scr.colors option to
  1 and back to 0.
- Note that ELinks no longer displays colors.

That bug could be fixed just by using len+1 instead of len.  However,
there is also another bug: memcmp may compare the specified number of
bytes, even if some of the earlier ones differ; thus, it could in
principle read past the end of the malloc block and thereby crash
ELinks.  Using strcmp may be a little slower but I do not believe it
could become a bottleneck.
2007-05-27 09:59:35 +02:00
Jonas Fonseca
6d14d95386 Simplify TESTDEPS maintainance by adding common objects in Makefile.lib 2007-05-26 20:21:15 +02:00
Jonas Fonseca
447fd16ae0 Fix 'make test' dependency when building test utility programs
Problems was caused by undefined symbols:

	src/util/conv.c:308: undefined reference to `is_cp_utf8'
	src/util/conv.c:320: undefined reference to `cp2u'
2007-05-26 20:21:09 +02:00
Jonas Fonseca
bd0e3a5bc1 DOM test: add test/ to SUBDIRS so DOM test is run for 'make test' 2007-05-26 20:21:03 +02:00
Jonas Fonseca
c192551773 DOM test: make die() in sgml-parser static 2007-05-26 20:20:58 +02:00
Jonas Fonseca
ee8a3fe651 DOM test: refactor options parsing in sgml-parser
Introduce get_opt() to do the tedious work of getting the right
argument for options expecting them and handles both '--opt=arg'
and '--opt arg'. As a side effect it also removes an unneeded
assignment of the source string for stdin.
2007-05-26 20:20:51 +02:00
Witold Filipczyk
c8d345aa12 Revert "make test: Fixed."
This reverts commit 4142f3c80a.
2007-05-26 20:18:39 +02:00
Witold Filipczyk
4142f3c80a make test: Fixed. 2007-05-26 20:09:40 +02:00
Witold Filipczyk
df3c3083f6 DOM: done_dom_html_data is accessible only with ECMASCRIPT enabled. 2007-05-26 13:09:17 +02:00
Jonas Fonseca
201ce1ec85 Use printf to handle test string containing escapes more portable
Works with both bash and dash. This reintroduces the fix to the
test-sgml-parser-basic test, and also fixes test-sgml-parser-incremental
and test-sgml-parser-lines, which Witek has reported as failing.
2007-05-26 13:01:22 +02:00
Jonas Fonseca
7d2eb84de0 Revert "Refactor test-sgml-parser-basic to work with non-bash shells"
This reverts commit 3f93148c9b.
2007-05-26 13:01:16 +02:00
Witold Filipczyk
21ed212b15 shadow: Draw a transparent shadow on the Linux console, too.
set ui.colors.color.dialog.shadow.text = "#555555"
set ui.colors.color.dialog.shadow.background = "black"

and enjoy!
2007-05-25 11:51:40 +02:00
Witold Filipczyk
1b85b63f97 file: set_nonblocking_fd when reading from the copiousoutput's pipe. 2007-05-24 12:29:29 +02:00
Witold Filipczyk
e75522d19c DOM: Defined properties of HTML elements.
All of them are the "unsigned char *" type. This should be changed.
2007-05-23 22:57:55 +02:00
Witold Filipczyk
d4adfb3cd0 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-22 16:07:06 +02:00
Witold Filipczyk
b09135a612 SEE: bug 755 doesn't occur. 2007-05-22 10:45:36 +02:00
Witold Filipczyk
bb59860c23 ecmascript: Convert numbers using JS_ValueToInt32. 2007-05-22 09:36:39 +02:00
Witold Filipczyk
08cab91214 bug 755: attempt to fix this bug. 2007-05-21 12:50:27 +02:00
Witold Filipczyk
f70e438820 DOM: node was unitialized. 2007-05-20 21:03:15 +02:00
Witold Filipczyk
ca62325a53 speech: Compilation fix. 2007-05-20 20:39:54 +02:00
Kalle Olavi Niemitalo
dfb74267f8 Bug 461: Ensure contrast when filling with spaces.
So that the cursor will be visible in the Linux console.
2007-05-20 20:21:52 +02:00
Kalle Olavi Niemitalo
e57d1f6aba And ignore ID files while we're at it. 2007-05-20 20:21:47 +02:00
Kalle Olavi Niemitalo
2a2203ef92 Place the TAGS file in the source directory. 2007-05-20 20:21:40 +02:00
Kalle Olavi Niemitalo
d562bdc77c Document terminal._template_.m11_hack more and add comments. 2007-05-20 20:21:27 +02:00
Kalle Olavi Niemitalo
ed88ddf1a3 Bug 914: Add screen_driver_opt.utf8_cp, not yet read. 2007-05-20 20:21:19 +02:00
Kalle Olavi Niemitalo
44e8a38693 Bug 914: Don't let UTF-8 I/O affect internal representations.
Use it for the actual I/O only.  Previously, defining CONFIG_UTF8 and
enabling UTF-8 used to force many strings to the UTF-8 charset
regardless of the terminal charset option.  Now, those strings always
follow the terminal charset.  This fixes bug 914 which was caused
because _() returned strings in the terminal charset and functions
then assumed they were in UTF-8.  This reduction in the effects of
UTF-8 I/O may also simplify future testing.
2007-05-20 20:11:55 +02:00
Kalle Olavi Niemitalo
ad669a3f0f Bug 914: Add terminal.utf8_cp, not yet read. 2007-05-20 20:11:48 +02:00
Witold Filipczyk
774471b6d1 DOM: Some methods of the Element interface defined. 2007-05-20 19:51:25 +02:00
Kalle Olavi Niemitalo
ebd4b979c1 UTF-8, add_char_data: data can be UCS_NO_CHAR after all. 2007-05-20 14:24:52 +02:00
Kalle Olavi Niemitalo
e099a05a57 Whitespace and comments. 2007-05-20 14:24:47 +02:00
Kalle Olavi Niemitalo
0c3d05817e UTF-8, set_screen_driver_opt: Never use frame_seqs with UTF-8 I/O. 2007-05-20 14:24:41 +02:00
Kalle Olavi Niemitalo
f970994640 UTF-8: frame_freebsd isn't in CP437 so use a separate table for UTF-8 I/O. 2007-05-20 14:24:35 +02:00
Kalle Olavi Niemitalo
2e91945b69 UTF-8: Comment about frame_freebsd[]. 2007-05-20 14:24:30 +02:00
Kalle Olavi Niemitalo
b2186fadf4 UTF-8: Use frame_vt100_u even #ifdef CONFIG_UTF8.
Should perhaps have been part of the previous commit.
2007-05-20 14:24:25 +02:00
Kalle Olavi Niemitalo
cdd0cd98bf UTF-8: Make UTF-8 I/O affect frame characters even #ifdef CONFIG_UTF8. 2007-05-20 14:24:18 +02:00
Kalle Olavi Niemitalo
d1da2e938e UTF-8, add_char_data: Comment about UCS_NO_CHAR. 2007-05-20 14:24:14 +02:00
Kalle Olavi Niemitalo
976b0d26ad UTF-8: Remove screen_driver_opt.utf8, which is no longer used. 2007-05-20 14:24:08 +02:00
Kalle Olavi Niemitalo
d561304524 UTF-8, use_utf8_io: Test driver->opt.charsets[0] even #ifdef CONFIG_UTF8.
driver->opt.utf8 is no longer read and will soon be removed.
2007-05-20 14:24:03 +02:00
Kalle Olavi Niemitalo
3260bcec20 UTF-8: Define and set screen_driver_opt.charsets even #ifdef CONFIG_UTF8.
However, the stored values are not yet read in this commit.
2007-05-20 14:23:57 +02:00
Kalle Olavi Niemitalo
4baf668f28 UTF-8, set_screen_driver_opt: Don't test driver->opt.utf8 after utf8_io.
They have the same value so one test will suffice.
2007-05-20 14:23:50 +02:00
Kalle Olavi Niemitalo
aa490bab64 UTF-8, set_screen_driver_opt: Shrink #ifdef CONFIG_UTF8 regions. 2007-05-20 14:23:44 +02:00
Kalle Olavi Niemitalo
b2d35c73ec UTF-8, set_screen_driver_opt: Duplicate CONFIG_UTF8 code. 2007-05-20 14:23:39 +02:00
Kalle Olavi Niemitalo
5261cd17d1 UTF-8: Change type of constants to struct screen_driver_opt.
We don't need a full struct screen_driver here.
2007-05-20 14:23:33 +02:00
Kalle Olavi Niemitalo
3786dd9265 UTF-8: Leave driver->opt initialization to set_screen_driver_opt.
Don't bother to initialize driver->opt with memcpy in add_screen_driver.
2007-05-20 14:23:27 +02:00
Kalle Olavi Niemitalo
f8fdf6a93d UTF-8: Rename update_screen_driver to set_screen_driver_opt. 2007-05-20 14:23:21 +02:00
Kalle Olavi Niemitalo
b493ab8b9e UTF-8, update_screen_driver: Restore all original options. 2007-05-20 14:23:16 +02:00
Kalle Olavi Niemitalo
73b67d34dc UTF-8: New struct screen_driver_opt engulfs most of struct screen_driver.
No behaviour changes yet, although padding may differ.
2007-05-20 14:23:11 +02:00
Kalle Olavi Niemitalo
b6855c8616 UTF-8, update_screen_driver: First read the "charset" option. 2007-05-20 14:23:05 +02:00
Kalle Olavi Niemitalo
0d9be10fe4 UTF-8, update_screen_driver: A small rearrangement.
This does not change the behaviour but will help later changes.
2007-05-20 14:22:59 +02:00
Kalle Olavi Niemitalo
39bd97f11e UTF-8: Whitespace changes. 2007-05-20 14:22:54 +02:00
Kalle Olavi Niemitalo
ac6c03e287 put_link_line: Add a comment related to bug 213. 2007-05-20 14:22:47 +02:00
Jonas Fonseca
211ffef1e6 Refactor test-sgml-parser-basic to work with non-bash shells
A problem with \n replacement caused test no. 19 to fail.
Fix it by also allowing expected output to be prepared in a
file by introducing a new backend: test_output_equals_file,
also used test_output_equals.

Tested on Ubuntu Feisty Fawn with both /bin/bash and /bin/sh
where /bin/sh failed before the fix. Reported by Witek.
2007-05-20 14:22:15 +02:00
Jonas Fonseca
39db04ff39 Check if the program path contains "src/" before using ../po files
Don't look for gettext message catalogs in ../po/ unless ELinks is being
run as src/elinks, ./src/elinks, or .../src/elinks.

Discovered by Arnaud Giersch, this alternate fix (than what is in debian
package 0.11.1-1.4) closes debian bug #417789 and redhat bug #235411.
Also reported in: CVE-2007-2027.

Restricting it to only work with --enable-debug was also considered,
however, it is an important feature for translaters so this less
paranoid fix was chosen.
2007-05-20 14:21:53 +02:00
Kalle Olavi Niemitalo
bf71d024bc Debian bug 380347: Prevent a buffer overflow in entity_cache. 2007-05-20 14:21:09 +02:00
Kalle Olavi Niemitalo
7d9d95961b Revert 2d6840b9, "Only set the socket protocol family on success."
Revert commit 2d6840b9bd9d3a7a45a5ad92b4e98ff7224d6d97.  It is causing
passive FTP via IPv6 to fail on ftp.funet.fi.  ELinks sends PASV and
the server says "425 You cannot use PASV on IPv6 connections. Use EPSV
instead."
2007-05-20 14:20:54 +02:00
Kalle Olavi Niemitalo
07548d5a75 Bug 816, html_textarea: Expand entity references.
Because the renderer no longer does that.
The comment "We don't cope well with entities here" may now be
obsolete but I'm not sure about that so I'm leaving it in.
2007-05-20 14:20:49 +02:00
Kalle Olavi Niemitalo
fc4838b740 html_textarea: Use memmove rather than memcpy.
This is an overlapping copy and memcpy is not required to support that.
2007-05-20 14:20:44 +02:00
Kalle Olavi Niemitalo
0b10539d10 Bug 784: Add html_context->doc_cp and parse attributes with it.
options->cp is still used for this in seven places where html_context
is not easily available.  Those should eventually be corrected too,
but I'm checking this change in already because it's better than what
we had before.
2007-05-20 14:20:35 +02:00
Kalle Olavi Niemitalo
3e16757753 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-05-20 14:05:39 +02:00