From 10c214997822991eb5dd33ca9aa876bf882c8b79 Mon Sep 17 00:00:00 2001 From: "sayrer%gmail.com" Date: Sat, 10 Mar 2007 23:41:00 +0000 Subject: [PATCH] Bug 366936. Run WHATWG/html5lib tests on HTML parser. r=mrbkap git-svn-id: svn://10.0.0.236/trunk@221716 18797224-902f-48f8-a5cc-f745e15eee43 --- .../htmlparser/tests/mochitest/Makefile.in | 9 +- .../html5_tree_construction_exceptions.js | 70 + .../tests/mochitest/html5lib_license.txt | 38 + .../tests/mochitest/html5lib_tree_dat1.txt | 1929 +++++++++++++++++ .../tests/mochitest/html5lib_tree_dat2.txt | 768 +++++++ .../tests/mochitest/html5lib_tree_dat3.txt | 132 ++ .../tests/mochitest/parser_datreader.js | 229 ++ .../tests/mochitest/parser_web_testrunner.js | 130 ++ .../test_html5_tree_construction.html | 37 + 9 files changed, 3341 insertions(+), 1 deletion(-) create mode 100644 mozilla/parser/htmlparser/tests/mochitest/html5_tree_construction_exceptions.js create mode 100644 mozilla/parser/htmlparser/tests/mochitest/html5lib_license.txt create mode 100644 mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat1.txt create mode 100644 mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat2.txt create mode 100644 mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat3.txt create mode 100644 mozilla/parser/htmlparser/tests/mochitest/parser_datreader.js create mode 100644 mozilla/parser/htmlparser/tests/mochitest/parser_web_testrunner.js create mode 100644 mozilla/parser/htmlparser/tests/mochitest/test_html5_tree_construction.html diff --git a/mozilla/parser/htmlparser/tests/mochitest/Makefile.in b/mozilla/parser/htmlparser/tests/mochitest/Makefile.in index 60c80714f73..bc6a5108204 100644 --- a/mozilla/parser/htmlparser/tests/mochitest/Makefile.in +++ b/mozilla/parser/htmlparser/tests/mochitest/Makefile.in @@ -44,7 +44,14 @@ relativesrcdir = parser/htmlparser/tests/mochitest include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk -_TEST_FILES = test_bug339350.xhtml \ +_TEST_FILES = parser_datreader.js \ + parser_web_testrunner.js \ + html5lib_tree_dat1.txt \ + html5lib_tree_dat2.txt \ + html5lib_tree_dat3.txt \ + html5_tree_construction_exceptions.js \ + test_html5_tree_construction.html \ + test_bug339350.xhtml \ test_bug358797.html \ $(NULL) diff --git a/mozilla/parser/htmlparser/tests/mochitest/html5_tree_construction_exceptions.js b/mozilla/parser/htmlparser/tests/mochitest/html5_tree_construction_exceptions.js new file mode 100644 index 00000000000..14cbdeb5735 --- /dev/null +++ b/mozilla/parser/htmlparser/tests/mochitest/html5_tree_construction_exceptions.js @@ -0,0 +1,70 @@ +/* these are the tests we don't pass */ +var html5Exceptions = { +"
": true, + "
X": true, + "

X": true, + "
": true, + "
": true, + "": true, + "x": true, +} + diff --git a/mozilla/parser/htmlparser/tests/mochitest/html5lib_license.txt b/mozilla/parser/htmlparser/tests/mochitest/html5lib_license.txt new file mode 100644 index 00000000000..2e1ebaf0824 --- /dev/null +++ b/mozilla/parser/htmlparser/tests/mochitest/html5lib_license.txt @@ -0,0 +1,38 @@ +Test data files prefixed with "html5lib" are from the html5lib project. + + +html5lib test cases are licensed as follows: + +--------------- + +The MIT License + +Copyright (c) 2006 The Authors + +Contributers: +James Graham - jg307@cam.ac.uk +Anne van Kesteren - annevankesteren@gmail.com +Lachlan Hunt - lachlan.hunt@lachy.id.au +Matt McDonald - kanashii@kanashii.ca +Sam Ruby - rubys@intertwingly.net +Ian Hickson (Google) - ian@hixie.ch +Thomas Broyer - t.broyer@gmail.com + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat1.txt b/mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat1.txt new file mode 100644 index 00000000000..2bdd7941d95 --- /dev/null +++ b/mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat1.txt @@ -0,0 +1,1929 @@ +#data +Test +#errors +5: missing document type declaration +#document +| +| +| +| "Test" + +#data +

One

Two +#errors +3: missing document type declaration +#document +| +| +| +|

+| "One" +|

+| "Two" + +#data +Line1
Line2
Line3
Line4 +#errors +7: missing document type declaration +#document +| +| +| +| "Line1" +|
+| "Line2" +|
+| "Line3" +|
+| "Line4" + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +19: unexpected body element end tag in head +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +6: missing document type declaration +#document +| +| +| + +#data + +#errors +7: missing document type declaration +7: unexpected head element end tag +#document +| +| +| + +#data + +#errors +7: missing document type declaration +7: unexpected body element end tag +#document +| +| +| + +#data + +#errors +7: missing document type declaration +#document +| +| +| + +#data +
+#errors +3: missing document type declaration +14: required tr element start tag implied by unexpected td element start tag +25: unexpected td element end tag implied other end tags +26: mismatched body element end tag (premature end of file?) +#document +| +| +| +| +| +| +| +|

+#errors +9: missing document type declaration +9: unexpected strong element end tag +13: unexpected b element end tag +18: unexpected em element end tag +22: unexpected i element end tag +26: unexpected u element end tag +35: unexpected strike element end tag +39: unexpected s element end tag +47: unexpected blink element end tag +52: unexpected tt element end tag +58: unexpected pre element end tag +64: unexpected big element end tag +72: unexpected small element end tag +79: unexpected font element end tag +88: unexpected select element end tag +93: unexpected h1 element end tag +98: unexpected h2 element end tag +103: unexpected h3 element end tag +108: unexpected h4 element end tag +113: unexpected h5 element end tag +118: unexpected h6 element end tag +125: unexpected body element end tag +130: unexpected br element end tag +134: unexpected a element end tag +140: unexpected img element end tag +148: unexpected title element end tag +155: unexpected span element end tag +163: unexpected style element end tag +172: unexpected script element end tag +180: unexpected table element end tag +185: unexpected th element end tag +190: unexpected td element end tag +195: unexpected tr element end tag +203: unexpected frame element end tag +210: unexpected area element end tag +217: unexpected link element end tag +225: unexpected param element end tag +230: unexpected hr element end tag +238: unexpected input element end tag +244: unexpected col element end tag +251: unexpected base element end tag +258: unexpected meta element end tag +269: unexpected basefont element end tag +279: unexpected bgsound element end tag +287: unexpected embed element end tag +296: unexpected spacer element end tag +300: unexpected p element end tag +305: unexpected dd element end tag +310: unexpected dt element end tag +320: unexpected caption element end tag +331: unexpected colgroup element end tag +339: unexpected tbody element end tag +347: unexpected tfoot element end tag +355: unexpected thead element end tag +365: unexpected address element end tag +378: unexpected blockquote element end tag +387: unexpected center element end tag +393: unexpected dir element end tag +399: unexpected div element end tag +404: unexpected dl element end tag +415: unexpected fieldset element end tag +425: unexpected listing element end tag +432: unexpected menu element end tag +437: unexpected ol element end tag +442: unexpected ul element end tag +447: unexpected li element end tag +454: unexpected nobr element end tag +460: unexpected wbr element end tag +467: unexpected form element end tag +476: unexpected button element end tag +486: unexpected marquee element end tag +495: unexpected object element end tag +513: unexpected node at end of document +513: unexpected node after body element end tag +513: unexpected frameset element end tag +520: unexpected head element end tag +529: mismatched special end tag iframe +537: unexpected image end tag (that element has no end tag, ever) +547: unexpected isindex end tag (that element has no end tag, ever) +557: mismatched special end tag noembed +568: mismatched special end tag noframes +579: mismatched special end tag noscript +590: unexpected optgroup element end tag +599: unexpected option element end tag +611: unexpected plaintext element end tag +622: mismatched special end tag textarea +#document +| +| +| + +#data +
+| + +#data +
X +#errors +3: missing document type declaration +14: required tr element start tag implied by unexpected td element start tag +18: mismatched b element end tag (no matching start tag) +29: unexpected td element end tag implied other end tags +31: mismatched body element end tag (premature end of file?) +#document +| +| +| +| +| +| +| +|
+| +| "X" + +#data +

Hello

World +#errors +4: missing document type declaration +13: h2 element start tag implying h1 element end tag +19: mismatched body element end tag (premature end of file?) +#document +| +| +| +|

+| "Hello" +|

+| "World" + +#data +

XYZ

+#errors +3: missing document type declaration +10: a element start tag implying a element end tag +10: mismatched a element end tag (misnested tags) +24: mismatched a element end tag (no matching start tag) +#document +| +| +| +| +|

+| +| "X" +| +| "Y" +| "Z" + +#data + +#errors +3: missing document type declaration +15: mismatched b element end tag (no matching start tag) +#document +| +| +| +| +|


+#errors +7: missing document type declaration +20: unexpected node in table context +20: mismatched strong element end tag (no matching start tag) +24: unexpected node in table context +24: mismatched b element end tag (no matching start tag) +29: unexpected node in table context +29: mismatched em element end tag (no matching start tag) +33: unexpected node in table context +33: mismatched i element end tag (no matching start tag) +37: unexpected node in table context +37: mismatched u element end tag (no matching start tag) +46: unexpected node in table context +46: mismatched strike element end tag (no matching start tag) +50: unexpected node in table context +50: mismatched s element end tag (no matching start tag) +58: unexpected node in table context +58: unexpected blink element end tag +63: unexpected node in table context +63: mismatched tt element end tag (no matching start tag) +69: unexpected node in table context +69: mismatched pre element end tag +75: unexpected node in table context +75: mismatched big element end tag (no matching start tag) +83: unexpected node in table context +83: mismatched small element end tag (no matching start tag) +90: unexpected node in table context +90: mismatched font element end tag (no matching start tag) +99: unexpected node in table context +99: mismatched special end tag select +104: unexpected node in table context +104: mismatched h1 element end tag +109: unexpected node in table context +109: mismatched h2 element end tag +114: unexpected node in table context +114: mismatched h3 element end tag +119: unexpected node in table context +119: mismatched h4 element end tag +124: unexpected node in table context +124: mismatched h5 element end tag +129: unexpected node in table context +129: mismatched h6 element end tag +136: unexpected body element end tag +141: unexpected node in table context +141: unexpected br end tag (that element has no end tag, ever) +145: unexpected node in table context +145: mismatched a element end tag (no matching start tag) +151: unexpected node in table context +151: unexpected img end tag (that element has no end tag, ever) +159: unexpected node in table context +159: unexpected title element end tag +166: unexpected node in table context +166: unexpected span element end tag +174: unexpected node in table context +174: unexpected style element end tag +183: unexpected node in table context +183: unexpected script element end tag +196: unexpected th element end tag +201: unexpected td element end tag +206: unexpected tr element end tag +214: unexpected frame element end tag +221: unexpected area end tag (that element has no end tag, ever) +228: unexpected link element end tag +236: unexpected param end tag (that element has no end tag, ever) +241: unexpected hr end tag (that element has no end tag, ever) +249: unexpected input end tag (that element has no end tag, ever) +255: unexpected col element end tag +262: unexpected base element end tag +269: unexpected meta element end tag +280: unexpected basefont end tag (that element has no end tag, ever) +290: unexpected bgsound end tag (that element has no end tag, ever) +298: unexpected embed end tag (that element has no end tag, ever) +307: unexpected spacer end tag (that element has no end tag, ever) +311: mismatched p element end tag +316: mismatched dd element end tag +321: mismatched dt element end tag +331: unexpected caption element end tag +342: unexpected colgroup element end tag +350: unexpected tbody element end tag +358: unexpected tfoot element end tag +366: unexpected thead element end tag +376: mismatched address element end tag +389: mismatched blockquote element end tag +398: mismatched center element end tag +404: mismatched dir element end tag +410: mismatched div element end tag +415: mismatched dl element end tag +426: mismatched fieldset element end tag +436: mismatched listing element end tag +443: mismatched menu element end tag +448: mismatched ol element end tag +453: mismatched ul element end tag +458: mismatched li element end tag +465: mismatched nobr element end tag (no matching start tag) +471: unexpected wbr end tag (that element has no end tag, ever) +478: mismatched form element end tag +524: unexpected node at end of document +524: unexpected node after body element end tag +524: unexpected frameset element end tag +531: unexpected head element end tag +540: mismatched special end tag iframe +548: unexpected image end tag (that element has no end tag, ever) +558: unexpected isindex end tag (that element has no end tag, ever) +568: mismatched special end tag noembed +579: mismatched special end tag noframes +590: mismatched special end tag noscript +601: unexpected optgroup element end tag +610: unexpected option element end tag +622: unexpected plaintext element end tag +633: mismatched special end tag textarea +#document +| +| +| +| +| +| diff --git a/mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat2.txt b/mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat2.txt new file mode 100644 index 00000000000..b1b5bc7d1da --- /dev/null +++ b/mozilla/parser/htmlparser/tests/mochitest/html5lib_tree_dat2.txt @@ -0,0 +1,768 @@ +#data +Test +#errors +#document +| +| +| +| +| "Test" + +#data +