Mercurial > hg
diff tests/test-hgweb-empty.t @ 35415:56854848e485
hgweb: stop using HTML comments in <script>
Once upon a time, in 1995, there were browsers that didn't understand <script>
tags and they would simply show the code inside as text. This started a
tradition of wrapping everything inside <script> in <!-- HTML comments -->.
Nowadays, it's not only not needed, but can be considered harmful[1]:
- within XHTML documents, the source will actually be hidden from all browsers
and rendered useless
- `--` is not allowed within HTML comments, so any decrement operations in
script are invalid
[1]: http://www.javascripttoolbox.com/bestpractices/#comments
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 15 Dec 2017 12:15:58 +0800 |
parents | f84b01257e06 |
children | 5afe0ca59b07 |
line wrap: on
line diff
--- a/tests/test-hgweb-empty.t Thu Dec 14 16:01:28 2017 -0500 +++ b/tests/test-hgweb-empty.t Fri Dec 15 12:15:58 2017 +0800 @@ -300,8 +300,6 @@ </div> <script type="text/javascript"> - <!-- hide script content - var data = []; var graph = new Graph(); graph.scale(39); @@ -312,8 +310,6 @@ } graph.render(data); - - // stop hiding script --> </script> <div class="navigate">