Skip to content

Commit

Permalink
Fix a mistake in document.write <meta charset> test
Browse files Browse the repository at this point in the history
I forgot that the main meta charset scanner looks inside scripts per spec
  • Loading branch information
zcorpan committed Sep 8, 2021
1 parent 733aaaf commit 1481185
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
document.write('<plaintext>');
<\/script>
<\!-- speculative case in document.write -->
<meta charset=windows-1254><script src="/html/syntax/speculative-parsing/resources/stash.py?action=put&amp;uuid=${uuid}&amp;encodingcheck=&Gbreve;"><\/script>
<meta\ charset=windows-1254><script src="/html/syntax/speculative-parsing/resources/stash.py?action=put&amp;uuid=${uuid}&amp;encodingcheck=&Gbreve;"><\/script>
`);
</script>
2 changes: 1 addition & 1 deletion html/syntax/speculative-parsing/tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def generate_tests(testcase, tentative):
encoding_decl = f"<meta charset={encoding}>"

html_testcase_markup = template_testcase_markup.format(url_wptserve_sub)
js_testcase_markup = template_testcase_markup.format(url_js_sub).replace(u"</script>", u"<\/script>")
js_testcase_markup = template_testcase_markup.format(url_js_sub).replace(u"</script>", u"<\/script>").replace(u"<meta charset", u"<meta\ charset")

if test_nonspeculative is u'true':
nonspeculative = template_nonspeculative.format(preamble=preamble, encoding_decl=encoding_decl, title=title, testcase_markup=html_testcase_markup, delay=delay)
Expand Down

0 comments on commit 1481185

Please sign in to comment.