From 2c087e52e74528a720621186b91880463e039d50 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sun, 12 Feb 2006 15:03:12 +0000 Subject: [PATCH] Revert unstable 'Eval embedded scripts at once' Revert commit 2f0490cb04fb4208aa321fb9d74ecf5309f662ae ('Eval embedded scripts at once') and follow-up commit 997f61bb32a61486cb3966c96725a2aa3d670e23 ('Use document_view instead of view_state. It is safer probably') because the change causes crashes on numerous pages and just looks wrong. --- src/document/document.h | 3 --- src/document/html/parser/general.c | 38 ------------------------------ src/document/renderer.c | 8 ++----- 3 files changed, 2 insertions(+), 47 deletions(-) diff --git a/src/document/document.h b/src/document/document.h index e24ea6c54..69024d340 100644 --- a/src/document/document.h +++ b/src/document/document.h @@ -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 diff --git a/src/document/html/parser/general.c b/src/document/html/parser/general.c index 3b71aba7b..f34cf0081 100644 --- a/src/document/html/parser/general.c +++ b/src/document/html/parser/general.c @@ -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 } diff --git a/src/document/renderer.c b/src/document/renderer.c index 0a164b445..2af18ed6d 100644 --- a/src/document/renderer.c +++ b/src/document/renderer.c @@ -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) {