From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../tests/infrastructure/assumptions/README.md | 1 + .../infrastructure/assumptions/ahem-notref.html | 316 ++++++++++++++++++++ .../tests/infrastructure/assumptions/ahem-ref.html | 320 +++++++++++++++++++++ .../tests/infrastructure/assumptions/ahem.html | 316 ++++++++++++++++++++ .../assumptions/allowed-to-play.html | 23 ++ .../tests/infrastructure/assumptions/blank.html | 2 + .../assumptions/canvas-background-ref.html | 8 + .../assumptions/canvas-background.html | 4 + .../tests/infrastructure/assumptions/cookie.html | 18 ++ .../assumptions/document-fonts-ready.html | 32 +++ .../infrastructure/assumptions/html-elements.html | 133 +++++++++ .../assumptions/initial-color-ref.html | 12 + .../infrastructure/assumptions/initial-color.html | 9 + .../assumptions/medium-font-size-ref.html | 8 + .../assumptions/medium-font-size.html | 9 + .../assumptions/min-font-size-ref.html | 8 + .../infrastructure/assumptions/min-font-size.html | 9 + .../assumptions/non-local-ports.sub.window.js | 111 +++++++ .../assumptions/non-secure-context.any.js | 9 + .../resources/fetch-and-post-result.html | 12 + .../assumptions/tools/ahem-generate-table.py | 127 ++++++++ 21 files changed, 1487 insertions(+) create mode 100644 testing/web-platform/tests/infrastructure/assumptions/README.md create mode 100644 testing/web-platform/tests/infrastructure/assumptions/ahem-notref.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/ahem-ref.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/ahem.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/allowed-to-play.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/blank.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/canvas-background-ref.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/canvas-background.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/cookie.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/document-fonts-ready.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/html-elements.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/initial-color-ref.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/initial-color.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/medium-font-size-ref.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/medium-font-size.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/min-font-size-ref.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/min-font-size.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/non-local-ports.sub.window.js create mode 100644 testing/web-platform/tests/infrastructure/assumptions/non-secure-context.any.js create mode 100644 testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html create mode 100644 testing/web-platform/tests/infrastructure/assumptions/tools/ahem-generate-table.py (limited to 'testing/web-platform/tests/infrastructure/assumptions') diff --git a/testing/web-platform/tests/infrastructure/assumptions/README.md b/testing/web-platform/tests/infrastructure/assumptions/README.md new file mode 100644 index 0000000000..51902b8899 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/README.md @@ -0,0 +1 @@ +To update the generated tests, run `wpt update-built --include infrastructure`. diff --git a/testing/web-platform/tests/infrastructure/assumptions/ahem-notref.html b/testing/web-platform/tests/infrastructure/assumptions/ahem-notref.html new file mode 100644 index 0000000000..51767c26ea --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/ahem-notref.html @@ -0,0 +1,316 @@ + +Ahem checker + + + + + + + + + + + + + + + + + + + +
x + !x + "x + #x + $x + %x + &x + (x + )x + *x + +x + ,x + -x + .x + /x + 0x + 1x +
2x + 3x + 4x + 5x + 6x + 7x + 8x + 9x + :x + ;x + <x + =x + >x + ?x + @x + Ax + Bx +
Cx + Dx + Ex + Fx + Gx + Hx + Ix + Jx + Kx + Lx + Mx + Nx + Ox + Px + Qx + Rx + Sx +
Tx + Ux + Vx + Wx + Xx + Yx + Zx + [x + \x + ]x + ^x + _x + `x + ax + bx + cx + dx +
ex + fx + gx + hx + ix + jx + kx + lx + mx + nx + ox + px + qx + rx + sx + tx + ux +
vx + wx + xx + yx + zx + {x + |x + }x + ~x +  x + ¡x + ¢x + £x + ¤x + ¥x + ¦x + §x +
¨x + ©x + ªx + «x + ¬x + ­x + ®x + ¯x + °x + ±x + ²x + ³x + ´x + µx + ¶x + ·x + ¸x +
¹x + ºx + »x + ¼x + ½x + ¾x + ¿x + Àx + Áx + Âx + Ãx + Äx + Åx + Æx + Çx + Èx + Éx +
Êx + Ëx + Ìx + Íx + Îx + Ïx + Ðx + Ñx + Òx + Óx + Ôx + Õx + Öx + ×x + Øx + Ùx + Úx +
Ûx + Üx + Ýx + Þx + ßx + àx + áx + âx + ãx + äx + åx + æx + çx + èx + éx + êx + ëx +
ìx + íx + îx + ïx + ðx + ñx + òx + óx + ôx + õx + öx + ÷x + øx + ùx + úx + ûx + üx +
ýx + þx + ÿx + ıx + Œx + œx + Ÿx + ƒx + ˆx + ˇx + ˉx + ˘x + ˙x + ˚x + ˛x + ˜x + ˝x +
Δx + Υx + Χx + Ωx + μx + πx +  x +  x +  x +  x +  x +  x +  x + ​x + ‌x + ‍x + ‐x +
–x + —x + ‘x + ’x + ‚x + “x + ”x + „x + †x + ‡x + •x + …x + ‰x + ‹x + ›x + ⁄x + ™x +
Ωx + ∂x + ∆x + ∏x + ∑x + −x + ∙x + √x + ∞x + ∫x + ≈x + ≠x + ≤x + ≥x + ⋲x + ◊x +  x +
〇x + 一x + 七x + 三x + 九x + 二x + 五x + 八x + 六x + 十x + 囗x + 四x + 土x + 木x + 横x + 水x + 火x +
纵x + 金x + x + x + x + x +
diff --git a/testing/web-platform/tests/infrastructure/assumptions/ahem-ref.html b/testing/web-platform/tests/infrastructure/assumptions/ahem-ref.html new file mode 100644 index 0000000000..9116232620 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/ahem-ref.html @@ -0,0 +1,320 @@ + +Ahem checker + + + + + + + + + + + + + + + + + + + + +
x + !x + "x + #x + $x + %x + &x + (x + )x + *x + +x + ,x + -x + .x + /x + 0x + 1x +
2x + 3x + 4x + 5x + 6x + 7x + 8x + 9x + :x + ;x + <x + =x + >x + ?x + @x + Ax + Bx +
Cx + Dx + Ex + Fx + Gx + Hx + Ix + Jx + Kx + Lx + Mx + Nx + Ox + Px + Qx + Rx + Sx +
Tx + Ux + Vx + Wx + Xx + Yx + Zx + [x + \x + ]x + ^x + _x + `x + ax + bx + cx + dx +
ex + fx + gx + hx + ix + jx + kx + lx + mx + nx + ox + px + qx + rx + sx + tx + ux +
vx + wx + xx + yx + zx + {x + |x + }x + ~x +  x + ¡x + ¢x + £x + ¤x + ¥x + ¦x + §x +
¨x + ©x + ªx + «x + ¬x + ­x + ®x + ¯x + °x + ±x + ²x + ³x + ´x + µx + ¶x + ·x + ¸x +
¹x + ºx + »x + ¼x + ½x + ¾x + ¿x + Àx + Áx + Âx + Ãx + Äx + Åx + Æx + Çx + Èx + Éx +
Êx + Ëx + Ìx + Íx + Îx + Ïx + Ðx + Ñx + Òx + Óx + Ôx + Õx + Öx + ×x + Øx + Ùx + Úx +
Ûx + Üx + Ýx + Þx + ßx + àx + áx + âx + ãx + äx + åx + æx + çx + èx + éx + êx + ëx +
ìx + íx + îx + ïx + ðx + ñx + òx + óx + ôx + õx + öx + ÷x + øx + ùx + úx + ûx + üx +
ýx + þx + ÿx + ıx + Œx + œx + Ÿx + ƒx + ˆx + ˇx + ˉx + ˘x + ˙x + ˚x + ˛x + ˜x + ˝x +
Δx + Υx + Χx + Ωx + μx + πx +  x +  x +  x +  x +  x +  x +  x + ​x + ‌x + ‍x + ‐x +
–x + —x + ‘x + ’x + ‚x + “x + ”x + „x + †x + ‡x + •x + …x + ‰x + ‹x + ›x + ⁄x + ™x +
Ωx + ∂x + ∆x + ∏x + ∑x + −x + ∙x + √x + ∞x + ∫x + ≈x + ≠x + ≤x + ≥x + ⋲x + ◊x +  x +
〇x + 一x + 七x + 三x + 九x + 二x + 五x + 八x + 六x + 十x + 囗x + 四x + 土x + 木x + 横x + 水x + 火x +
纵x + 金x + x + x + x + x +
diff --git a/testing/web-platform/tests/infrastructure/assumptions/ahem.html b/testing/web-platform/tests/infrastructure/assumptions/ahem.html new file mode 100644 index 0000000000..068c1d4dee --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/ahem.html @@ -0,0 +1,316 @@ + +Ahem checker + + + + + + + + + + + + + + + + + + + + +
x + !x + "x + #x + $x + %x + &x + (x + )x + *x + +x + ,x + -x + .x + /x + 0x + 1x +
2x + 3x + 4x + 5x + 6x + 7x + 8x + 9x + :x + ;x + <x + =x + >x + ?x + @x + Ax + Bx +
Cx + Dx + Ex + Fx + Gx + Hx + Ix + Jx + Kx + Lx + Mx + Nx + Ox + Px + Qx + Rx + Sx +
Tx + Ux + Vx + Wx + Xx + Yx + Zx + [x + \x + ]x + ^x + _x + `x + ax + bx + cx + dx +
ex + fx + gx + hx + ix + jx + kx + lx + mx + nx + ox + px + qx + rx + sx + tx + ux +
vx + wx + xx + yx + zx + {x + |x + }x + ~x +  x + ¡x + ¢x + £x + ¤x + ¥x + ¦x + §x +
¨x + ©x + ªx + «x + ¬x + ­x + ®x + ¯x + °x + ±x + ²x + ³x + ´x + µx + ¶x + ·x + ¸x +
¹x + ºx + »x + ¼x + ½x + ¾x + ¿x + Àx + Áx + Âx + Ãx + Äx + Åx + Æx + Çx + Èx + Éx +
Êx + Ëx + Ìx + Íx + Îx + Ïx + Ðx + Ñx + Òx + Óx + Ôx + Õx + Öx + ×x + Øx + Ùx + Úx +
Ûx + Üx + Ýx + Þx + ßx + àx + áx + âx + ãx + äx + åx + æx + çx + èx + éx + êx + ëx +
ìx + íx + îx + ïx + ðx + ñx + òx + óx + ôx + õx + öx + ÷x + øx + ùx + úx + ûx + üx +
ýx + þx + ÿx + ıx + Œx + œx + Ÿx + ƒx + ˆx + ˇx + ˉx + ˘x + ˙x + ˚x + ˛x + ˜x + ˝x +
Δx + Υx + Χx + Ωx + μx + πx +  x +  x +  x +  x +  x +  x +  x + ​x + ‌x + ‍x + ‐x +
–x + —x + ‘x + ’x + ‚x + “x + ”x + „x + †x + ‡x + •x + …x + ‰x + ‹x + ›x + ⁄x + ™x +
Ωx + ∂x + ∆x + ∏x + ∑x + −x + ∙x + √x + ∞x + ∫x + ≈x + ≠x + ≤x + ≥x + ⋲x + ◊x +  x +
〇x + 一x + 七x + 三x + 九x + 二x + 五x + 八x + 六x + 十x + 囗x + 四x + 土x + 木x + 横x + 水x + 火x +
纵x + 金x + x + x + x + x +
diff --git a/testing/web-platform/tests/infrastructure/assumptions/allowed-to-play.html b/testing/web-platform/tests/infrastructure/assumptions/allowed-to-play.html new file mode 100644 index 0000000000..bfa5729371 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/allowed-to-play.html @@ -0,0 +1,23 @@ + +<audio and <video> autoplay + + + + + + diff --git a/testing/web-platform/tests/infrastructure/assumptions/blank.html b/testing/web-platform/tests/infrastructure/assumptions/blank.html new file mode 100644 index 0000000000..6d8da5e89c --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/blank.html @@ -0,0 +1,2 @@ +Blank Document + diff --git a/testing/web-platform/tests/infrastructure/assumptions/canvas-background-ref.html b/testing/web-platform/tests/infrastructure/assumptions/canvas-background-ref.html new file mode 100644 index 0000000000..b117f6b300 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/canvas-background-ref.html @@ -0,0 +1,8 @@ + +canvas background reference + +

The background should be white diff --git a/testing/web-platform/tests/infrastructure/assumptions/canvas-background.html b/testing/web-platform/tests/infrastructure/assumptions/canvas-background.html new file mode 100644 index 0000000000..962edf5e8b --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/canvas-background.html @@ -0,0 +1,4 @@ + +Check canvas background is white + +

The background should be white diff --git a/testing/web-platform/tests/infrastructure/assumptions/cookie.html b/testing/web-platform/tests/infrastructure/assumptions/cookie.html new file mode 100644 index 0000000000..5d5b0dc0e1 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/cookie.html @@ -0,0 +1,18 @@ + +cookies work in default browse settings + + + + + + diff --git a/testing/web-platform/tests/infrastructure/assumptions/document-fonts-ready.html b/testing/web-platform/tests/infrastructure/assumptions/document-fonts-ready.html new file mode 100644 index 0000000000..9fb0137025 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/document-fonts-ready.html @@ -0,0 +1,32 @@ + +document.fonts.ready resolves after layout depending on loaded fonts + + + + + +

+X + diff --git a/testing/web-platform/tests/infrastructure/assumptions/html-elements.html b/testing/web-platform/tests/infrastructure/assumptions/html-elements.html new file mode 100644 index 0000000000..3fe3d201ff --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/html-elements.html @@ -0,0 +1,133 @@ + +HTML styles + + + +
+
+
+
+ + +

+
    +
  • +
+
    +
  1. +
+ + + +
+
+
+ diff --git a/testing/web-platform/tests/infrastructure/assumptions/initial-color-ref.html b/testing/web-platform/tests/infrastructure/assumptions/initial-color-ref.html new file mode 100644 index 0000000000..46dd110bd3 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/initial-color-ref.html @@ -0,0 +1,12 @@ + +Initial color is black reference + +

The text should be black diff --git a/testing/web-platform/tests/infrastructure/assumptions/initial-color.html b/testing/web-platform/tests/infrastructure/assumptions/initial-color.html new file mode 100644 index 0000000000..f1033c7d7e --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/initial-color.html @@ -0,0 +1,9 @@ + +Initial color is black + + +

The text should be black diff --git a/testing/web-platform/tests/infrastructure/assumptions/medium-font-size-ref.html b/testing/web-platform/tests/infrastructure/assumptions/medium-font-size-ref.html new file mode 100644 index 0000000000..c1600ec419 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/medium-font-size-ref.html @@ -0,0 +1,8 @@ + +medium font-size reference + +

This text should be 16px diff --git a/testing/web-platform/tests/infrastructure/assumptions/medium-font-size.html b/testing/web-platform/tests/infrastructure/assumptions/medium-font-size.html new file mode 100644 index 0000000000..f4c303d0ba --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/medium-font-size.html @@ -0,0 +1,9 @@ + +Check medium font-size is 16px + + +

This text should be 16px diff --git a/testing/web-platform/tests/infrastructure/assumptions/min-font-size-ref.html b/testing/web-platform/tests/infrastructure/assumptions/min-font-size-ref.html new file mode 100644 index 0000000000..013970bedf --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/min-font-size-ref.html @@ -0,0 +1,8 @@ + +Tiny text reference + +

Tiny text diff --git a/testing/web-platform/tests/infrastructure/assumptions/min-font-size.html b/testing/web-platform/tests/infrastructure/assumptions/min-font-size.html new file mode 100644 index 0000000000..a4b9a1cd36 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/min-font-size.html @@ -0,0 +1,9 @@ + +Check 1px and 2px font-sizes are different + + +

Tiny text diff --git a/testing/web-platform/tests/infrastructure/assumptions/non-local-ports.sub.window.js b/testing/web-platform/tests/infrastructure/assumptions/non-local-ports.sub.window.js new file mode 100644 index 0000000000..06ecb3ab21 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/non-local-ports.sub.window.js @@ -0,0 +1,111 @@ +// Verifies that non-local HTTP(S) ports are open and serve correctly. +// +// See the corresponding WPT RFC: +// https://github.com/web-platform-tests/rfcs/blob/master/rfcs/address_space_overrides.md +// +// These ports are used to test the Local Network Access specification: +// https://wicg.github.io/local-network-access/ +// +// More tests can be found in `fetch/local-network-access/`. + +const alternatePorts = { + httpPrivate: "{{ports[http-private][0]}}", + httpsPrivate: "{{ports[https-private][0]}}", + httpPublic: "{{ports[http-public][0]}}", + httpsPublic: "{{ports[https-public][0]}}", +}; + +// Resolves a URL relative to the current location, returning an absolute URL. +// +// `url` specifies the relative URL, e.g. "foo.html" or "http://foo.example". +// `options.protocol` and `options.port`, if defined, override the respective +// properties of the returned URL object. +function resolveUrl(url, options) { + const result = new URL(url, window.location); + if (options === undefined) { + return result; + } + + const { port, protocol } = options; + if (port !== undefined) { + result.port = port; + } + if (protocol !== undefined) { + result.protocol = protocol; + } + + return result; +} + +const alternateOrigins = { + httpPrivate: { + protocol: "http:", + port: alternatePorts.httpPrivate, + }, + httpsPrivate: { + protocol: "https:", + port: alternatePorts.httpsPrivate, + }, + httpPublic: { + protocol: "http:", + port: alternatePorts.httpPublic, + }, + httpsPublic: { + protocol: "https:", + port: alternatePorts.httpsPublic, + }, +}; + +promise_test(async () => { + const url = + resolveUrl("/common/blank-with-cors.html", alternateOrigins.httpsPrivate); + const response = await fetch(url); + assert_true(response.ok); +}, "Fetch from https-private port works."); + +promise_test(async () => { + const url = + resolveUrl("/common/blank-with-cors.html", alternateOrigins.httpPrivate); + const response = await fetch(url); + assert_true(response.ok); +}, "Fetch from http-private port works."); + +promise_test(async () => { + const url = + resolveUrl("/common/blank-with-cors.html", alternateOrigins.httpsPublic); + const response = await fetch(url); + assert_true(response.ok); +}, "Fetch from https-public port works."); + +promise_test(async () => { + const url = + resolveUrl("/common/blank-with-cors.html", alternateOrigins.httpPublic); + const response = await fetch(url); + assert_true(response.ok); +}, "Fetch from http-public port works."); + +promise_test(async (t) => { + const futureMessage = new Promise((resolve) => { + window.addEventListener("message", resolve); + }); + + const iframe = await new Promise((resolve, reject) => { + const iframe = document.createElement("iframe"); + iframe.src = resolveUrl("resources/fetch-and-post-result.html", + alternateOrigins.httpPublic); + + iframe.onload = () => { resolve(iframe); }; + iframe.onerror = reject; + + document.body.appendChild(iframe); + t.add_cleanup(() => { + document.body.removeChild(iframe); + }); + }); + + iframe.contentWindow.postMessage( + resolveUrl("/common/blank-with-cors.html").toString(), "*"); + + const evt = await futureMessage; + assert_equals(evt.data, "failure: error = TypeError"); +}, "Fetch from http-public to local http fails."); diff --git a/testing/web-platform/tests/infrastructure/assumptions/non-secure-context.any.js b/testing/web-platform/tests/infrastructure/assumptions/non-secure-context.any.js new file mode 100644 index 0000000000..c05689fe76 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/non-secure-context.any.js @@ -0,0 +1,9 @@ +test(() => { + assert_false(self.isSecureContext); +}, "Lack of .https file name flag implies non-secure context"); + +test(() => { + assert_equals(location.protocol, "http:"); +}, "Lack of .https file name flag implies HTTP scheme"); + +done(); diff --git a/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html b/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html new file mode 100644 index 0000000000..4df0c4c71a --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/resources/fetch-and-post-result.html @@ -0,0 +1,12 @@ + + diff --git a/testing/web-platform/tests/infrastructure/assumptions/tools/ahem-generate-table.py b/testing/web-platform/tests/infrastructure/assumptions/tools/ahem-generate-table.py new file mode 100644 index 0000000000..314279f671 --- /dev/null +++ b/testing/web-platform/tests/infrastructure/assumptions/tools/ahem-generate-table.py @@ -0,0 +1,127 @@ +import itertools +import unicodedata + +from fontTools.ttLib import TTFont + +try: + chr(0x100) +except ValueError: + chr = unichr + +def grouper(n, iterable): + """ + >>> list(grouper(3, 'ABCDEFG')) + [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']] + """ + iterable = iter(iterable) + return iter(lambda: list(itertools.islice(iterable, n)), []) + +ttf = TTFont("../../../fonts/Ahem.ttf") + +chars = {char for table in ttf['cmap'].tables for char in table.cmap.keys()} + +# exclude chars that can't be represented as HTML numeric character refs +chars = chars - (set(range(0x80, 0x9F+1)) | {0x00}) + +chars_sorted = sorted(chars) + +per_row = 17 + + +doctype = "" +title = "Ahem checker" +style_open = """ +" +style_font_face = """ +@font-face { + font-family: Ahem; + src: url("../../fonts/Ahem.ttf"); +}""".strip() +style_table_font_specified = """ +table { + font: 15px/1 Ahem; + border-collapse: separate; + border-spacing: 1px; + table-layout: fixed; +}""".strip() +style_table_font_unspecified = """ +table { + font-size: 15px; + line-height: 1; + border-collapse: separate; + border-spacing: 1px; + table-layout: fixed; +}""".strip() + + +def build_header(is_test, rel, href): + rv = [doctype, title] + + if rel != None and href != None: + rv.append('' % (rel, href)) + + rv.append(style_open) + + if not is_test: + if rel == None and href == None: + # ahem-notref.html + rv.append(style_table_font_unspecified) + else: + # ahem-ref.html + rv.append(style_font_face) + rv.append(style_table_font_specified) + else: + # ahem.html + rv.append(style_table_font_specified) + + rv.append(style_close) + + return "\n".join(rv) + + +def build_table(): + rv = ["\n"] + + rv.append("\n") + for row in grouper(per_row, chars_sorted): + rv.append(" " * 4 + "\n") + for codepoint in row: + assert codepoint <= 0xFFFF + try: + name = unicodedata.name(chr(codepoint)) + except ValueError: + rv.append(" " * 8 + "
&#x%04X;x \n" % (codepoint, codepoint)) + else: + rv.append(" " * 8 + "&#x%04X;x \n" % (codepoint, codepoint, name)) + rv.append("
\n") + + return "".join(rv) + + +cases = [ + # file, is_test, rel + ("../ahem.html", True, "match"), + ("../ahem-ref.html", False, "mismatch"), + ("../ahem-notref.html", False, None), +] + +table = build_table() + +for index, case in enumerate(cases): + next_index = index + 1 + file, is_test, rel = case + href = cases[next_index][0][3:] if next_index < len(cases) else None + header = build_header(is_test, rel, href) + + with open(file, "w") as file: + file.write("%s%s" % (header, table)) + -- cgit v1.2.3