mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Revert unstable 'Eval embedded scripts at once'
Revert commit2f0490cb04
('Eval embedded scripts at once') and follow-up commit997f61bb32
('Use document_view instead of view_state. It is safer probably') because the change causes crashes on numerous pages and just looks wrong.
This commit is contained in:
parent
cfbe41aa8a
commit
2c087e52e7
@ -11,7 +11,6 @@
|
||||
|
||||
struct cache_entry;
|
||||
struct document_refresh;
|
||||
struct document_view;
|
||||
struct form_control;
|
||||
struct frame_desc;
|
||||
struct frameset_desc;
|
||||
@ -148,8 +147,6 @@ struct document {
|
||||
* dependencies between the various entries so nothing gets removed
|
||||
* unneeded. */
|
||||
struct uri_list ecmascript_imports;
|
||||
/* For ecmascript access */
|
||||
struct document_view *doc_view;
|
||||
#endif
|
||||
#ifdef CONFIG_CSS
|
||||
/* FIXME: We should externally maybe using cache_entry store the
|
||||
|
@ -17,8 +17,6 @@
|
||||
|
||||
#include "config/options.h"
|
||||
#include "document/css/apply.h"
|
||||
#include "document/document.h"
|
||||
#include "document/view.h"
|
||||
#include "document/html/frames.h"
|
||||
#include "document/html/parser/general.h"
|
||||
#include "document/html/parser/link.h"
|
||||
@ -28,7 +26,6 @@
|
||||
#include "document/html/renderer.h"
|
||||
#include "document/html/tables.h"
|
||||
#include "document/options.h"
|
||||
#include "ecmascript/ecmascript.h"
|
||||
#include "intl/charsets.h"
|
||||
#include "protocol/uri.h"
|
||||
#include "terminal/draw.h"
|
||||
@ -40,7 +37,6 @@
|
||||
#include "util/memdebug.h"
|
||||
#include "util/memory.h"
|
||||
#include "util/string.h"
|
||||
#include "viewer/text/vs.h"
|
||||
|
||||
/* Unsafe macros */
|
||||
#include "document/html/internal.h"
|
||||
@ -347,42 +343,8 @@ imported:
|
||||
}
|
||||
|
||||
if (html_context->part->document && *html != '^') {
|
||||
struct string code, ret;
|
||||
struct part *part = html_context->part;
|
||||
struct document *document = part->document;
|
||||
struct document_view *doc_view = document->doc_view;
|
||||
struct view_state *vs = doc_view->vs;
|
||||
struct ecmascript_interpreter *interpreter;
|
||||
|
||||
if (vs->ecmascript_fragile)
|
||||
ecmascript_reset_state(vs);
|
||||
interpreter = vs->ecmascript;
|
||||
assert(interpreter);
|
||||
|
||||
if (!init_string(&code)) return;
|
||||
if (!init_string(&ret)) {
|
||||
done_string(&code);
|
||||
return;
|
||||
}
|
||||
add_bytes_to_string(&code, html, *end - html);
|
||||
|
||||
ecmascript_eval(interpreter, &code, &ret);
|
||||
done_string(&code);
|
||||
if (!ret.length) {
|
||||
done_string(&ret);
|
||||
return;
|
||||
}
|
||||
|
||||
/* FIXME: it doesn't work */
|
||||
html_top->invisible = 0;
|
||||
parse_html(ret.source, ret.source + ret.length, part, NULL,
|
||||
html_context);
|
||||
|
||||
done_string(&ret);
|
||||
#if 0
|
||||
add_to_string_list(&html_context->part->document->onload_snippets,
|
||||
html, *end - html);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -282,6 +282,7 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
||||
options->gradual_rerendering, struri(vs->uri),
|
||||
doc_view, doc_view->name, vs);
|
||||
#endif
|
||||
|
||||
name = doc_view->name;
|
||||
doc_view->name = NULL;
|
||||
|
||||
@ -325,18 +326,13 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
||||
document = get_cached_document(cached, options);
|
||||
if (document) {
|
||||
doc_view->document = document;
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
document->doc_view = doc_view;
|
||||
#endif
|
||||
} else {
|
||||
document = init_document(cached, options);
|
||||
if (!document) return;
|
||||
doc_view->document = document;
|
||||
|
||||
shrink_memory(0);
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
document->doc_view = doc_view;
|
||||
#endif
|
||||
|
||||
render_encoded_document(cached, document);
|
||||
sort_links(document);
|
||||
if (!document->title) {
|
||||
|
Loading…
Reference in New Issue
Block a user