1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Reset forms after reloading a document.

This is a fix for the bug from bugzilla, but I don't remember the bug number
now. Forms are reset when new documents are loaded or old ones are reloaded.
Because of gradual rerendering forms may be reset a few times
before a document is fully loaded, what may be annoying.
This commit is contained in:
Witold Filipczyk 2007-03-11 18:52:53 +01:00 committed by Witold Filipczyk
parent 9362dfb9ae
commit ede61c1222

View File

@ -36,6 +36,7 @@
#include "util/memory.h" #include "util/memory.h"
#include "util/string.h" #include "util/string.h"
#include "viewer/text/festival.h" #include "viewer/text/festival.h"
#include "viewer/text/form.h"
#include "viewer/text/view.h" #include "viewer/text/view.h"
#include "viewer/text/vs.h" #include "viewer/text/vs.h"
@ -328,6 +329,8 @@ render_document(struct view_state *vs, struct document_view *doc_view,
if (document) { if (document) {
doc_view->document = document; doc_view->document = document;
} else { } else {
struct form *form;
document = init_document(cached, options); document = init_document(cached, options);
if (!document) return; if (!document) return;
doc_view->document = document; doc_view->document = document;
@ -359,6 +362,9 @@ render_document(struct view_state *vs, struct document_view *doc_view,
#ifdef CONFIG_CSS #ifdef CONFIG_CSS
document->css_magic = get_document_css_magic(document); document->css_magic = get_document_css_magic(document);
#endif #endif
foreach (form, document->forms) {
do_reset_form(doc_view, form);
}
} }
#ifdef CONFIG_ECMASCRIPT #ifdef CONFIG_ECMASCRIPT
if (!vs->ecmascript_fragile) if (!vs->ecmascript_fragile)