mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05: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);
|
dom_node_unref(root);
|
||||||
|
|
||||||
if (parse) {
|
if (parse) {
|
||||||
free_document(document);
|
cached->valid = 0;
|
||||||
document->dom = NULL;
|
cached = get_cache_entry(cached->uri);
|
||||||
render_xhtml_document(cached, document, &document->text);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
render_html_document(cached, document, &document->text);
|
render_html_document(cached, document, &document->text);
|
||||||
|
@ -312,8 +312,7 @@ delayed_reload(void *data)
|
|||||||
struct session *ses = rel->ses;
|
struct session *ses = rel->ses;
|
||||||
|
|
||||||
assert(rel);
|
assert(rel);
|
||||||
reset_document(rel->document);
|
dump_xhtml(rel->cached, rel->document, 1 || rel->was_write);
|
||||||
dump_xhtml(rel->cached, rel->document, rel->was_write);
|
|
||||||
|
|
||||||
draw_formatted(ses, 3);
|
draw_formatted(ses, 3);
|
||||||
load_common(ses);
|
load_common(ses);
|
||||||
|
Loading…
Reference in New Issue
Block a user