Browse Source

verify Changed to explicitly require </html>

This was added originally because of a single framework that
seemed to be omitting </html>, which would result in the same
page rendering and was technically valid html5.

This check was readded because we are striving to maintain an
"apples-to-apples" response body. My worry is that if we do
not strictly require </html>, then some performant frameworks
might end up "optimizing" their fortunes test to omit it.
Mike Smith 11 years ago
parent
commit
26e791f115
1 changed files with 1 additions and 5 deletions
  1. 1 5
      toolset/benchmark/fortune_html_parser.py

+ 1 - 5
toolset/benchmark/fortune_html_parser.py

@@ -78,11 +78,7 @@ class FortuneHTMLParser(HTMLParser):
   # This is called every time a tag is closed. We append
   # This is called every time a tag is closed. We append
   # each one wrapped in "</" and ">".
   # each one wrapped in "</" and ">".
   def handle_endtag(self, tag):
   def handle_endtag(self, tag):
-    # Strictly speaking, a '</html>' is unnecessary, and
-    # some tests omit it; so we will omit it in our 
-    # normalized version.
-    if tag != "html":
-      self.body.append("</{t}>".format(t=tag))
+    self.body.append("</{t}>".format(t=tag))
 
 
   # Returns whether the HTML input parsed by this parser
   # Returns whether the HTML input parsed by this parser
   # is valid against our known "fortune" spec.
   # is valid against our known "fortune" spec.