1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[document] Try to not parse js again

This commit is contained in:
Witold Filipczyk 2021-10-05 20:11:18 +02:00
parent 408f644b4c
commit b84cfb1360
5 changed files with 9 additions and 0 deletions

View File

@ -275,6 +275,7 @@ reset_document(struct document *document)
mem_free_set(&document->lines1, NULL);
mem_free_set(&document->lines2, NULL);
document->options.was_xml_parsed = 1;
/// done_document_options(&document->options);
while (!list_empty(document->forms)) {

View File

@ -88,6 +88,8 @@ struct html_context {
unsigned int support_css:1;
unsigned int skip_textarea:1;
unsigned int was_xml_parsed:1;
/* For html/parser.c, html/renderer.c */
int margin;

View File

@ -788,6 +788,7 @@ init_html_parser(struct uri *uri, struct document_options *options,
html_context->base_target = null_or_stracpy(options->framename);
html_context->options = options;
html_context->was_xml_parsed = options->was_xml_parsed;
/* FIXME (bug 784): cp is the terminal charset;
* should use the document charset instead. */

View File

@ -219,6 +219,9 @@ html_script(struct html_context *html_context, char *a,
html_skip(html_context, a);
#ifdef CONFIG_ECMASCRIPT
if (html_context->was_xml_parsed) {
return;
}
/* We try to process nested <script> if we didn't process the parent
* one. That's why's all the fuzz. */
/* Ref:

View File

@ -117,6 +117,8 @@ struct document_options {
unsigned int links_show_goto:1;
unsigned int was_xml_parsed:1;
/* XXX: Everything past this comment is specialy handled by compare_opt() */
char *framename;