mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-28 03:06:20 -04:00
[dom] rewrite cache
This commit is contained in:
parent
3b233ba711
commit
8596d604cc
@ -349,9 +349,23 @@ dump_xhtml(struct cache_entry *cached, struct document *document, int parse)
|
||||
dom_node_unref(root);
|
||||
|
||||
if (parse) {
|
||||
free_document(document);
|
||||
document->dom = NULL;
|
||||
render_xhtml_document(cached, document, &document->text);
|
||||
cached->valid = 0;
|
||||
cached = get_cache_entry(cached->uri);
|
||||
struct document *doc2;
|
||||
|
||||
if (!cached) {
|
||||
return;
|
||||
}
|
||||
add_fragment(cached, 0, document->text.source, document->text.length);
|
||||
normalize_cache_entry(cached, document->text.length);
|
||||
doc2 = init_document(cached, &document->options);
|
||||
|
||||
if (!doc2) {
|
||||
return;
|
||||
}
|
||||
add_string_to_string(&doc2->text, &document->text);
|
||||
reset_document(document);
|
||||
render_xhtml_document(cached, doc2, &doc2->text);
|
||||
return;
|
||||
}
|
||||
render_html_document(cached, document, &document->text);
|
||||
|
@ -312,8 +312,7 @@ delayed_reload(void *data)
|
||||
struct session *ses = rel->ses;
|
||||
|
||||
assert(rel);
|
||||
reset_document(rel->document);
|
||||
dump_xhtml(rel->cached, rel->document, rel->was_write);
|
||||
dump_xhtml(rel->cached, rel->document, 1 || rel->was_write);
|
||||
|
||||
draw_formatted(ses, 3);
|
||||
load_common(ses);
|
||||
|
Loading…
Reference in New Issue
Block a user