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:
parent
9cc9db4e24
commit
997f61bb32
@ -11,12 +11,12 @@
|
||||
|
||||
struct cache_entry;
|
||||
struct document_refresh;
|
||||
struct document_view;
|
||||
struct form_control;
|
||||
struct frame_desc;
|
||||
struct frameset_desc;
|
||||
struct module;
|
||||
struct screen_char;
|
||||
struct view_state;
|
||||
|
||||
/* Nodes are used for marking areas of text on the document canvas as
|
||||
* searchable. */
|
||||
@ -149,7 +149,7 @@ struct document {
|
||||
* unneeded. */
|
||||
struct uri_list ecmascript_imports;
|
||||
/* For ecmascript access */
|
||||
struct view_state *vs;
|
||||
struct document_view *doc_view;
|
||||
#endif
|
||||
#ifdef CONFIG_CSS
|
||||
/* FIXME: We should externally maybe using cache_entry store the
|
||||
|
@ -18,6 +18,7 @@
|
||||
#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"
|
||||
@ -349,14 +350,14 @@ imported:
|
||||
struct string code, ret;
|
||||
struct part *part = html_context->part;
|
||||
struct document *document = part->document;
|
||||
struct view_state *vs = document->vs;
|
||||
struct ecmascript_interpreter *interpreter = vs->ecmascript;
|
||||
struct document_view *doc_view = document->doc_view;
|
||||
struct view_state *vs = doc_view->vs;
|
||||
struct ecmascript_interpreter *interpreter;
|
||||
|
||||
if (!interpreter) {
|
||||
if (vs->ecmascript_fragile)
|
||||
ecmascript_reset_state(vs);
|
||||
interpreter = vs->ecmascript;
|
||||
}
|
||||
if (!interpreter) return;
|
||||
assert(interpreter);
|
||||
|
||||
if (!init_string(&code)) return;
|
||||
if (!init_string(&ret)) {
|
||||
|
@ -328,7 +328,7 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
||||
if (document) {
|
||||
doc_view->document = document;
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
document->vs = vs;
|
||||
document->doc_view = doc_view;
|
||||
#endif
|
||||
} else {
|
||||
document = init_document(cached, options);
|
||||
@ -337,7 +337,7 @@ render_document(struct view_state *vs, struct document_view *doc_view,
|
||||
|
||||
shrink_memory(0);
|
||||
#ifdef CONFIG_ECMASCRIPT
|
||||
document->vs = vs;
|
||||
document->doc_view = doc_view;
|
||||
#endif
|
||||
render_encoded_document(cached, document);
|
||||
sort_links(document);
|
||||
|
Loading…
Reference in New Issue
Block a user