1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00
elinks/src/document
Kalle Olavi Niemitalo 386a5d517b Bug 698: Keep forms contiguous and non-overlapping and start from 0.
In document.forms, each struct form has form_num and form_end members
that reserve a subrange of [0, INT_MAX] to that form.  Previously,
multiple forms in the list could have form_end == INT_MAX and thus
overlap each other.  Prevent that by adjusting form_end of each form
newly added to the list.

Revert 438f039bda,
"check_html_form_hierarchy: Old code was buggy.", which made
check_html_form_hierarchy attach controls to the wrong forms.
Instead, construct the dummy form ("for those Flying Dutchmans") at
form_num == 0 always before adding any real forms to the list.
This prevents the assertion failure by ensuring that every possible
form_control.position is covered by some form, if there are any forms.

Add a function assert_forms_list_ok, which checks that the set of
forms actually covers the [0, INT_MAX] range without overlapping,
as intended.  Call that from check_html_form_hierarchy to detect
any corruption.

I have tested this code (before any cherry-picking) with:
- bug 613 attachment 210: didn't crash
- bug 714 attachment 471: didn't crash
- bug 961 attachment 382: didn't crash
- bug 698 attachment 239: all the submit buttons showed the right URLs
- bug 698 attachment 470: the submit button showed the right URL
2008-07-14 15:02:06 +03:00
..
css Bug 963: Parse scripts in blocks hidden with "display: none" 2008-06-09 13:58:41 +00:00
dom Merge branch 'elinks-0.12' into elinks-0.13 2008-07-11 22:28:45 +03:00
html Bug 698: Keep forms contiguous and non-overlapping and start from 0. 2008-07-14 15:02:06 +03:00
plain Use color.background instead of bgcolor in struct document too. 2007-10-12 16:50:47 +02:00
docdata.c Doxygenate src/document/ (but not subdirs) 2007-07-28 02:34:59 +03:00
docdata.h mem_alloc_align: drop the obj type parameter 2006-02-17 17:32:59 +00:00
document.c bug 1009: id variables renamed, added document_id to the document. 2008-04-27 23:22:08 +03:00
document.h bug 1009: id variables renamed, added document_id to the document. 2008-04-27 23:22:08 +03:00
format.c struct text_style_color fg,bg -> foreground, background 2007-10-12 16:41:06 +02:00
format.h struct text_style_color fg,bg -> foreground, background 2007-10-12 16:41:06 +02:00
forms.c Doxygenate src/document/ (but not subdirs) 2007-07-28 02:34:59 +03:00
forms.h Doxygenate src/document/ (but not subdirs) 2007-07-28 02:34:59 +03:00
Makefile Backport Pasky's changes concerning text_style-related stuff. 2007-09-14 14:59:37 +02:00
options.c Optionally honour "display: none" (default off) 2007-12-22 03:59:22 +00:00
options.h Optionally honour "display: none" (default off) 2007-12-22 03:59:22 +00:00
refresh.c Drop extra definition of start_document_refresh 2007-10-09 14:43:38 +00:00
refresh.h Introduce start_document_refreshes() 2007-09-14 16:44:04 +02:00
renderer.c Bug 983: Give precedence to HTTP Content-Type header over HTML meta tag 2008-06-30 19:29:02 +00:00
renderer.h Backport Pasky's changes concerning text_style-related stuff. 2007-09-14 14:59:37 +02:00
view.h Doxygenate src/document/ (but not subdirs) 2007-07-28 02:34:59 +03:00