From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../tests/conformance-checkers/tools/dl.py | 99 +++++ .../conformance-checkers/tools/ins-del-datetime.py | 175 +++++++++ .../tests/conformance-checkers/tools/picture.py | 366 ++++++++++++++++++ .../tests/conformance-checkers/tools/url.py | 425 +++++++++++++++++++++ 4 files changed, 1065 insertions(+) create mode 100644 testing/web-platform/tests/conformance-checkers/tools/dl.py create mode 100644 testing/web-platform/tests/conformance-checkers/tools/ins-del-datetime.py create mode 100644 testing/web-platform/tests/conformance-checkers/tools/picture.py create mode 100644 testing/web-platform/tests/conformance-checkers/tools/url.py (limited to 'testing/web-platform/tests/conformance-checkers/tools') diff --git a/testing/web-platform/tests/conformance-checkers/tools/dl.py b/testing/web-platform/tests/conformance-checkers/tools/dl.py new file mode 100644 index 0000000000..b0e14f18c0 --- /dev/null +++ b/testing/web-platform/tests/conformance-checkers/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
", + "div-multiple-groups": "
1
a
2
a
b
3
4
5
a
", +} + +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
", + "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), 'w') + file.write(template_error) + file.close() + +file = open(os.path.join(ccdir, "html/elements/dl/dl-isvalid.html"), 'w') +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 diff --git a/testing/web-platform/tests/conformance-checkers/tools/ins-del-datetime.py b/testing/web-platform/tests/conformance-checkers/tools/ins-del-datetime.py new file mode 100644 index 0000000000..d169a2fe0f --- /dev/null +++ b/testing/web-platform/tests/conformance-checkers/tools/ins-del-datetime.py @@ -0,0 +1,175 @@ +# -*- coding: utf-8 -*- +import os +ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +template = """ + +""" +errors = { + "date-year-0000": "0000-12-09", + "date-month-00": "2002-00-15", + "date-month-13": "2002-13-15", + "date-0005-02-29": "0005-02-29", + "date-1969-02-29": "1969-02-29", + "date-1900-02-29": "1900-02-29", + "date-2100-02-29": "2100-02-29", + "date-2200-02-29": "2200-02-29", + "date-2014-02-29": "2014-02-29", + "date-day-04-31": "2002-04-31", + "date-day-06-31": "2002-06-31", + "date-day-09-31": "2002-09-31", + "date-day-11-31": "2002-11-31", + "date-day-01-32": "2002-01-32", + "date-day-03-32": "2002-03-32", + "date-day-05-32": "2002-05-32", + "date-day-07-32": "2002-07-32", + "date-day-08-32": "2002-08-32", + "date-day-10-32": "2002-10-32", + "date-day-12-32": "2002-12-32", + "date-iso8601-YYYYMMDD-no-hyphen": "20020929", + "date-leading-whitespace": " 2002-09-29", + "date-trailing-whitespace": "2002-09-29 ", + "date-month-one-digit": "2002-9-29", + "date-month-three-digits": "2002-011-29", + "date-year-three-digits": "782-09-29", + "date-day-one-digit": "2002-09-9", + "date-day-three-digits": "2002-11-009", + "date-day-missing-separator": "2014-0220", + "date-month-missing-separator": "201402-20", + "date-non-ascii-digit": "2002-09-29", + "date-trailing-U+0000": "2002-09-29�", + "date-trailing-pile-of-poo": "2002-09-29💩", + "date-wrong-day-separator": "2014-02:20", + "date-wrong-month-separator": "2014:02-20", + "date-year-negative": "-2002-09-29", + "date-leading-bom": "2002-09-29", + "global-date-and-time-60-minutes": "2011-11-12T00:60:00+08:00", + "global-date-and-time-60-seconds": "2011-11-12T00:00:60+08:00", + "global-date-and-time-2400": "2011-11-12T24:00:00+08:00", + "global-date-and-time-space-before-timezone": "2011-11-12T06:54:39 08:00", + "global-date-and-time-hour-one-digit": "2011-11-12T6:54:39-08:00", + "global-date-and-time-hour-three-digits": "2011-11-12T016:54:39-08:00", + "global-date-and-time-minutes-one-digit": "2011-11-12T16:4:39-08:00", + "global-date-and-time-minutes-three-digits": "2011-11-12T16:354:39-08:00", + "global-date-and-time-seconds-one-digit": "2011-11-12T16:54:9-08:00", + "global-date-and-time-seconds-three-digits": "2011-11-12T16:54:039-08:00", + "global-date-and-time-timezone-with-seconds": "2011-11-12T06:54:39-08:00:00", + "global-date-and-time-timezone-60-minutes": "2011-11-12T06:54:39-08:60", + "global-date-and-time-timezone-one-digit-hour": "2011-11-12T06:54:39-5:00", + "global-date-and-time-timezone-one-digit-minute": "2011-11-12T06:54:39-05:0", + "global-date-and-time-timezone-three-digit-hour": "2011-11-12T06:54:39-005:00", + "global-date-and-time-timezone-three-digit-minute": "2011-11-12T06:54:39-05:000", + "global-date-and-time-nbsp": "2011-11-12 14:54Z", + "global-date-and-time-missing-minutes-separator": "2011-11-12T1454Z", + "global-date-and-time-missing-seconds-separator": "2011-11-12T14:5439Z", + "global-date-and-time-wrong-minutes-separator": "2011-11-12T14-54Z", + "global-date-and-time-wrong-seconds-separator": "2011-11-12T14:54-39Z", + "global-date-and-time-lowercase-z": "2011-11-12T14:54z", + "global-date-and-time-with-both-T-and-space": "2011-11-12T 14:54Z", + "global-date-and-time-zero-digit-fraction": "2011-11-12T06:54:39.-08:00", + "global-date-and-time-four-digit-fraction": "2011-11-12T06:54:39.9291-08:00", + "global-date-and-time-bad-fraction-separator": "2011-11-12T14:54:39,929+0000", + "global-date-and-time-timezone-non-T-character": "2011-11-12+14:54Z", + "global-date-and-time-timezone-lowercase-t": "2011-11-12t14:54Z", + "global-date-and-time-timezone-multiple-spaces": "2011-11-12 14:54Z", + "global-date-and-time-timezone-offset-space-start": "2011-11-12T06:54:39.929 08:00", + "global-date-and-time-timezone-offset-colon-start": "2011-11-12T06:54:39.929:08:00", + "global-date-and-time-timezone-plus-2400": "2011-11-12T06:54:39-24:00", + "global-date-and-time-timezone-minus-2400": "2011-11-12T06:54:39-24:00", + "global-date-and-time-timezone-iso8601-two-digit": "2011-11-12T06:54:39-08", + "global-date-and-time-iso8601-hhmmss-no-colon": "2011-11-12T145439Z", + "global-date-and-time-iso8601-hhmm-no-colon": "2011-11-12T1454Z", + "global-date-and-time-iso8601-hh": "2011-11-12T14Z", + "year": "2006", + "yearless-date": "07-15", + "month": "2011-11", + "week": "2011-W46", + "time": "14:54:39", + "local-date-and-time": "2011-11-12T14:54", + "duration-P-form": "PT4H18M3S", + "duration-time-component": "4h 18m 3s", +} + +warnings = { + "global-date-and-time-timezone-plus-1500": "2011-11-12T00:00:00+1500", + "global-date-and-time-timezone-minus-1300": "2011-11-12T00:00:00-1300", + "global-date-and-time-timezone-minutes-15": "2011-11-12T00:00:00+08:15", + "date-0214-09-29": "0214-09-29", + "date-20014-09-29": "20014-09-29", + "date-0004-02-29": "0004-02-29", + "date-year-five-digits": "12014-09-29", +} + +non_errors = { + "date": "2002-09-29", + "date-2000-02-29": "2000-02-29", + "date-2400-02-29": "2400-02-29", + "date-1968-02-29": "1968-02-29", + "date-1900-02-28": "1900-02-28", + "date-2100-02-28": "2100-02-28", + "date-2200-02-28": "2200-02-28", + "date-2014-02-28": "2014-02-28", + "date-day-01-31": "2002-01-31", + "date-day-03-31": "2002-03-31", + "date-day-05-31": "2002-05-31", + "date-day-07-31": "2002-07-31", + "date-day-08-31": "2002-08-31", + "date-day-10-31": "2002-10-31", + "date-day-12-31": "2002-12-31", + "date-day-04-30": "2002-04-30", + "date-day-06-30": "2002-06-30", + "date-day-09-30": "2002-09-30", + "date-day-11-30": "2002-11-30", + "global-date-and-time-no-seconds": "2011-11-12T14:54Z", + "global-date-and-time-with-seconds": "2011-11-12T14:54:39+0000", + "global-date-and-time-with-one-digit-fraction": "2011-11-12T06:54:39.9-08:00", + "global-date-and-time-with-two-digit-fraction": "2011-11-12T06:54:39.92+07:00", + "global-date-and-time-with-three-digit-fraction": "2011-11-12T06:54:39.929-06:00", + "global-date-and-time-space": "2011-11-12 14:54Z", + "global-date-and-time-timezone": "2011-11-12T06:54:39+0900", + "global-date-and-time-timezone-30": "2011-11-12T06:54:39-0830", + "global-date-and-time-timezone-45": "2011-11-12T06:54:39-0845", + "global-date-and-time-timezone-with-colon": "2011-11-12T06:54:39-08:00", + "global-date-and-time-timezone-without-colon": "2011-11-12T06:54:39-0800", +} + +for key in errors.keys(): + error = errors[key] + template_ins = template + template_del = template + template_ins += '%s\n' % key + template_del += '%s\n' % key + template_ins += '' % errors[key] + template_del += '' % errors[key] + ins_file = open(os.path.join(ccdir, "html/elements/ins/%s-novalid.html" % key), 'w') + ins_file.write(template_ins) + ins_file.close() + del_file = open(os.path.join(ccdir, "html/elements/del/%s-novalid.html" % key), 'w') + del_file.write(template_del) + del_file.close() + +for key in warnings.keys(): + non_error = warnings[key] + template_ins = template + template_del = template + template_ins += '%s\n' % key + template_del += '%s\n' % key + template_ins += '' % warnings[key] + template_del += '' % warnings[key] + ins_file = open(os.path.join(ccdir, "html/elements/ins/%s-haswarn.html" % key), 'w') + ins_file.write(template_ins) + ins_file.close() + del_file = open(os.path.join(ccdir, "html/elements/del/%s-haswarn.html" % key), 'w') + del_file.write(template_del) + del_file.close() + +ins_file = open(os.path.join(ccdir, "html/elements/ins/datetime-isvalid.html"), 'w') +del_file = open(os.path.join(ccdir, "html/elements/del/datetime-isvalid.html"), 'w') +ins_file.write(template + 'valid datetime\n') +del_file.write(template + 'valid datetime\n') +for key in non_errors.keys(): + non_error = non_errors[key] + ins_file.write(' \n' % (non_errors[key], key)) + del_file.write(' \n' % (non_errors[key], key)) +ins_file.close() +del_file.close() +# vim: ts=4:sw=4 diff --git a/testing/web-platform/tests/conformance-checkers/tools/picture.py b/testing/web-platform/tests/conformance-checkers/tools/picture.py new file mode 100644 index 0000000000..13782818ac --- /dev/null +++ b/testing/web-platform/tests/conformance-checkers/tools/picture.py @@ -0,0 +1,366 @@ +# -*- coding: utf-8 -*- +import os +ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +template = """ + + +""" + +errors = { + # missing src on img + "img-no-src": "", + "img-no-src-with-srcset": "", + "img-no-src-with-picture": "", + "img-no-src-with-srcset-and-picture": "", + "img-no-src-with-source": "", + # junk content in picture + "junk-text-before-img": "x", + "junk-text-after-img": "x", + "junk-text-before-source": "x", + "junk-text-after-source": "x", + "junk-br-before-img": "
", + "junk-br-after-img": "
", + "junk-br-before-source": "
", + "junk-br-after-source": "
", + "junk-video-before": "", + "junk-video-no-img": "", + "junk-p-before": "

", + "junk-p-after": "

", + "junk-p-wrapping": "

", + "junk-span-before": "", + "junk-span-after": "", + "junk-span-wrapping": "", + "junk-picture-before": "", + "junk-picture-wrapping": "", + "junk-figure-wrapping": "
", + "junk-input-type-hidden": "", + "junk-style-scroped": "", + "junk-noscript": "", + "junk-noscript-after-source-no-img": "", + "junk-svg": "", + "junk-svg-no-img": "", + "junk-math-nog-img": "", + # parents + "parent-ul": "", + "parent-dl": "
", + "parent-hgroup": "

x

", + "parent-noscript-in-head": "", + "parent-rp": "xxx", + # invalid html syntax + "html-syntax-source-end-tag": "", + "html-syntax-img-end-tag": "", + "html-syntax-picture-no-end-tag": "", + "html-syntax-picture-slash": "", + "html-syntax-picture-slash-no-end-tag": "", + # missing img in picture + "missing-img-empty-picture": "", + "missing-img-only-source": "", + "missing-img-only-script": "", + "missing-img-script-and-source": "", + "missing-img-source-and-script": "", + # multiple img in picture + "multiple-img": "", + "multiple-img-with-script": "", + "multiple-img-with-source": "", + "multiple-img-with-source-and-script": "", + # source after img + "source-after-img": "", + "source-before-and-after-img": "", + # source with following sibling source element or img element with a srcset attribute + "always-matching-source-with-following-img-srcset": "", + "always-matching-source-with-following-source-srcset": "", + "always-matching-source-with-following-source-media": "", + "always-matching-source-with-following-source-type": "", + "always-matching-source-media-empty-with-following-source-srcset": "", + "always-matching-source-media-spaces-with-following-source-srcset": "", + "always-matching-source-media-all-with-following-source-srcset": "", + "always-matching-source-media-uppercase-with-following-source-srcset": "", + "always-matching-source-media-all-spaces-with-following-source-srcset": "", + "always-matching-source-sizes-with-following-source-srcset": "", + # sizes present + "img-srcset-no-descriptor-with-sizes": "", + "img-srcset-w-and-x-width-sizes": "", + "source-srcset-x-with-sizes": "", + "source-srcset-h-with-sizes": "", + "source-srcset-w-and-x-with-sizes": "", + "img-with-sizes-no-srcset": "", + # width descriptor without sizes + "img-srcset-w-no-sizes": "", + "source-srcset-w-no-sizes": "", + "source-type-srcset-w": "", + # invalid attributes on source + "source-src": "", + "source-src-srcset": "", + "source-alt": "", + "source-usemap": "", + "source-ismap": "", + "source-crossorigin": "", + "source-name": "", + "source-align": "", + "source-hspace": "", + "source-vspace": "", + "source-longdesc": "", + "source-border": "", + # missing srcset on source + "source-no-srcset": "", + "source-no-srcset-with-sizes": "", + "source-no-srcset-with-media": "", + "source-no-srcset-with-type": "", + # invalid attributes on picture + "picture-src": "", + "picture-srcset": "", + "picture-media": "", + "picture-sizes": "", + "picture-alt": "", + "picture-width": "", + "picture-height": "", + "picture-usemap": "", + "picture-ismap": "", + "picture-crossorigin": "", + "picture-name": "", + "picture-lowsrc": "", + "picture-align": "", + "picture-hspace": "", + "picture-vspace": "", + "picture-longdesc": "", + "picture-border": "", + # invalid attributes on source in video + "video-source-srcset": "", + "video-source-srcset-src": "", + "video-source-sizes-srcset": "", + "video-source-media-src": "", + # srcset on other elements + "link-rel-icon-srcset": "", + "input-type-image-srcset": "", + "object-srcset": "", + "video-srcset": "", + "audio-srcset": "", + "track-srcset": "", + "svg-image-srcset": "", + # invalid attributes on img + "img-type": "", + "img-type-with-picture": "", + # sizes microsyntax + "sizes-microsyntax-media-all": "", + "sizes-microsyntax-media-all-and-min-width": "", + "sizes-microsyntax-media-min-width-no-parenthesis": "", + "sizes-microsyntax-media-general-enclosed-junk": "", + "sizes-microsyntax-media-bad-junk": "", + "sizes-microsyntax-two-defaults": "", + "sizes-microsyntax-default-first": "", + "sizes-microsyntax-trailing-comma": "", + "sizes-microsyntax-trailing-junk": "", + "sizes-microsyntax-junk-in-default": "", + "sizes-microsyntax-junk-in-source-size": "", + "sizes-microsyntax-percent-in-source-size-value": "", + "sizes-microsyntax-no-unit-in-source-size-value": "", + "sizes-microsyntax-deg-source-size-value": "", + "sizes-microsyntax-grad-source-size-value": "", + "sizes-microsyntax-rad-source-size-value": "", + "sizes-microsyntax-turn-source-size-value": "", + "sizes-microsyntax-s-source-size-value": "", + "sizes-microsyntax-ms-source-size-value": "", + "sizes-microsyntax-hz-source-size-value": "", + "sizes-microsyntax-khz-source-size-value": "", + "sizes-microsyntax-dpi-source-size-value": "", + "sizes-microsyntax-dpcm-source-size-value": "", + "sizes-microsyntax-dppx-source-size-value": "", + "sizes-microsyntax-auto-source-size-value": "", + "sizes-microsyntax-inherit-source-size-value": "", + "sizes-microsyntax-initial-source-size-value": "", + "sizes-microsyntax-default-source-size-value": "", + "sizes-microsyntax-foo-bar-source-size-value": "", + "sizes-microsyntax-negative-source-size-value": "", + "sizes-microsyntax-empty": "", + "sizes-microsyntax-comma": "", + "sizes-microsyntax-css-comment-after-plus": "", + "sizes-microsyntax-css-comment-before-unit": "", + "sizes-microsyntax-scientific-notation-negative": "", + "sizes-microsyntax-scientific-notation-non-integer-in-exponent": "", + # srcset microsyntax + "srcset-microsyntax-leading-comma": "", + "srcset-microsyntax-leading-comma-multiple": "", + "srcset-microsyntax-trailing-comma": "", + "srcset-microsyntax-trailing-comma-multiple": "", + "srcset-microsyntax-broken-url": "", + "srcset-microsyntax-non-integer-w": "", + "srcset-microsyntax-uppercase-w": "", + "srcset-microsyntax-plus-w": "", + "srcset-microsyntax-scientific-notation-w": "", + "srcset-microsyntax-zero-w": "", + "srcset-microsyntax-negative-zero-w": "", + "srcset-microsyntax-negative-w": "", + "srcset-microsyntax-plus-x": "", + "srcset-microsyntax-negative-x": "", + "srcset-microsyntax-zero-x": "", + "srcset-microsyntax-negative-zero-x": "", + "srcset-microsyntax-nan-x": "", + "srcset-microsyntax-infinity-x": "", + "srcset-microsyntax-x-and-w": "", + "srcset-microsyntax-x-and-h": "", + "srcset-microsyntax-w-and-h": "", + "srcset-microsyntax-h": "", + "srcset-microsyntax-function": "", + "srcset-microsyntax-parenthesis-junk": "", + "srcset-microsyntax-square-bracket-junk": "", + "srcset-microsyntax-curly-bracket-junk": "", + "srcset-microsyntax-pipe-junk": "", + "srcset-microsyntax-w-and-no-descriptor": "", + "srcset-microsyntax-unique-descriptors-1x-and-omitted": "", + "srcset-microsyntax-unique-descriptors-2x": "", + "srcset-microsyntax-unique-descriptors-integer-and-decimals-x": "", + "srcset-microsyntax-unique-descriptors-w": "", + "srcset-microsyntax-empty": "", + "srcset-microsyntax-comma": "", + "srcset-microsyntax-css-comment-after-descriptor": "", + # aria + "picture-aria-role-img": "", + "picture-aria-role-button": "", + "picture-aria-role-region": "", + "picture-aria-role-application": "", + "source-aria-role-img": "", + "picture-aria-role-presentation": "", + "source-aria-role-presentation": "", +} + +non_errors_in_head = { + "parent-template-in-head": "", +} + +non_errors = { + # basic + "basic-img-src": "", + "basic-picture-img-src": "", + "basic-picture-source": "", + # source with height and width + "source-height": "", + "source-width": "", + # inter-element whitespace + "inter-element-whitespace": " ", + # parents + "parent-p": "

", + "parent-h1": "

x

", + "parent-noscript-in-body": "", + "parent-object": "", + "parent-video": "", + "parent-section": "

x

", + "parent-main": "
", + "parent-canvas": "", + "parent-template-in-body": "", + "parent-ruby": "x", + "parent-rt": "x", + "parent-a": "", + "parent-button": "", + "parent-td": "
", + # script-supporting elements + "script-first": "", + "template-first": "", + "script-between": "", + "script-after": "", + "script-before-after": "", + "script-before-between-after": "", + "script-and-template": "", + # source with following sibling source element or img element with a srcset attribute + "source-with-media-img-with-srcset": "", + "source-with-media-uppercase-img-with-srcset": "", + "source-with-media-spaces-img-with-srcset": "", + "source-with-media-source-with-srcset": "", + "source-with-type-img-with-srcset": "", + "source-with-type-source-with-srcset": "", + # sizes present + "img-with-sizes": "", + "source-with-sizes": "", + # embed allows any attributes + "embed-srcset-empty": "", + "embed-srcset-junk": "", + "embed-sizes-empty": "", + "embed-sizes-junk": "", + # img src also in srcset + "img-src-also-in-srcset-1x": "", + "img-src-also-in-srcset-2x": "", + "img-src-also-in-srcset-w": "", + # img src not in srcset + "img-src-not-in-srcset-x": "", + "img-src-not-in-srcset-w": "", + # source type + "source-type": "", + "source-type-srcset-x": "", + "source-type-srcset-w-sizes": "", + # sizes microsyntax + "sizes-microsyntax-media-min-width": "", + "sizes-microsyntax-multiple-source-sizes": "", + "sizes-microsyntax-no-default": "", + "sizes-microsyntax-media-not-and": "", + "sizes-microsyntax-only-default": "", + "sizes-microsyntax-calc-in-default": "", + "sizes-microsyntax-calc-in-source-size-value": "", + "sizes-microsyntax-calc-in-media": "", + "sizes-microsyntax-zero": "", + "sizes-microsyntax-minus-zero": "", + "sizes-microsyntax-em-in-source-size-value": "", + "sizes-microsyntax-ex-in-source-size-value": "", + "sizes-microsyntax-ch-in-source-size-value": "", + "sizes-microsyntax-rem-in-source-size-value": "", + "sizes-microsyntax-vw-in-source-size-value": "", + "sizes-microsyntax-vh-in-source-size-value": "", + "sizes-microsyntax-vmin-in-source-size-value": "", + "sizes-microsyntax-vmax-in-source-size-value": "", + "sizes-microsyntax-cm-in-source-size-value": "", + "sizes-microsyntax-mm-in-source-size-value": "", + "sizes-microsyntax-q-in-source-size-value": "", + "sizes-microsyntax-in-in-source-size-value": "", + "sizes-microsyntax-pc-in-source-size-value": "", + "sizes-microsyntax-pt-in-source-size-value": "", + "sizes-microsyntax-px-in-source-size-value": "", + "sizes-microsyntax-non-integer-px-in-source-size-value": "", + "sizes-microsyntax-leading-css-comment": "", + "sizes-microsyntax-trailing-css-comment": "", + "sizes-microsyntax-plus": "", + "sizes-microsyntax-non-integer-omitted-zero": "", + "sizes-microsyntax-scientifi-notation-0": "", + "sizes-microsyntax-scientifi-notation-1": "", + "sizes-microsyntax-scientifi-notation-2": "", + "sizes-microsyntax-scientifi-notation-3": "", + "sizes-microsyntax-scientifi-notation-4": "", + # srcset microsyntax + "srcset-microsyntax-comma-in-url": "", + "srcset-microsyntax-percent-escaped-leading-comma-in-url": "", + "srcset-microsyntax-percent-escaped-trailing-comma-in-url": "", + "srcset-microsyntax-percent-escaped-space-in-url": "", + "srcset-microsyntax-w": "", + "srcset-microsyntax-x": "", + "srcset-microsyntax-leading-dot-x": "", + "srcset-microsyntax-non-integer-x": "", + "srcset-microsyntax-scientific-notation-x": "", + "srcset-microsyntax-scientific-notation-decimals-x": "", + "srcset-microsyntax-scientific-notation-e-plus-x": "", + "srcset-microsyntax-scientific-notation-e-minus-x": "", + "srcset-microsyntax-scientific-notation-e-uppercase-x": "", + "srcset-microsyntax-no-space-between-candidates": "", + # valid attributes on img in picture + "img-crossorigin-with-picture": "", + "img-usemap-with-picture": "", + "img-ismap-with-picture": "", + "img-width-height-with-picture": "", + "img-width-height-zero-with-picture": "", + # global attributes on picture + "picture-global-attributes": "", +} + +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/picture/%s-novalid.html" % key), 'w') + file.write(template_error) + file.close() + +file = open(os.path.join(ccdir, "html/elements/picture/picture-isvalid.html"), 'w') +file.write(template + 'valid picture\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 diff --git a/testing/web-platform/tests/conformance-checkers/tools/url.py b/testing/web-platform/tests/conformance-checkers/tools/url.py new file mode 100644 index 0000000000..b93b544956 --- /dev/null +++ b/testing/web-platform/tests/conformance-checkers/tools/url.py @@ -0,0 +1,425 @@ +# -*- coding: utf-8 -*- +import os +ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +# based on https://github.com/web-platform-tests/wpt/blob/275544eab54a0d0c7f74ccc2baae9711293d8908/url/urltestdata.txt +invalid = { + "scheme-trailing-space": "a: foo.com", + "scheme-trailing-tab": "a:\tfoo.com", + "scheme-trailing-newline": "a:\nfoo.com", + "scheme-trailing-cr": "a:\rfoo.com", + "scheme-http-no-slash": "http:foo.com", + "scheme-http-no-slash-colon": "http::@c:29", + "scheme-http-no-slash-square-bracket": "http:[61:27]/:foo", + "scheme-http-backslash": "http:\\\\foo.com\\", + "scheme-http-single-slash": "http:/example.com/", + "scheme-ftp-single-slash": "ftp:/example.com/", + "scheme-https-single-slash": "https:/example.com/", + "scheme-data-single-slash": "data:/example.com/", + "scheme-ftp-no-slash": "ftp:example.com/", + "scheme-https-no-slash": "https:example.com/", + "userinfo-password-bad-chars": "http://&a:foo(b]c@d:2/", + "userinfo-username-contains-at-sign": "http://::@c@d:2", + "userinfo-backslash": "http://a\\b:c\\d@foo.com", + "host-space": "http://example .org", + "host-tab": "http://example\t.org", + "host-newline": "http://example.\norg", + "host-cr": "http://example.\rorg", + "host-square-brackets-port-contains-colon": "http://[1::2]:3:4", + "port-999999": "http://f:999999/c", + "port-single-letter": "http://f:b/c", + "port-multiple-letters": "http://f:fifty-two/c", + "port-leading-colon": "http://2001::1", + "port-leading-colon-bracket-colon": "http://2001::1]:80", + "path-leading-backslash-at-sign": "http://foo.com/\\@", + "path-leading-colon-backslash": ":\\", + "path-leading-colon-chars-backslash": ":foo.com\\", + "path-relative-square-brackets": "[61:24:74]:98", + "fragment-contains-hash": "http://foo/path#f#g", + "path-percent-encoded-malformed": "http://example.com/foo/%2e%2", + "path-bare-percent-sign": "http://example.com/foo%", + "path-u0091": "http://example.com/foo\u0091", + "userinfo-username-contains-pile-of-poo": "http://💩:foo@example.com", + "userinfo-password-contains-pile-of-poo": "http://foo:💩@example.com", + "host-hostname-in-brackets": "http://[www.google.com]/", + "host-empty": "http://", + "host-empty-with-userinfo": "http://user:pass@/", + "port-leading-dash": "http://foo:-80/", + "host-empty-userinfo-empty": "http://@/www.example.com", + "host-invalid-unicode": "http://\ufdd0zyx.com", + "host-invalid-unicode-percent-encoded": "http://%ef%b7%90zyx.com", + "host-double-percent-encoded": "http://\uff05\uff14\uff11.com", + "host-double-percent-encoded-percent-encoded": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com", + "host-u0000-percent-encoded": "http://\uff05\uff10\uff10.com", + "host-u0000-percent-encoded-percent-encoded": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com", +} +invalid_absolute = invalid.copy() + +invalid_url_code_points = { + "fragment-backslash": "#\\", + "fragment-leading-space": "http://f:21/b# e", + "path-contains-space": "/a/ /c", + "path-leading-space": "http://f:21/ b", + "path-tab": "http://example.com/foo\tbar", + "path-trailing-space": "http://f:21/b ?", + "port-cr": "http://f:\r/c", + "port-newline": "http://f:\n/c", + "port-space": "http://f: /c", + "port-tab": "http://f:\t/c", + "query-leading-space": "http://f:21/b? d", + "query-trailing-space": "http://f:21/b?d #", +} +invalid.update(invalid_url_code_points) +invalid_absolute.update(invalid_url_code_points) + +valid_absolute = { + "scheme-private": "a:foo.com", + "scheme-private-slash": "foo:/", + "scheme-private-slash-slash": "foo://", + "scheme-private-path": "foo:/bar.com/", + "scheme-private-path-leading-slashes-only": "foo://///////", + "scheme-private-path-leading-slashes-chars": "foo://///////bar.com/", + "scheme-private-path-leading-slashes-colon-slashes": "foo:////://///", + "scheme-private-single-letter": "c:/foo", + "scheme-private-single-slash": "madeupscheme:/example.com/", + "scheme-file-single-slash": "file:/example.com/", + "scheme-ftps-single-slash": "ftps:/example.com/", + "scheme-gopher-single-slash": "gopher:/example.com/", + "scheme-ws-single-slash": "ws:/example.com/", + "scheme-wss-single-slash": "wss:/example.com/", + "scheme-javascript-single-slash": "javascript:/example.com/", + "scheme-mailto-single-slash": "mailto:/example.com/", + "scheme-private-no-slash": "madeupscheme:example.com/", + "scheme-ftps-no-slash": "ftps:example.com/", + "scheme-gopher-no-slash": "gopher:example.com/", + "scheme-wss-no-slash": "wss:example.com/", + "scheme-mailto-no-slash": "mailto:example.com/", + "scheme-data-no-slash": "data:text/plain,foo", + "userinfo": "http://user:pass@foo:21/bar;par?b#c", + "host-ipv6": "http://[2001::1]", + "host-ipv6-port": "http://[2001::1]:80", + "port-none-but-colon": "http://f:/c", + "port-0": "http://f:0/c", + "port-00000000000000": "http://f:00000000000000/c", + "port-00000000000000000000080": "http://f:00000000000000000000080/c", + "userinfo-host-port-path": "http://a:b@c:29/d", + "userinfo-username-non-alpha": "http://foo.com:b@d/", + "query-contains-question-mark": "http://foo/abcd?efgh?ijkl", + "fragment-contains-question-mark": "http://foo/abcd#foo?bar", + "path-percent-encoded-dot": "http://example.com/foo/%2e", + "path-percent-encoded-space": "http://example.com/%20foo", + "path-non-ascii": "http://example.com/\u00C2\u00A9zbar", + "path-percent-encoded-multiple": "http://example.com/foo%41%7a", + "path-percent-encoded-u0091": "http://example.com/foo%91", + "path-percent-encoded-u0000": "http://example.com/foo%00", + "path-percent-encoded-mixed-case": "http://example.com/%3A%3a%3C%3c", + "path-unicode-han": "http://example.com/\u4F60\u597D\u4F60\u597D", + "path-uFEFF": "http://example.com/\uFEFF/foo", + "path-u202E-u202D": "http://example.com/\u202E/foo/\u202D/bar", + "host-is-pile-of-poo": "http://💩", + "path-contains-pile-of-poo": "http://example.com/foo/💩", + "query-contains-pile-of-poo": "http://example.com/foo?💩", + "fragment-contains-pile-of-poo": "http://example.com/foo#💩", + "host-192.0x00A80001": "http://192.0x00A80001", + "userinfo-username-contains-percent-encoded": "http://%25DOMAIN:foobar@foodomain.com", + "userinfo-empty": "http://@www.example.com", + "userinfo-user-empty": "http://:b@www.example.com", + "userinfo-password-empty": "http://a:@www.example.com", + "host-exotic-whitespace": "http://GOO\u200b\u2060\ufeffgoo.com", + "host-exotic-dot": "http://www.foo\u3002bar.com", + "host-fullwidth": "http://\uff27\uff4f.com", + "host-idn-unicode-han": "http://\u4f60\u597d\u4f60\u597d", + "host-IP-address-broken": "http://192.168.0.257/", +} +valid = valid_absolute.copy() + +valid_relative = { + "scheme-schemeless-relative": "//foo/bar", + "path-slash-only-relative": "/", + "path-simple-relative": "/a/b/c", + "path-percent-encoded-slash-relative": "/a%2fc", + "path-percent-encoded-slash-plus-slashes-relative": "/a/%2f/c", + "query-empty-no-path-relative": "?", + "fragment-empty-hash-only-no-path-relative": "#", + "fragment-slash-relative": "#/", + "fragment-semicolon-question-mark-relative": "#;?", + "fragment-non-ascii-relative": "#\u03B2", +} +valid.update(valid_relative) +invalid_absolute.update(valid_relative) + +valid_relative_colon_dot = { + "scheme-none-relative": "foo.com", + "path-colon-relative": ":", + "path-leading-colon-letter-relative": ":a", + "path-leading-colon-chars-relative": ":foo.com", + "path-leading-colon-slash-relative": ":/", + "path-leading-colon-hash-relative": ":#", + "path-leading-colon-number-relative": ":23", + "path-slash-colon-number-relative": "/:23", + "path-leading-colon-colon-relative": "::", + "path-colon-colon-number-relative": "::23", + "path-starts-with-pile-of-poo": "💩http://foo", + "path-contains-pile-of-poo": "http💩//:foo", + "path-slash-pile-of-poo": "/💩", +} +valid.update(valid_relative_colon_dot) + +invalid_file = { + "scheme-file-backslash": "file:c:\\foo\\bar.html", + "scheme-file-single-slash-c-bar": "file:/C|/foo/bar", + "scheme-file-slash-slash-abc-bar": "file://abc|/foo/bar", + "scheme-file-triple-slash-c-bar": "file:///C|/foo/bar", +} +invalid.update(invalid_file) + +valid_file = { + "scheme-file-uppercase": "File://foo/bar.html", + "scheme-file-slash-slash-c-bar": "file://C|/foo/bar", + "scheme-file-host-included": "file://server/foo/bar", + "scheme-file-host-empty": "file:///foo/bar.txt", + "scheme-file-scheme-only": "file:", + "scheme-file-slash-only": "file:/", + "scheme-file-slash-slash-only": "file://", + "scheme-file-slash-slash-slash-only": "file:///", + "scheme-file-no-slash": "file:test", +} +valid.update(valid_file) +valid_absolute.update(valid_file) + +warnings = { + "scheme-data-contains-fragment": "data:text/html,test#test", +} + +element_attribute_pairs = [ + "a href", + # "a ping", space-separated list of URLs; tested elsewhere + "area href", + # "area ping", space-separated list of URLs; tested elsewhere + "audio src", + "base href", + "blockquote cite", + "button formaction", + "del cite", + "embed src", + "form action", + "iframe src", + "img src", # srcset is tested elsewhere + "input formaction", # type=submit, type=image + "input src", # type=image + "input value", # type=url + "ins cite", + "link href", + "object data", + "q cite", + "script src", + "source src", + "track src", + "video poster", + "video src", +] + +template = "\n\n" + +def write_novalid_files(): + for el, attr in (pair.split() for pair in element_attribute_pairs): + for desc, url in invalid.items(): + if ("area" == el): + f = open(os.path.join(ccdir, "html/elements/area/href/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid href: %s\n' % desc) + f.write('<%s %s="%s" alt>\n' % (el, attr, url)) + f.close() + elif ("base" == el or "embed" == el): + f = open(os.path.join(ccdir, "html/elements/%s/%s/%s-novalid.html" % (el, attr, desc)), 'w') + f.write(template + 'invalid %s: %s\n' % (attr, desc)) + f.write('<%s %s="%s">\n' % (el, attr, url)) + f.close() + elif ("img" == el): + f = open(os.path.join(ccdir, "html/elements/img/src/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid src: %s\n' % desc) + f.write('\n' % url) + f.close() + elif ("input" == el and "src" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-image-src/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid src: %s\n' % desc) + f.write('<%s type=image alt="foo" %s="%s">\n' % (el, attr, url)) + f.close() + elif ("input" == el and "formaction" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-submit-formaction/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid formaction: %s\n' % desc) + f.write('<%s type=submit %s="%s">\n' % (el, attr, url)) + f.close() + f = open(os.path.join(ccdir, "html/elements/input/type-image-formaction/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid formaction: %s\n' % desc) + f.write('<%s type=image alt="foo" %s="%s">\n' % (el, attr, url)) + f.close() + elif ("input" == el and "value" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-url-value/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid value attribute: %s\n' % desc) + f.write('<%s type=url %s="%s">\n' % (el, attr, url)) + f.close() + elif ("link" == el): + f = open(os.path.join(ccdir, "html/elements/link/href/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid href: %s\n' % desc) + f.write('\n' % url) + f.close() + elif ("source" == el or "track" == el): + f = open(os.path.join(ccdir, "html/elements/%s/%s/%s-novalid.html" % (el, attr, desc)), 'w') + f.write(template + 'invalid %s: %s\n' % (attr, desc)) + f.write('\n' % (el, attr, url)) + f.close() + else: + f = open(os.path.join(ccdir, "html/elements/%s/%s/%s-novalid.html" % (el, attr, desc)), 'w') + f.write(template + 'invalid %s: %s\n' % (attr, desc)) + f.write('<%s %s="%s">\n' % (el, attr, url, el)) + f.close() + for desc, url in invalid.items(): + f = open(os.path.join(ccdir, "html/microdata/itemid/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid itemid: %s\n' % desc) + f.write('
\n' % url) + f.close() + for desc, url in invalid_absolute.items(): + f = open(os.path.join(ccdir, "html/microdata/itemtype/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid itemtype: %s\n' % desc) + f.write('
\n' % url) + f.close() + f = open(os.path.join(ccdir, "html/elements/input/type-url-value/%s-novalid.html" % desc), 'w') + f.write(template + 'invalid value attribute: %s\n' %desc) + f.write('\n' % url) + f.close() + +def write_haswarn_files(): + for el, attr in (pair.split() for pair in element_attribute_pairs): + for desc, url in warnings.items(): + if ("area" == el): + f = open(os.path.join(ccdir, "html/elements/area/href/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s %s="%s" alt>\n' % (el, attr, url)) + f.close() + elif ("base" == el or "embed" == el): + f = open(os.path.join(ccdir, "html/elements/%s/%s/%s-haswarn.html" % (el, attr, desc)), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s %s="%s">\n' % (el, attr, url)) + f.close() + elif ("img" == el): + f = open(os.path.join(ccdir, "html/elements/img/src/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s %s="%s" alt>\n' % (el, attr, url)) + f.close() + elif ("input" == el and "src" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-image-src/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s type=image alt="foo" %s="%s">\n' % (el, attr, url)) + f.close() + elif ("input" == el and "formaction" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-submit-formaction/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s type=submit %s="%s">\n' % (el, attr, url)) + f.close() + f = open(os.path.join(ccdir, "html/elements/input/type-image-formaction/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s type=image alt="foo" %s="%s">\n' % (el, attr, url)) + f.close() + elif ("input" == el and "value" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-url-value/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s type=url %s="%s">\n' % (el, attr, url)) + f.close() + elif ("link" == el): + f = open(os.path.join(ccdir, "html/elements/link/href/%s-haswarn.html" % desc), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('<%s %s="%s" rel=help>\n' % (el, attr, url)) + f.close() + elif ("source" == el or "track" == el): + f = open(os.path.join(ccdir, "html/elements/%s/%s/%s-haswarn.html" % (el, attr, desc)), 'w') + f.write(template + '%s warning: %s\n' % (attr, desc)) + f.write('\n' % (el, attr, url)) + f.close() + else: + f = open(os.path.join(ccdir, "html/elements/%s/%s/%s-haswarn.html" % (el, attr, desc)), 'w') + f.write(template + '%s warning: %s\n' % (url, desc)) + f.write('<%s %s="%s">\n' % (el, attr, url, el)) + f.close() + for desc, url in warnings.items(): + f = open(os.path.join(ccdir, "html/microdata/itemtype-%s-haswarn.html" % desc ), 'w') + f.write(template + 'warning: %s\n' % desc) + f.write('
\n' % url) + f.close() + f = open(os.path.join(ccdir, "html/microdata/itemid-%s-haswarn.html" % desc), 'w') + f.write(template + 'warning: %s\n' % desc) + f.write('
\n' % url) + f.close() + +def write_isvalid_files(): + for el, attr in (pair.split() for pair in element_attribute_pairs): + if ("base" == el): + continue + if ("html" == el): + continue + elif ("input" == el and "value" == attr): + continue + elif ("input" == el and "formaction" == attr): + fs = open(os.path.join(ccdir, "html/elements/input/type-submit-formaction-isvalid.html"), 'w') + fs.write(template + 'valid formaction\n') + fi = open(os.path.join(ccdir, "html/elements/input/type-image-formaction-isvalid.html"), 'w') + fi.write(template + 'valid formaction\n') + elif ("input" == el and "src" == attr): + f = open(os.path.join(ccdir, "html/elements/input/type-image-src-isvalid.html"), 'w') + f.write(template + 'valid src\n') + else: + f = open(os.path.join(ccdir, "html/elements/%s/%s-isvalid.html" % (el, attr)), 'w') + f.write(template + 'valid %s\n' % attr) + for desc, url in valid.items(): + if ("area" == el): + f.write('<%s %s="%s" alt>\n' % (el, attr, url, desc)) + elif ("embed" == el): + f.write('<%s %s="%s">\n' % (el, attr, url, desc)) + elif ("img" == el): + f.write('<%s %s="%s" alt>\n' % (el, attr, url, desc)) + elif ("input" == el and "src" == attr): + f.write('<%s type=image alt="foo" %s="%s">\n' % (el, attr, url, desc)) + elif ("input" == el and "formaction" == attr): + fs.write('<%s type=submit %s="%s">\n' % (el, attr, url, desc)) + fi.write('<%s type=image alt="foo" %s="%s">\n' % (el, attr, url, desc)) + elif ("link" == el): + f.write('<%s %s="%s" rel=help>\n' % (el, attr, url, desc)) + elif ("source" == el or "track" == el): + f.write('\n' % (el, attr, url, desc)) + else: + f.write('<%s %s="%s">\n' % (el, attr, url, el, desc)) + if ("input" == el and "formaction" == attr): + fs.close() + fi.close() + else: + if ("a" == el and "href" == attr): + f.write('\n') + f.close() + for desc, url in valid.items(): + f = open(os.path.join(ccdir, "html/elements/base/href/%s-isvalid.html" % desc), 'w') + f.write(template + 'valid href: %s\n' % desc) + f.write('\n' % url) + f.close() + f = open(os.path.join(ccdir, "html/elements/meta/refresh-isvalid.html"), 'w') + f.write(template + 'valid meta refresh\n') + for desc, url in valid.items(): + f.write('\n' % (url, desc)) + f.close() + f = open(os.path.join(ccdir, "html/microdata/itemid-isvalid.html"), 'w') + f.write(template + 'valid itemid\n') + for desc, url in valid.items(): + f.write('
\n' % (url, desc)) + f.close() + f = open(os.path.join(ccdir, "html/microdata/itemtype-isvalid.html"), 'w') + f.write(template + 'valid itemtype\n') + for desc, url in valid_absolute.items(): + f.write('
\n' % (url, desc)) + f.close() + f = open(os.path.join(ccdir, "html/elements/input/type-url-value-isvalid.html"), 'w') + f.write(template + 'valid value attribute\n') + for desc, url in valid_absolute.items(): + f.write('\n' % (url, desc)) + f.close() + +write_novalid_files() +write_haswarn_files() +write_isvalid_files() +# vim: ts=4:sw=4 -- cgit v1.2.3