From 246785d7de14e3ef70b9e971970c873cf7d8ff72 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Fri, 21 Oct 2016 15:51:27 +0200 Subject: [PATCH] Conformance checker tests for
and
in
Tests for https://github.com/whatwg/html/pull/1945 --- html/elements/dl/article-in-dt-novalid.html | 4 + html/elements/dl/aside-in-dt-novalid.html | 4 + html/elements/dl/dd-in-template-novalid.html | 4 + html/elements/dl/div-contains-dl-novalid.html | 4 + .../dl/div-contains-text-novalid.html | 4 + .../dl/div-splitting-groups-2-novalid.html | 4 + .../dl/div-splitting-groups-3-novalid.html | 4 + .../dl/div-splitting-groups-novalid.html | 4 + html/elements/dl/dl-contains-dl-novalid.html | 4 + .../dl/dl-contains-text-2-novalid.html | 4 + .../elements/dl/dl-contains-text-novalid.html | 4 + html/elements/dl/dl-in-p-novalid.html | 4 + html/elements/dl/dl-isvalid.html | 35 +++++++ html/elements/dl/dt-in-template-novalid.html | 4 + html/elements/dl/empty-div-2-novalid.html | 4 + html/elements/dl/empty-div-novalid.html | 4 + html/elements/dl/first-dd-novalid.html | 4 + html/elements/dl/footer-in-dt-novalid.html | 4 + html/elements/dl/h1-in-dt-novalid.html | 4 + html/elements/dl/h2-in-dt-novalid.html | 4 + html/elements/dl/h3-in-dt-novalid.html | 4 + html/elements/dl/h4-in-dt-novalid.html | 4 + html/elements/dl/h5-in-dt-novalid.html | 4 + html/elements/dl/h6-in-dt-novalid.html | 4 + html/elements/dl/header-in-dt-novalid.html | 4 + html/elements/dl/hgroup-in-dt-novalid.html | 4 + html/elements/dl/last-dt-novalid.html | 4 + html/elements/dl/mixed-div-dt-dd-novalid.html | 4 + html/elements/dl/mixed-dt-dd-div-novalid.html | 4 + html/elements/dl/model-isvalid.html | 55 ----------- html/elements/dl/model-novalid.html | 75 -------------- html/elements/dl/nav-in-dt-novalid.html | 4 + html/elements/dl/nested-divs-novalid.html | 4 + html/elements/dl/only-dd-novalid.html | 4 + html/elements/dl/only-dt-novalid.html | 4 + html/elements/dl/section-in-dt-novalid.html | 4 + tools/dl.py | 99 +++++++++++++++++++ 37 files changed, 266 insertions(+), 130 deletions(-) create mode 100644 html/elements/dl/article-in-dt-novalid.html create mode 100644 html/elements/dl/aside-in-dt-novalid.html create mode 100644 html/elements/dl/dd-in-template-novalid.html create mode 100644 html/elements/dl/div-contains-dl-novalid.html create mode 100644 html/elements/dl/div-contains-text-novalid.html create mode 100644 html/elements/dl/div-splitting-groups-2-novalid.html create mode 100644 html/elements/dl/div-splitting-groups-3-novalid.html create mode 100644 html/elements/dl/div-splitting-groups-novalid.html create mode 100644 html/elements/dl/dl-contains-dl-novalid.html create mode 100644 html/elements/dl/dl-contains-text-2-novalid.html create mode 100644 html/elements/dl/dl-contains-text-novalid.html create mode 100644 html/elements/dl/dl-in-p-novalid.html create mode 100644 html/elements/dl/dl-isvalid.html create mode 100644 html/elements/dl/dt-in-template-novalid.html create mode 100644 html/elements/dl/empty-div-2-novalid.html create mode 100644 html/elements/dl/empty-div-novalid.html create mode 100644 html/elements/dl/first-dd-novalid.html create mode 100644 html/elements/dl/footer-in-dt-novalid.html create mode 100644 html/elements/dl/h1-in-dt-novalid.html create mode 100644 html/elements/dl/h2-in-dt-novalid.html create mode 100644 html/elements/dl/h3-in-dt-novalid.html create mode 100644 html/elements/dl/h4-in-dt-novalid.html create mode 100644 html/elements/dl/h5-in-dt-novalid.html create mode 100644 html/elements/dl/h6-in-dt-novalid.html create mode 100644 html/elements/dl/header-in-dt-novalid.html create mode 100644 html/elements/dl/hgroup-in-dt-novalid.html create mode 100644 html/elements/dl/last-dt-novalid.html create mode 100644 html/elements/dl/mixed-div-dt-dd-novalid.html create mode 100644 html/elements/dl/mixed-dt-dd-div-novalid.html delete mode 100644 html/elements/dl/model-isvalid.html delete mode 100644 html/elements/dl/model-novalid.html create mode 100644 html/elements/dl/nav-in-dt-novalid.html create mode 100644 html/elements/dl/nested-divs-novalid.html create mode 100644 html/elements/dl/only-dd-novalid.html create mode 100644 html/elements/dl/only-dt-novalid.html create mode 100644 html/elements/dl/section-in-dt-novalid.html create mode 100644 tools/dl.py diff --git a/html/elements/dl/article-in-dt-novalid.html b/html/elements/dl/article-in-dt-novalid.html new file mode 100644 index 0000000000..1c2fde9cd6 --- /dev/null +++ b/html/elements/dl/article-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid article-in-dt +

text

text
\ No newline at end of file diff --git a/html/elements/dl/aside-in-dt-novalid.html b/html/elements/dl/aside-in-dt-novalid.html new file mode 100644 index 0000000000..b08c05b7f3 --- /dev/null +++ b/html/elements/dl/aside-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid aside-in-dt +
text
\ No newline at end of file diff --git a/html/elements/dl/dd-in-template-novalid.html b/html/elements/dl/dd-in-template-novalid.html new file mode 100644 index 0000000000..3c4ddbdae1 --- /dev/null +++ b/html/elements/dl/dd-in-template-novalid.html @@ -0,0 +1,4 @@ + + +invalid dd-in-template +
1
\ No newline at end of file diff --git a/html/elements/dl/div-contains-dl-novalid.html b/html/elements/dl/div-contains-dl-novalid.html new file mode 100644 index 0000000000..d94258abc0 --- /dev/null +++ b/html/elements/dl/div-contains-dl-novalid.html @@ -0,0 +1,4 @@ + + +invalid div-contains-dl +
2
b
\ No newline at end of file diff --git a/html/elements/dl/div-contains-text-novalid.html b/html/elements/dl/div-contains-text-novalid.html new file mode 100644 index 0000000000..acb91569e1 --- /dev/null +++ b/html/elements/dl/div-contains-text-novalid.html @@ -0,0 +1,4 @@ + + +invalid div-contains-text +
x
2
b
\ No newline at end of file diff --git a/html/elements/dl/div-splitting-groups-2-novalid.html b/html/elements/dl/div-splitting-groups-2-novalid.html new file mode 100644 index 0000000000..f490502118 --- /dev/null +++ b/html/elements/dl/div-splitting-groups-2-novalid.html @@ -0,0 +1,4 @@ + + +invalid div-splitting-groups-2 +
1
a
b
\ No newline at end of file diff --git a/html/elements/dl/div-splitting-groups-3-novalid.html b/html/elements/dl/div-splitting-groups-3-novalid.html new file mode 100644 index 0000000000..aa2e4e1605 --- /dev/null +++ b/html/elements/dl/div-splitting-groups-3-novalid.html @@ -0,0 +1,4 @@ + + +invalid div-splitting-groups-3 +
1
2
b
\ No newline at end of file diff --git a/html/elements/dl/div-splitting-groups-novalid.html b/html/elements/dl/div-splitting-groups-novalid.html new file mode 100644 index 0000000000..5164e2f268 --- /dev/null +++ b/html/elements/dl/div-splitting-groups-novalid.html @@ -0,0 +1,4 @@ + + +invalid div-splitting-groups +
1
a
\ No newline at end of file diff --git a/html/elements/dl/dl-contains-dl-novalid.html b/html/elements/dl/dl-contains-dl-novalid.html new file mode 100644 index 0000000000..d893e9beac --- /dev/null +++ b/html/elements/dl/dl-contains-dl-novalid.html @@ -0,0 +1,4 @@ + + +invalid dl-contains-dl +
1
a
\ No newline at end of file diff --git a/html/elements/dl/dl-contains-text-2-novalid.html b/html/elements/dl/dl-contains-text-2-novalid.html new file mode 100644 index 0000000000..84847551aa --- /dev/null +++ b/html/elements/dl/dl-contains-text-2-novalid.html @@ -0,0 +1,4 @@ + + +invalid dl-contains-text-2 +
1
a
x
\ No newline at end of file diff --git a/html/elements/dl/dl-contains-text-novalid.html b/html/elements/dl/dl-contains-text-novalid.html new file mode 100644 index 0000000000..2113207edf --- /dev/null +++ b/html/elements/dl/dl-contains-text-novalid.html @@ -0,0 +1,4 @@ + + +invalid dl-contains-text +
1
x
\ No newline at end of file diff --git a/html/elements/dl/dl-in-p-novalid.html b/html/elements/dl/dl-in-p-novalid.html new file mode 100644 index 0000000000..b105341840 --- /dev/null +++ b/html/elements/dl/dl-in-p-novalid.html @@ -0,0 +1,4 @@ + + +invalid dl-in-p +

text
text

\ No newline at end of file diff --git a/html/elements/dl/dl-isvalid.html b/html/elements/dl/dl-isvalid.html new file mode 100644 index 0000000000..e15907c665 --- /dev/null +++ b/html/elements/dl/dl-isvalid.html @@ -0,0 +1,35 @@ + + +valid dl + + +
text

text

+
text

text

+
1
a
+
text

text

+
1
a
+
1
2
a
+
+
1
a
+
text
text
+
+
1
a
+
1
a
2
a
b
3
4
5
a
+
text
text
+
1
a
b
+
1
a
+
+
1
a
2
a
b
3
4
5
a
+
1
a
+
1
a
+
text
text
+
text

text

+
text
+

1

1

a
+
text

text

+
text
text
+
text

text

+
text
text
+
text
+
text

text

+
1
a
diff --git a/html/elements/dl/dt-in-template-novalid.html b/html/elements/dl/dt-in-template-novalid.html new file mode 100644 index 0000000000..da0526906d --- /dev/null +++ b/html/elements/dl/dt-in-template-novalid.html @@ -0,0 +1,4 @@ + + +invalid dt-in-template +
a
\ No newline at end of file diff --git a/html/elements/dl/empty-div-2-novalid.html b/html/elements/dl/empty-div-2-novalid.html new file mode 100644 index 0000000000..54d9e68fa1 --- /dev/null +++ b/html/elements/dl/empty-div-2-novalid.html @@ -0,0 +1,4 @@ + + +invalid empty-div-2 +
2
b
\ No newline at end of file diff --git a/html/elements/dl/empty-div-novalid.html b/html/elements/dl/empty-div-novalid.html new file mode 100644 index 0000000000..14211f3b01 --- /dev/null +++ b/html/elements/dl/empty-div-novalid.html @@ -0,0 +1,4 @@ + + +invalid empty-div +
\ No newline at end of file diff --git a/html/elements/dl/first-dd-novalid.html b/html/elements/dl/first-dd-novalid.html new file mode 100644 index 0000000000..98604399ac --- /dev/null +++ b/html/elements/dl/first-dd-novalid.html @@ -0,0 +1,4 @@ + + +invalid first-dd +
a
2
b
\ No newline at end of file diff --git a/html/elements/dl/footer-in-dt-novalid.html b/html/elements/dl/footer-in-dt-novalid.html new file mode 100644 index 0000000000..a24cc0b18d --- /dev/null +++ b/html/elements/dl/footer-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid footer-in-dt +
text
text
\ No newline at end of file diff --git a/html/elements/dl/h1-in-dt-novalid.html b/html/elements/dl/h1-in-dt-novalid.html new file mode 100644 index 0000000000..3e8729cf6e --- /dev/null +++ b/html/elements/dl/h1-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid h1-in-dt +

text

text
\ No newline at end of file diff --git a/html/elements/dl/h2-in-dt-novalid.html b/html/elements/dl/h2-in-dt-novalid.html new file mode 100644 index 0000000000..32d5088005 --- /dev/null +++ b/html/elements/dl/h2-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid h2-in-dt +

text

text
\ No newline at end of file diff --git a/html/elements/dl/h3-in-dt-novalid.html b/html/elements/dl/h3-in-dt-novalid.html new file mode 100644 index 0000000000..ec22819c11 --- /dev/null +++ b/html/elements/dl/h3-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid h3-in-dt +

text

text
\ No newline at end of file diff --git a/html/elements/dl/h4-in-dt-novalid.html b/html/elements/dl/h4-in-dt-novalid.html new file mode 100644 index 0000000000..5b621b1deb --- /dev/null +++ b/html/elements/dl/h4-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid h4-in-dt +

text

text
\ No newline at end of file diff --git a/html/elements/dl/h5-in-dt-novalid.html b/html/elements/dl/h5-in-dt-novalid.html new file mode 100644 index 0000000000..21c603a9e3 --- /dev/null +++ b/html/elements/dl/h5-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid h5-in-dt +
text
text
\ No newline at end of file diff --git a/html/elements/dl/h6-in-dt-novalid.html b/html/elements/dl/h6-in-dt-novalid.html new file mode 100644 index 0000000000..1c97cced77 --- /dev/null +++ b/html/elements/dl/h6-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid h6-in-dt +
text
text
\ No newline at end of file diff --git a/html/elements/dl/header-in-dt-novalid.html b/html/elements/dl/header-in-dt-novalid.html new file mode 100644 index 0000000000..2bc589b800 --- /dev/null +++ b/html/elements/dl/header-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid header-in-dt +
text
text
\ No newline at end of file diff --git a/html/elements/dl/hgroup-in-dt-novalid.html b/html/elements/dl/hgroup-in-dt-novalid.html new file mode 100644 index 0000000000..07165851ad --- /dev/null +++ b/html/elements/dl/hgroup-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid hgroup-in-dt +

text

text
\ No newline at end of file diff --git a/html/elements/dl/last-dt-novalid.html b/html/elements/dl/last-dt-novalid.html new file mode 100644 index 0000000000..83e2fec8a2 --- /dev/null +++ b/html/elements/dl/last-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid last-dt +
1
a
2
\ No newline at end of file diff --git a/html/elements/dl/mixed-div-dt-dd-novalid.html b/html/elements/dl/mixed-div-dt-dd-novalid.html new file mode 100644 index 0000000000..c02808addb --- /dev/null +++ b/html/elements/dl/mixed-div-dt-dd-novalid.html @@ -0,0 +1,4 @@ + + +invalid mixed-div-dt-dd +
1
a
2
b
\ No newline at end of file diff --git a/html/elements/dl/mixed-dt-dd-div-novalid.html b/html/elements/dl/mixed-dt-dd-div-novalid.html new file mode 100644 index 0000000000..5ed4aedd15 --- /dev/null +++ b/html/elements/dl/mixed-dt-dd-div-novalid.html @@ -0,0 +1,4 @@ + + +invalid mixed-dt-dd-div +
1
a
2
b
\ No newline at end of file diff --git a/html/elements/dl/model-isvalid.html b/html/elements/dl/model-isvalid.html deleted file mode 100644 index c7a5de96c0..0000000000 --- a/html/elements/dl/model-isvalid.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Definition List: <dl> <dt> <dd> - - - -
-
text
-
text
-
- - -
-
-
-
-
- - -
-
text
-
more text
-
text
-
more text
-
more text
-
text
-
text
-
text
-
more text
-
- - -
-
some text
-
more
text
-
- - -
-
some text
-
-

more

-

text

-
-
- - -
-
some text
-
more text
-
- - diff --git a/html/elements/dl/model-novalid.html b/html/elements/dl/model-novalid.html deleted file mode 100644 index 0eacdf8dbf..0000000000 --- a/html/elements/dl/model-novalid.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Definition List: <dl> <dt> <dd> - - - -
-
text
-
text
-
- - -

paragraph -

-
text
-
text
-
-

- - -
-
-
-
-
- - -
-
text
-
more text
-
text
-
more text
-
more text
-
text
-
text
-
text
-
more text
-
- - -
-
some text
-
more
text
-
-

paragraph -

-
some text
-
more
text
-
-

- - -
-
some text
-
-

more

-

text

-
-
- - -
-
some text
-
more text
-
-

paragraph -

-
some text
-
more text
-
-

- - diff --git a/html/elements/dl/nav-in-dt-novalid.html b/html/elements/dl/nav-in-dt-novalid.html new file mode 100644 index 0000000000..64e137d515 --- /dev/null +++ b/html/elements/dl/nav-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid nav-in-dt +
text
\ No newline at end of file diff --git a/html/elements/dl/nested-divs-novalid.html b/html/elements/dl/nested-divs-novalid.html new file mode 100644 index 0000000000..ef3446d3a1 --- /dev/null +++ b/html/elements/dl/nested-divs-novalid.html @@ -0,0 +1,4 @@ + + +invalid nested-divs +
1
a
\ No newline at end of file diff --git a/html/elements/dl/only-dd-novalid.html b/html/elements/dl/only-dd-novalid.html new file mode 100644 index 0000000000..017795cc09 --- /dev/null +++ b/html/elements/dl/only-dd-novalid.html @@ -0,0 +1,4 @@ + + +invalid only-dd +
a
\ No newline at end of file diff --git a/html/elements/dl/only-dt-novalid.html b/html/elements/dl/only-dt-novalid.html new file mode 100644 index 0000000000..7445214efe --- /dev/null +++ b/html/elements/dl/only-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid only-dt +
1
\ No newline at end of file diff --git a/html/elements/dl/section-in-dt-novalid.html b/html/elements/dl/section-in-dt-novalid.html new file mode 100644 index 0000000000..846ebbe35a --- /dev/null +++ b/html/elements/dl/section-in-dt-novalid.html @@ -0,0 +1,4 @@ + + +invalid section-in-dt +

text

text
\ No newline at end of file diff --git a/tools/dl.py b/tools/dl.py new file mode 100644 index 0000000000..44684a28d1 --- /dev/null +++ b/tools/dl.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +import os +ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +template = """ + +""" + +errors = { + "dl-in-p": "

text
text

", + "header-in-dt": "
text
text
", + "footer-in-dt": "
text
text
", + "article-in-dt": "

text

text
", + "aside-in-dt": "
text
", + "nav-in-dt": "
text
", + "section-in-dt": "

text

text
", + "h1-in-dt": "

text

text
", + "h2-in-dt": "

text

text
", + "h3-in-dt": "

text

text
", + "h4-in-dt": "

text

text
", + "h5-in-dt": "
text
text
", + "h6-in-dt": "
text
text
", + "hgroup-in-dt": "

text

text
", + "only-dt": "
1
", + "only-dd": "
a
", + "first-dd": "
a
2
b
", + "last-dt": "
1
a
2
", + "dd-in-template": "
1
", + "dt-in-template": "
a
", + "dl-contains-text": "
1
x
", + "dl-contains-text-2": "
1
a
x
", + "dl-contains-dl": "
1
a
", + # div + "empty-div": "
", + "empty-div-2": "
2
b
", + "mixed-dt-dd-div": "
1
a
2
b
", + "mixed-div-dt-dd": "
1
a
2
b
", + "nested-divs": "
1
a
", + "div-splitting-groups": "
1
a
", + "div-splitting-groups-2": "
1
a
b
", + "div-splitting-groups-3": "
1
2
b
", + "div-contains-text": "
x
2
b
", + "div-contains-dl": "
2
b
", +} + +non_errors_in_head = { + "parent-template-in-head": "", +} + +non_errors = { + "basic": "
text
text
", + "empty": "
", + "empty-dt-dd": "
", + "multiple-groups": "
1
a
2
a
b
3
4
5
a
", + "header-in-dd": "
text
text
", + "footer-in-dd": "
text
text
", + "article-in-dd": "
text

text

", + "aside-in-dd": "
text
", + "nav-in-dd": "
text
", + "section-in-dd": "
text

text

", + "h1-in-dd": "
text

text

", + "h2-in-dd": "
text

text

", + "h3-in-dd": "
text

text

", + "h4-in-dd": "
text

text

", + "h5-in-dd": "
text
text
", + "h6-in-dd": "
text
text
", + "hgroup-in-dd": "
text

text

", + "p-in-dt": "

1

1

a
", + "dl-in-dt": "
1
a
b
", + "dl-in-dd": "
1
2
a
", + "interactive": "
1
a
", + "script": "
", + "dt-script-dd": "
1
a
", + "dt-template-dd": "
1
a
", + # div + "div-basic": "
1
a
", + "div-script": "
1
a
", + "div-script-2": "
1
a
", + "div-template": "
1
a
", + "div-template-2": "
1
a
", + "div-multiple-groups": "
1
a
2
a
b
3
4
5
a
", +} + +for key in errors.keys(): + template_error = template + template_error += 'invalid %s\n' % key + template_error += errors[key] + file = open(os.path.join(ccdir, "html/elements/dl/%s-novalid.html" % key), 'wb') + file.write(template_error) + file.close() + +file = open(os.path.join(ccdir, "html/elements/dl/dl-isvalid.html"), 'wb') +file.write(template + 'valid dl\n') +for key in non_errors_in_head.keys(): + file.write('%s \n' % (non_errors_in_head[key], key)) +file.write('\n') +for key in non_errors.keys(): + file.write('%s \n' % (non_errors[key], key)) +file.close() +# vim: ts=4:sw=4