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

Use document_view instead of view_state. It is safer probably

This commit is contained in:
2006-01-28 12:07:00 +01:00
parent 9cc9db4e24
commit 997f61bb32
3 changed files with 11 additions and 10 deletions

View File

@ -11,12 +11,12 @@
struct cache_entry; struct cache_entry;
struct document_refresh; struct document_refresh;
struct document_view;
struct form_control; struct form_control;
struct frame_desc; struct frame_desc;
struct frameset_desc; struct frameset_desc;
struct module; struct module;
struct screen_char; struct screen_char;
struct view_state;
/* Nodes are used for marking areas of text on the document canvas as /* Nodes are used for marking areas of text on the document canvas as
* searchable. */ * searchable. */
@ -149,7 +149,7 @@ struct document {
* unneeded. */ * unneeded. */
struct uri_list ecmascript_imports; struct uri_list ecmascript_imports;
/* For ecmascript access */ /* For ecmascript access */
struct view_state *vs; struct document_view *doc_view;
#endif #endif
#ifdef CONFIG_CSS #ifdef CONFIG_CSS
/* FIXME: We should externally maybe using cache_entry store the /* FIXME: We should externally maybe using cache_entry store the

View File

@ -18,6 +18,7 @@
#include "config/options.h" #include "config/options.h"
#include "document/css/apply.h" #include "document/css/apply.h"
#include "document/document.h" #include "document/document.h"
#include "document/view.h"
#include "document/html/frames.h" #include "document/html/frames.h"
#include "document/html/parser/general.h" #include "document/html/parser/general.h"
#include "document/html/parser/link.h" #include "document/html/parser/link.h"
@ -349,14 +350,14 @@ imported:
struct string code, ret; struct string code, ret;
struct part *part = html_context->part; struct part *part = html_context->part;
struct document *document = part->document; struct document *document = part->document;
struct view_state *vs = document->vs; struct document_view *doc_view = document->doc_view;
struct ecmascript_interpreter *interpreter = vs->ecmascript; struct view_state *vs = doc_view->vs;
struct ecmascript_interpreter *interpreter;
if (!interpreter) { if (vs->ecmascript_fragile)
ecmascript_reset_state(vs); ecmascript_reset_state(vs);
interpreter = vs->ecmascript; interpreter = vs->ecmascript;
} assert(interpreter);
if (!interpreter) return;
if (!init_string(&code)) return; if (!init_string(&code)) return;
if (!init_string(&ret)) { if (!init_string(&ret)) {

View File

@ -328,7 +328,7 @@ render_document(struct view_state *vs, struct document_view *doc_view,
if (document) { if (document) {
doc_view->document = document; doc_view->document = document;
#ifdef CONFIG_ECMASCRIPT #ifdef CONFIG_ECMASCRIPT
document->vs = vs; document->doc_view = doc_view;
#endif #endif
} else { } else {
document = init_document(cached, options); document = init_document(cached, options);
@ -337,7 +337,7 @@ render_document(struct view_state *vs, struct document_view *doc_view,
shrink_memory(0); shrink_memory(0);
#ifdef CONFIG_ECMASCRIPT #ifdef CONFIG_ECMASCRIPT
document->vs = vs; document->doc_view = doc_view;
#endif #endif
render_encoded_document(cached, document); render_encoded_document(cached, document);
sort_links(document); sort_links(document);