1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-30 03:26:23 -04:00
Commit Graph

772 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
f2854e19ba SMJS: keymap_get_property: fix build error
Fix an error in the order of variable initialisation that was introduced
in commit 9a829b3277.

(Copied from a2c48b4d91fe6c6998836deca73eb93d324630df in ELinks 0.12.GIT.)
2006-11-26 15:57:52 +02:00
Miciah Dashiel Butler Masters
a44e72161f SMJS: keymap_set_property: fix build error
Fix an error in the order of variable initialisation that was introduced
in commit 9a829b3277.

(Copied from eaed0315993b07a20211b151a53ba7bd4553dff0 in ELinks 0.12.GIT.)
2006-11-26 15:54:35 +02:00
Kalle Olavi Niemitalo
0744d96213 Bug 846: Add plenty of JS_InstanceOf assertions and checks.
(Adapted from 47dce0922b in ELinks 0.12.GIT.)
2006-11-25 21:24:25 +02:00
Kalle Olavi Niemitalo
9a829b3277 Bug 846: Separate JS_GetParent & JS_GetPrivate calls from initializations.
This will allow the types of objects to be checked before those calls.

(Adapted from bbf0d478e9 in ELinks 0.12.GIT.)
2006-11-25 21:14:56 +02:00
Kalle Olavi Niemitalo
4c58b4c56c Bug 846: Rename some local variables.
Rename parent to parent_win if it points to an instance of window_class.

(Adapted from 98a120b3d5 in ELinks 0.12.GIT.)
2006-11-25 21:01:53 +02:00
Kalle Olavi Niemitalo
59df2a3d11 Bug 846: Document the JSClass assumed in each JS_{Set,Get}Private call.
(Adapted from 356678dd80 in ELinks 0.12.GIT.)
2006-11-25 20:56:09 +02:00
Kalle Olavi Niemitalo
92290b73a9 Bug 846: Document the expected parents of SMJS class instances.
(Copied from 36f5f73a60 in ELinks 0.12.GIT.)
2006-11-25 20:50:34 +02:00
Kalle Olavi Niemitalo
fcebd6d111 Bug 846: Comments on the relations between JSClasses and functions.
(Adapted from 670ad939c3 in ELinks 0.12.GIT.)
2006-11-25 20:48:29 +02:00
Kalle Olavi Niemitalo
ffa24fd3e0 Bug 846: Document the private data in each SMJS class.
(Adapted from d6ea143f36 in ELinks 0.12.GIT.
 ELinks 0.11.2.GIT doesn't have src/scripting/smjs/action_object.c and
 src/scripting/smjs/globhist.c.)
2006-11-25 20:35:48 +02:00
Kalle Olavi Niemitalo
6f14725204 Bug 841, CVE-2006-5925: Prevent enabling the SMB protocol.
src/protocol/smb/smb.c: Added #error directives so that this
vulnerable code cannot be accidentally compiled in.

features.conf: Disable CONFIG_SMB by default and explain why.

configure.in: If the user set CONFIG_SMB in features.conf or
--enable-smb in the command line, disable them and warn the user.

(This commit combines f915c31127 and
388de7bd65 from ELinks 0.12.GIT.)
2006-11-18 22:37:51 +02:00
Witold Filipczyk
8789b7c330 Ecmascript: activate link only when onClick returns true
[ Merge stuff from commit c3f17eadeb, namely
  the remaining part which changes enter() to only call activate_link when
  needed. --jonas ]
2006-08-22 23:49:40 +02:00
Jonas Fonseca
fcf8d31eba Fix compilation on Minix3
- Include arpa/inet.h to get hton* ntoh* functions.
 - Use socklen_t instead of int.
 - Try to define PF_INET to AF_INET if it doesn't exist.

Reported-by: Andy Tanenbaum <ast@cs.vu.nl>
2006-08-22 22:10:51 +02:00
Jonas Fonseca
205f346d49 Use internal OFF_T_FORMAT instead of PRId64
... since the latter is for printing int64_T and we don't check for that and
we use PRId64 only for printing values having the off_t types.

Besides off_t has it's own ELinks specific defaults so it should be safer
to use an internal format string. If off_t is 8 bytes use "lld" else use
"ld".

Reported-by: Andy Tanenbaum <ast@cs.vu.nl>
2006-08-05 00:39:14 +02:00
Jonas Fonseca
038f3a4502 Apply the many changes to Makefile.lib in one go
This fixes make test dependencies and a lot more things.
2006-01-29 12:41:14 +01:00
Jonas Fonseca
081ab78a88 Revert 06eb3fa02abf12c6d2352af4288a6ad465a0e8c1 (in the historic repo)
This was reverted by zas in commit 2a71adda10
in current HEAD (elinks-0.12).

The original commit message reads: Anchors with '#' didn't "work" for
libstdc++ local documentation due to encoded filenames. This change fixes
it and hopefully has no impact for other parts of ELinks.
2006-01-29 12:28:43 +01:00
Jonas Fonseca
ba68992ef2 Normalize all links added by the plain renderer
Fixes problems with host or protocol parts not being lowercased. This
triggers an assertion failure when trying to download such links. Reported
by lindi-.
2006-01-29 12:06:30 +01:00
Miciah Dashiel Butler Masters
b9d5bcee1c SMJS: Give user scripts access to the view_state
Introduce the view_state object to ECMAScript with properties .uri and
.plain and pass the current view_state to preformat hooks.
2006-01-29 12:02:08 +01:00
Jonas Fonseca
b69e0d4eb2 Fix out of bound access to the scanned string 2006-01-29 11:54:35 +01:00
66500fa4ab Set text/plain for errors 2006-01-29 11:43:25 +01:00
bd4be81013 Content-Type handling 2006-01-29 11:42:43 +01:00
b530860e5a Use slashes after directories. Blocks are not used where there is only
one instruction
2006-01-29 11:41:33 +01:00
Jonas Fonseca
fac4c2631f Handle <base href=""> for HTML source rendering
Requested by witekfl.
2006-01-29 11:41:13 +01:00
Jonas Fonseca
b7ffca5485 Rename enum html_element_type to html_element_mortality_type
This name is reserved for DOM.
2006-01-29 11:32:14 +01:00
Jonas Fonseca
1d516527ca Fix the mailcap test program's dependency on gettext 2006-01-29 11:28:38 +01:00
Jonas Fonseca
b53efd138b Fix the EPLF FTP parser test to run FreeBSD 2006-01-29 11:28:26 +01:00
8a1a2d427b Make elinks tcc (tiny C compiler) friendly.
If you want to try tcc use CC=tcc ./configure and make LD=tcc.
I built ELinks with tcc, but ELinks segfaults.
2006-01-29 11:28:05 +01:00
Jonas Fonseca
9ddadc3075 #include dom/node.h instead of dom/stack.h 2006-01-29 11:22:08 +01:00
Miciah Dashiel Butler Masters
2cab7a5455 look_for_link: simplify string
Use stracpy(empty_string_or_(target_base)) instead of
null_or_stracpy(target_base) and then stracpy("") if that returns NULL.
2006-01-29 11:19:34 +01:00
witekfl
a191b4dc31 Used protocol/common.h in CGI 2006-01-29 11:19:18 +01:00
Jonas Fonseca
2074c8ca88 Remove unused fsp_info struct; use sizeof(*table); fix dir entry hiliting 2006-01-29 11:16:48 +01:00
Jonas Fonseca
2b27347359 Simplify URI string grapping; make dir listing more like FTP; use READ_SIZE 2006-01-29 11:16:20 +01:00
Jonas Fonseca
91f0abfbc1 Minor space cleanups; use pid_t; abort_connection() will close_socket() 2006-01-29 11:16:07 +01:00
Laurent MONIN
78a54412c3 Typo fix. 2006-01-29 11:15:31 +01:00
Jonas Fonseca
af67388201 Move close_all_non_term_fd() shared by SMB and FSP to protocol/common
Stick a note near the OBJS sorting that it is there also to filter out
duplicates, which are now occuring with SMB and FSP compiled in.
2006-01-29 11:15:18 +01:00
c287c42a07 Make PHP 5 happy. 2006-01-29 11:06:09 +01:00
9341c9085e - FSP protocol 2006-01-29 11:03:53 +01:00
Jonas Fonseca
1b999c9b6a Remove .vimrc files; use the Vim ftplugin instead 2006-01-29 10:45:22 +01:00
Laurent MONIN
0983c5c764 Fix a memleak that may occur on systems without alloca(), backport from
gettext 0.14.5.
2006-01-29 10:27:41 +01:00
Laurent MONIN
9c767f491f Upgrade config.charset to latest version from gnu gettext. 2006-01-29 10:27:27 +01:00
Jonas Fonseca
f19aa38e1f Fix typo 2006-01-29 10:25:18 +01:00
Jonas Fonseca
d7571e313c Cleanup SGML info backends #includes and description 2006-01-29 10:25:03 +01:00
Laurent MONIN
1f7bc476c6 Add a comment about CONFIG_TCP_INTERLINK. 2006-01-29 10:22:30 +01:00
Laurent MONIN
92387e4478 Store lib.o name in a variable named LIB_O_NAME. 2006-01-29 10:22:19 +01:00
Jonas Fonseca
a456cdbea3 Include osdep/stat.h to get S_* macros 2006-01-29 10:17:37 +01:00
Jonas Fonseca
d80b072e1b Compile fix after check_uri_file() after the cleanup 2006-01-29 10:15:16 +01:00
Laurent MONIN
e03aacf5d3 Complete the list of S_I* macros. 2006-01-29 10:02:55 +01:00
Laurent MONIN
1c95d6c2af Simplify secure_open() call, make it a wrapper around secure_open_umask(). 2006-01-29 10:02:46 +01:00
Laurent MONIN
5fd2b6228f Prefer S_I?USR and S_IRWXU over obsolete S_IREAD, S_IWRITE, S_IEXEC. 2006-01-29 10:01:30 +01:00
Laurent MONIN
347b3530a1 Use mode_t and mode macros everywhere. 2006-01-29 09:59:09 +01:00
Jonas Fonseca
2d95ad040c As a stop gap measure avoid using NULL entry->nonce and realms
Reported by xmath. Obviously needs to be looked into.
2006-01-10 16:09:04 +01:00
Jonas Fonseca
8a8ef8ae6a This years batch of Gopher fixes
Two crash fixes, and really make the directory 'view' the default.
2006-01-10 16:07:17 +01:00
Kalle Olavi Niemitalo
63797ae9b3 Don't include <sys/param.h> in util/math for MAX/MIN
<sys/param.h> includes <linux/param.h>, which includes <asm/param.h>, which
includes <asm-i486/param.h>, which includes <linux/config.h>, which
includes <linux/autoconf.h>, which includes <asm-i486/autoconf.h>, which
undefines CONFIG_IPV6.
2006-01-10 16:06:09 +01:00
Laurent MONIN
857138d391 check_uri_file(): use strcspn(). 2006-01-10 16:03:49 +01:00
Miciah Dashiel Butler Masters
b4edfc977d Fix add_document_to_string to add all chars in a line, not just the first
Revision 1.82 of src/scripting/lua/core.c and revision 1.42
of src/viewer/dump/dump.c (2 years, 2 months ago), which moved
add_document_to_string from the former to the latter, introduced
a logic error: the local variable pos was set in the outer loop,
which iterates thru the lines in the document, whereas it should be
(and had been) set in the inner loop, which iterates thru the columns.

This brings us all the way back to a working current_document_formatted
for Lua scripts.
2006-01-10 16:00:12 +01:00
Miciah Dashiel Butler Masters
2011629449 Fix add_document_to_string to actually add stuff
Revision 1.147 (14 months, 2 weeks ago) broke the logic so that only
frame characters were added. This fixes that change, getting us halfway
back to a working current_document_formatted function for Lua.
2006-01-10 16:00:03 +01:00
Laurent MONIN
bba44965bf check_uri_file(): optimize by not using strlen() more than needed. 2006-01-10 15:59:39 +01:00
Laurent MONIN
0ca96e9ae9 check_whether_file_exists(): optimize by not using strlen() more than
needed.
2006-01-10 15:59:32 +01:00
Jonas Fonseca
3a6d465d94 Use check_whether_file_exists() when encoding a file URI string
The file URI encoding is done in translate_url() immediately after the call
to find_uri_protocol() [which also uses check_whether_file_exists()]. So it
only makes sense to use check_whether_file_exists() also here since this is
a potential ambiguous URL from the user.

This fixes handling of files like 'a?b' given the command line, reported by
rrowan. It broke (for the n-th time ;) in CVS version 1.317->1.318 back in
August. The fix preserves the intend of that patch, namely the intend to
optimize the number of calls to file_exists().
2006-01-10 15:58:50 +01:00
Jonas Fonseca
1a1bf9960d Add a simple test script of the mailcap cache
It has a few nasty hacks to reduce the dependencies on defined symbols.
2006-01-10 15:58:06 +01:00
Jonas Fonseca
754d56b451 Realign the test docs with reality 2006-01-10 15:48:48 +01:00
Jonas Fonseca
da9c03b278 Use get_opt_codepage_tree() and kill warning 2006-01-10 15:47:18 +01:00
Laurent MONIN
daef63dd27 Define EL_PF_INET and EL_PF_INET6 to identify protocol in use instead
of numeric values.
2006-01-10 15:47:10 +01:00
Laurent MONIN
d9b56bad7d Use PF_* instead of AF_* as first parameter of socket(2). 2006-01-10 15:46:57 +01:00
Jonas Fonseca
4035b6ba66 Drop unneeded -b arg to cmp, which isn't available in FreeBSD's version 2006-01-10 15:46:41 +01:00
Jonas Fonseca
4cbaad6f8d Improve support for running 'make test' when srcdir != builddir
Additionally, also make TESTDEPS conditionally contain memdebug object
binary only if CONFIG_DEBUG is yes.
2006-01-10 15:44:29 +01:00
Jonas Fonseca
46922582a8 Rbuild the entity table with Unicode/gen-ent 2006-01-10 14:38:54 +01:00
Jonas Fonseca
2abfbda9d9 Merge in the 0x???? chars and fix some incomplete descriptions
Skip entities with unknown unicode (0x????) in gen-ent. Thanks to Miciah
for noticing a missing description part.
2006-01-10 14:22:00 +01:00
Laurent MONIN
19c7196c05 Update year to 2006 in Copying message. 2006-01-10 14:13:11 +01:00
Laurent MONIN
43d47ade42 Let ftp-parser displays usage information when called with no arg or
empty string, instead of core dump in debug mode.
2006-01-10 14:13:01 +01:00
Jonas Fonseca
065b8f405a Drop empty lines from option descriptions; doc/tools/help2doc don't like em 2006-01-10 14:12:06 +01:00
Jonas Fonseca
fa23a65b81 Add support for recursively running all tests 2006-01-10 14:10:08 +01:00
Jonas Fonseca
d048bb4888 Make a test-ftp-parser test script and remove the 'built-in' one 2006-01-10 14:09:49 +01:00
Jonas Fonseca
9debe3b3ae Move the 'make test' handling to Makefile.lib
The test rule is defined when TEST_PROGS is defined. Users should also set
TESTDEPS to get the correct object files linked in.
2006-01-10 14:06:17 +01:00
Jonas Fonseca
b52baed88f Move src/dom/test/libtest test/libtest.sh, put path to it in TEST_LIB 2006-01-10 14:05:58 +01:00
Miciah Dashiel Butler Masters
d4cceb5f0e Check for hooks.js before trying to load it.
Check file_exists(path) before calling smjs_do_file(path)
in smjs_load_hooks to fix an error message when there is no hooks.js,
reported by zas.
2006-01-10 14:03:32 +01:00
Laurent MONIN
9d287c24ae Add missing b flag to fopen() call. 2006-01-10 14:01:46 +01:00
Jonas Fonseca
6e24450bdf Improve (or rather fix) how document types are matched in the DOM renderer 2006-01-10 14:01:22 +01:00
Jonas Fonseca
9e7d920663 Use the simpler strcasecmp() instead of strcaselcmp() 2006-01-10 14:01:14 +01:00
Jonas Fonseca
b01c1a6361 Also highlight HTML if the MIME type is application/xhtml+xml 2006-01-10 14:01:03 +01:00
Jonas Fonseca
dabe0816fb Fix more problems when $(srcdir) is empty
Thanks to Kalle Olavi Niemitalo and Adam Golebiowski.
2006-01-10 14:00:11 +01:00
Miciah Dashiel Butler Masters
637fc46281 Change the keyboard accelerator for the cookie browser's Clear button
from C to L for great consistency.
2006-01-10 13:55:35 +01:00
Jonas Fonseca
6b62e0cb77 Declare struct sgml_parser_state above struct sgml_parser
... and describe the info member.
2005-12-31 20:02:39 +01:00
Jonas Fonseca
f0148c2ecf Keep struct sgml_parsing_state private to the parser 2005-12-31 19:59:11 +01:00
Jonas Fonseca
4a766f350b Just for fun also parse <?xml-stylesheet attributes 2005-12-31 03:13:39 +01:00
Jonas Fonseca
a578ed4667 Make the SGML scanner (optionally) keep track of line numbers
A new line is either \n or \f. The main logic for counting lines is in
skip_sgml{,_chars,_space}. For the general case where line numbers are not
wanted the code tries to avoid the extra checks for newlines.

This will be useful for reporting errors when loading the XBEL file.
2005-12-31 02:46:56 +01:00
Jonas Fonseca
b23beed031 Rename skip_comment() and skip_cdata_section() to conform to skip_sgml_*() 2005-12-31 02:00:09 +01:00
Jonas Fonseca
0891cda51e Introduce skip_sgml_space() that wraps scan_sgml(..., SGML_SCAN_WHITESPACE) 2005-12-31 01:57:54 +01:00
Jonas Fonseca
9264221635 Make init_dom_scanner() take the state arg and drop a macro 2005-12-31 01:55:38 +01:00
Jonas Fonseca
7489c134f7 Make non-terminated comments and cdata sections have 'the rest' as content 2005-12-31 01:47:57 +01:00
Jonas Fonseca
8f7f6abc16 Use skip_sgml_chars() in skip_comment() and skip_cdata_section() 2005-12-31 01:40:52 +01:00
Jonas Fonseca
4e10bcf772 Drop useless code for proc. instruction scanning 2005-12-31 01:18:49 +01:00
Jonas Fonseca
e8ff8bd5f0 Fix another off-by-one error similar to the SGML comment parsing 2005-12-31 01:14:52 +01:00
Jonas Fonseca
ab7ba39d42 Introduce skip_sgml_chars() to avoid usage of memchr() 2005-12-31 00:06:12 +01:00
Jonas Fonseca
14a3f9c0fd Disable dom-select building since it requires defining of DOM_STACK_TRACE 2005-12-31 00:05:49 +01:00
Jonas Fonseca
9a0bf83756 Add basic stuff for XBEL parsing/highlighting using the DOM engine 2005-12-30 22:19:32 +01:00
Jonas Fonseca
aa07b3edf4 Fix old (non) problem with using VERSION identifier by #undef'ing it first 2005-12-30 22:13:13 +01:00
Miciah Dashiel Butler Masters
9d713ff41d Write the bookmarks whether or not they are dirty if the backend has
changed since reading.
2005-12-30 21:08:50 +00:00
Jonas Fonseca
c0ece18042 Start showing RSS files in the plain view so it gets highlighted 2005-12-30 21:55:53 +01:00
Jonas Fonseca
65a114f4bc Sort the RSS elements, they are supposed to be binarily searchable 2005-12-30 21:46:44 +01:00
Jonas Fonseca
ad052c3985 Hey, hey Cripple Creek Fai^H^Herry 2005-12-30 21:19:46 +01:00
Jonas Fonseca
ff75d5086f Remove the DOM track tracer from the renderer 2005-12-30 13:08:42 +01:00
Miciah Dashiel Butler Masters
470da90699 Put documentation (doc/events.txt) and reality back into alignment
by changing goto_url_with_hook not to call goto_uri if get_hooked_uri
returns NULL, which it does if a hook returns "", which several hooks do.
2005-12-30 03:04:04 +00:00
Jonas Fonseca
41f1f5f9d3 Add a simple program for testing the DOM select code
It accepts --uri, --src and --selector args.
2005-12-30 03:33:48 +01:00
Jonas Fonseca
4f09ac99f7 Make it possible to identify the output of DOM stack tracers 2005-12-30 03:29:17 +01:00
Jonas Fonseca
0ddb5f2d18 Use the DOM stack tracer for getting a dump of active nodes 2005-12-30 03:02:59 +01:00
Jonas Fonseca
bd1beb1fab Use the stack when creating the select node hierachy 2005-12-30 02:59:34 +01:00
Jonas Fonseca
4868c23a06 Cleanup the DOM test Makefile so it's more generic and more silent 2005-12-30 02:19:25 +01:00
Jonas Fonseca
748bab64a7 Make the printed install paths simpler for man5 files when srcdir == builddir 2005-12-30 00:49:01 +01:00
Miciah Dashiel Butler Masters
6a44d5192d Fix a typo in an error message in cache_entry_set_property: s/get/set/ 2005-12-29 22:31:25 +00:00
Miciah Dashiel Butler Masters
65372061a0 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2005-12-29 22:29:39 +00:00
Miciah Dashiel Butler Masters
7f1711471f Drop an extra object_lock in bookmark_folder_get_property:
smjs_get_bookmark_object will lock the bookmark for us.
2005-12-29 22:19:19 +00:00
Miciah Dashiel Butler Masters
9e06b709d4 Return NULL when a script tries to get a bookmark that does not exist
in the given folder. (What was I thinking before?)
2005-12-29 22:18:45 +00:00
Jonas Fonseca
76a524ddf6 More <?xml and comment tests, fix an off-by-one error for comments skipping 2005-12-29 22:26:39 +01:00
Jonas Fonseca
bd877570d2 Test some more obscure proc. instructions and fix some assertion failures 2005-12-29 21:52:27 +01:00
Jonas Fonseca
57168e1fbc Handle <element path=/to/%61-&\one";files/> as a self-closing tag
Before the '/' before '>' would be interpreted as part of the attribute
value.  Hope this is sensible slurping of the markup soup.
2005-12-29 20:38:43 +01:00
Jonas Fonseca
958a4a1b51 Add tests for more things like space handling and obscure formatting 2005-12-29 19:13:48 +01:00
Jonas Fonseca
beb8337fc5 Add rule to make test run from src/dom dir 2005-12-29 18:33:59 +01:00
Jonas Fonseca
1a177491a0 Fix SGML parsing of processing instructions (<?xml ...?>)
It involves adding a new scanner state which is used only to generate a new
processing instruction (PI) data token. This removes some scanner specific
code from the parser and makes handling of PIs more generic. The data of
XML PIs are still parsed as attributes and added to the PI node.

The 6th test now succeeds. Hurrah!
2005-12-29 18:31:49 +01:00
Jonas Fonseca
c24c67ce59 Make it possible to initialise a scanner in a specific state 2005-12-29 18:20:03 +01:00
Jonas Fonseca
889a0f16f8 Fix the expected output of processing instruction parsing
Spaces after the target should be skipped.
2005-12-29 18:00:26 +01:00
Miciah Dashiel Butler Masters
684bac3b22 Define do_file before loading hooks.js in case hooks.js wants to use
do_file immediately.
2005-12-29 14:24:00 +00:00
Miciah Dashiel Butler Masters
ae42c586f8 Add elinks.home property. 2005-12-29 14:19:09 +00:00
Miciah Dashiel Butler Masters
a4be153703 Generalise the error message from smjs_do_file by dropping 'default'
from 'error loading default script file'.
2005-12-29 13:54:26 +00:00
Miciah Dashiel Butler Masters
b52a29f8c0 Let smjs_do_file return 0 to indicate failure and 1 to indicate
success. Add smjs_do_file_wrapper and let ECMAScript load files with
do_file(path).
2005-12-29 13:48:02 +00:00
Miciah Dashiel Butler Masters
cb506ea412 Factor smjs_do_file out of smjs_load_hooks. 2005-12-29 13:27:12 +00:00
Miciah Dashiel Butler Masters
9d4893e384 Mark smjs_load_hooks static. 2005-12-29 13:26:38 +00:00
Miciah Dashiel Butler Masters
79cf499cf9 Use JS_PropertyStub instead of NULL where applicable in JSClass
definitions.
2005-12-29 07:25:04 +00:00
Miciah Dashiel Butler Masters
46b1db47a2 Check JS_TRUE == ... instead of JS_FALSE != ... in smjs_get_keymap_object. 2005-12-29 07:20:33 +00:00
Miciah Dashiel Butler Masters
1ba2b6931a Don't check CACHE_ENTRY_LENGTH in cache_entry_set_property since, as
Jonas pointed out, .length is read-only, so SpiderMonkey will never
pass the setter CACHE_ENTRY_LENGTH. Anyway, .uri is also read-only and
is not handled in the setter.
2005-12-29 07:19:15 +00:00
Miciah Dashiel Butler Masters
898c2a8165 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2005-12-29 07:08:37 +00:00
Miciah Dashiel Butler Masters
17b7ffc7df Add elinks.bookmarks interface for reading bookmarks. 2005-12-29 07:05:31 +00:00
Jonas Fonseca
5a75bbc427 Merge with git+ssh://pasky/srv/git/elinks.git 2005-12-29 06:55:30 +01:00
Jonas Fonseca
ba5dbd3a18 Add test_output_equals helper and add a few more tests
The last one fails for now. Incorrect parsing of processing instructions.
2005-12-29 06:54:41 +01:00
Jonas Fonseca
23f21f1924 Fine tune how some of the nodes are printed, fix string compressing 2005-12-29 06:50:51 +01:00
Miciah Dashiel Butler Masters
59ffb72b8f Drop .or from elinks.or.cz. 2005-12-29 04:35:02 +00:00
Jonas Fonseca
602d2d8a66 Add README for the test infrastructure mostly pasted from git/t/README 2005-12-29 05:12:36 +01:00
Jonas Fonseca
d394cb0bc1 Grab GITs shell script-based test infrastructure and add "Hello world" test 2005-12-29 04:44:03 +01:00
Jonas Fonseca
f42b39ee3c Fix indentation so that things are printed at the start of the line 2005-12-29 04:39:20 +01:00
Jonas Fonseca
8dcbaa76f3 sgml-parser: Make it possible to specify the URL and the source to parse 2005-12-29 04:29:13 +01:00
Miciah Dashiel Butler Masters
006445cd09 Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2005-12-29 00:57:46 +00:00
Jonas Fonseca
c475f1fc0c Drop linking with util/string.o, since memdebug no longer requires it 2005-12-28 23:07:06 +01:00
Jonas Fonseca
3d0fc33785 set_mem_comment(): Use memcpy() + NUL assignment instead of safe_strncpy()
... so as not to depend on util/string stuff.
2005-12-28 23:06:23 +01:00
Jonas Fonseca
4feba6d515 Use stdio when printing enhanced values instead of allocating first 2005-12-28 23:02:45 +01:00
Jonas Fonseca
92767165cc Merge with elution 2005-12-28 21:25:08 +01:00
Jonas Fonseca
4bbc25c532 Remove dependency on util/string.h from dom/string.h 2005-12-28 21:20:55 +01:00
Jonas Fonseca
9bd346c295 dom_scanner_token_contains(): Use strcasecmp() instead of strlcasecmp() 2005-12-28 21:18:08 +01:00
Jonas Fonseca
fb6ca9a390 Use dom_string for storing the name member of dom_scanner_string_mapping 2005-12-28 21:10:05 +01:00
Jonas Fonseca
f1015f8a6a Make files include dom/string.h instead of util/string.h directly 2005-12-28 20:45:55 +01:00
Jonas Fonseca
e34d0d3de4 Initialize the string->length in init_dom_string() 2005-12-28 19:49:22 +01:00
Jonas Fonseca
04ff274663 Merge with elution 2005-12-28 17:20:27 +01:00
Jonas Fonseca
5a936cf99c Fix parsetst building 2005-12-28 17:16:39 +01:00
Jonas Fonseca
1b71368459 Add proof-of-concept stand-alone test binary which just prints Hello World
May it multiply in great numbers and help to stabilize the DOM
implementation.
2005-12-28 17:10:01 +01:00
Jonas Fonseca
1bd0c8758e Make the DOM node creators take dom_string structs 2005-12-28 16:47:28 +01:00
Jonas Fonseca
ec7b293e4e Some minor cleanup of token string access 2005-12-28 16:34:42 +01:00
Jonas Fonseca
6e163b186c Make the dom_scanner_token store it's string in a dom_string struct 2005-12-28 16:23:36 +01:00
Jonas Fonseca
97c702c674 Make init_dom_select() take dom_string struct 2005-12-28 15:57:37 +01:00
Jonas Fonseca
2e4e404145 Make init_dom_scanner() take the source string as a dom_string struct 2005-12-28 15:55:21 +01:00
Jonas Fonseca
62d981c551 Store struct dom_scan_table_info data in a dom_string 2005-12-28 15:51:31 +01:00
Jonas Fonseca
73785bee02 Remove some unneeded #includes 2005-12-28 15:36:58 +01:00
Jonas Fonseca
dbf0948062 Do not decode entity references and fix the tree tracer for document nodes
The idea is to make the DOM thing not depend on too many external things.
2005-12-28 15:27:05 +01:00
Jonas Fonseca
d1e275be52 Make parse_sgml() take buffer as dom_string struct 2005-12-28 15:21:45 +01:00
Jonas Fonseca
11e168aba4 Make init_sgml_parser() take URI as dom_string struct 2005-12-28 15:19:10 +01:00
Jonas Fonseca
a21f192199 Remove some left over .vimrc files 2005-12-28 14:14:12 +01:00
Jonas Fonseca
71533eef9a Elute all DOM-related code and put it in src/dom 2005-12-28 14:05:14 +01:00
Miciah Dashiel Butler Masters
81be17108b Understand a boolean true from elinks.goto_url_hook and
elinks.follow_url_hook to mean that the URI should be unchanged and that
further hooks should be permitted to run.
2005-12-28 07:12:09 +00:00
Miciah Dashiel Butler Masters
76d9b9de91 Add elinks.follow_url_hook. 2005-12-28 07:07:21 +00:00
Miciah Dashiel Butler Masters
d7c7736008 Add elinks.goto_url_hook. 2005-12-28 07:06:42 +00:00
Miciah Dashiel Butler Masters
c0fd25b368 Add a read-only .uri property to the cache_entry class. 2005-12-28 06:37:00 +00:00
Jonas Fonseca
217f905d88 call_dom_stack_callbacks(): Only acquire the state data if needed 2005-12-27 15:22:06 +01:00
Jonas Fonseca
a31eaaabdd Rename parse_sgml_document() -> parse_sgml_plain()
It really can be anything. I visited the elusive HTML parser to find the
new ending. ;)
2005-12-27 06:22:53 +01:00
Jonas Fonseca
9e7dfb1ddf Make walk_dom_nodes() use a stack context; reduces the DOM stack state size 2005-12-27 06:04:01 +01:00
Jonas Fonseca
a4831fef2d Make it easier to work with DOM stack contexts outside of the callbacks
The problem is to get access to the context when it is not the first one
and it has to happen outside of the context callbacks. This changes the
memory management so that the context adder returns the context. To further
improve the use of contexts add a context destructor which makes it
possible to unregister (temporary) contexts.
2005-12-27 05:59:12 +01:00
Jonas Fonseca
774aa70c6f Drop (now) unused get_dom_stack_parent() wrapper for get_dom_stack_state() 2005-12-27 04:44:20 +01:00
Jonas Fonseca
af19f811e3 Simplify DOM node popping
.. by turning do_pop_dom_node() into pop_dom_node() and let pop_dom_state()
handle it's own logic for reaching the wanted state.
2005-12-27 04:42:28 +01:00
Jonas Fonseca
f371de1638 Restructure the SGML parser file and add comments to the main parts 2005-12-27 03:57:56 +01:00
Jonas Fonseca
f5b32f86d1 Drop some dead code related to past rendering of DOM attribute nodes 2005-12-27 03:55:34 +01:00
Jonas Fonseca
b36229c222 Drop some unneeded #includes 2005-12-27 03:33:49 +01:00
Jonas Fonseca
0e2eefcb82 Add missing HTML_(SCRIPT, ...) definition 2005-12-27 01:58:54 +01:00
Jonas Fonseca
cef160d630 No need to have link_form_menu() be a menu function when it has an action 2005-12-26 22:28:38 +01:00
Jonas Fonseca
b82a38ab28 Introduce ACTION_REQUIRE_FORM and use it for link-form-menu
... since it asserts it is dealing with a link.
2005-12-26 22:22:03 +01:00
Jonas Fonseca
74a0a7b174 Highlight the 'CDATA' part of <![CDATA[ (in a bit hacky way) 2005-12-26 20:51:01 +01:00
Jonas Fonseca
c99b1cc2cc Render content of CDATA sections with orange2 (in lack of something better) 2005-12-26 19:56:07 +01:00
Jonas Fonseca
e28f3fc592 Drop macros in favour of more informative direct calls to add_sgml_node() 2005-12-26 19:45:58 +01:00
Jonas Fonseca
98d7263c2f Parse <[CDATA[ sections ]]> 2005-12-26 19:43:32 +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
Miciah Dashiel Butler Masters
92c9b86374 In add_document_line, check expanded + line_pos rather than just
expanded when checking whether there are enough characters on the line
to decrement expanded by 2. This fixes the problem reported by fonseca
where the linked text was offset from the URI when there were backspaces
earlier on the line.
2005-12-26 11:43:18 +00:00
Miciah Dashiel Butler Masters
eeb51bffea Refresh the view after selecting a new form item with the form menu. 2005-12-26 11:31:05 +00:00
Miciah Dashiel Butler Masters
bcdc69e86a Use intdup for the new form menu because you can't just put an int in
a void * and expect it to work everywhere.
2005-12-26 11:25:03 +00:00
Miciah Dashiel Butler Masters
a33547d8ad Add memory-leak tracing to intdup. 2005-12-26 11:22:05 +00:00
Miciah Dashiel Butler Masters
1602bd5d29 Factor intdup out of smjs_get_keymap_object. 2005-12-26 11:07:15 +00:00
Miciah Dashiel Butler Masters
e64871f5e2 Drop some dead code in add_document_line: line_pos should never be
negative.
2005-12-26 10:31:06 +00:00
Laurent MONIN
26c9bdf538 Move code from kbd_listbox() to new do_kbd_listbox_action(). 2005-12-26 11:02:39 +01:00
Laurent MONIN
918fed9966 kbd_listbox(): converts if {} stuff to a switch{}. 2005-12-26 10:53:39 +01:00
Laurent MONIN
9683cf429b display_listbox_item(): clarify tests a bit. 2005-12-26 10:39:07 +01:00
Jonas Fonseca
26b82953ce Add a "Form fields" entry to the link menu (if it is a form field)
The menu shows a list of all fields of a form, with the possibility to jump
right to that form field when selecting an entry. The menu text is the
basic form field label "Radio button", "Text field", etc. with the form
field name or alt text as the right menu text.

It introduces a new main action called link-form-menu with no default
binding.

Requested by Klaus Knopper, as a mean to improve accessibility for complex,
overloaded pages like ebay.com.
2005-12-26 01:27:44 +01:00
Jonas Fonseca
452f31d773 do_action(): Simplify checking of link requisition by testing link != NULL 2005-12-26 00:40:04 +01:00
Jonas Fonseca
1c3f6a8f3b Place cursor at start of text and only highlight the text in the managers
The old behavior would lead screeanreaders to pronounce items like the
bookmarks as "unknown-unknown-<the link name>". That is the border
chars of the tree view would be renderered as "unknown".

Requested by Klaus Knopper.
2005-12-26 00:26:04 +01:00
Jonas Fonseca
be8c68c5f7 Fix matching of file:// URLs which of course have no host name 2005-12-25 16:22:20 +01:00
Jonas Fonseca
5dd9061a55 Allocate the string of nodes being 'linkified'
This makes the string actually NUL terminated at the right place and the
matching will never go beyond the text region of the node. One example is
<!--http://elinks.cz/--> which didn't work before.
2005-12-25 16:08:00 +01:00
Jonas Fonseca
2d020e4879 Extend the URL_REGEX to allow more protocol and stuff like %XX in path part
Thanks to peder for suggestions.
2005-12-25 15:45:47 +01:00