mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[document] Try to not parse js again
This commit is contained in:
parent
408f644b4c
commit
b84cfb1360
@ -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)) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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. */
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user