initial commit
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
# Reflow fixtures
|
||||
|
||||
`late-layout.ttf` is generated by `generate_late_font.py` with fontTools. The glyphs
|
||||
are original rectangles with deliberately wide advance widths. It contains no
|
||||
third-party font outlines. It is test data for a visible layout change after a
|
||||
real font resource arrives, not a reading font.
|
||||
|
||||
The WebEngine tests hold image/font replies through the production resource
|
||||
handler's extraction completion, then release them after a logical location has
|
||||
been captured. Native scroll anchoring is disabled in the fixture. The tests
|
||||
check the same character and viewport fraction after image decoding and font
|
||||
substitution, and navigation while a resource is pending.
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+32
@@ -0,0 +1,32 @@
|
||||
"""Generate original, deliberately wide glyphs for real font-swap layout tests."""
|
||||
from pathlib import Path
|
||||
import hashlib
|
||||
import json
|
||||
from fontTools.fontBuilder import FontBuilder
|
||||
from fontTools.pens.ttGlyphPen import TTGlyphPen
|
||||
font = FontBuilder(1000, isTTF=True)
|
||||
chars = list(range(32, 127))
|
||||
glyphs = ['.notdef'] + [f'u{x:04X}' for x in chars]
|
||||
font.setupGlyphOrder(glyphs)
|
||||
font.setupCharacterMap(dict(zip(chars, glyphs[1:])))
|
||||
shapes = {}
|
||||
for name in glyphs:
|
||||
pen = TTGlyphPen(None)
|
||||
if name != 'u0020':
|
||||
pen.moveTo((80, 0)); pen.lineTo((80, 700)); pen.lineTo((1300, 700)); pen.lineTo((1300, 0)); pen.closePath()
|
||||
shapes[name] = pen.glyph()
|
||||
font.setupGlyf(shapes)
|
||||
font.setupHorizontalMetrics({name: (1400, 0) for name in glyphs})
|
||||
font.setupHorizontalHeader(ascent=800, descent=-200)
|
||||
font.setupNameTable({'familyName':'DocView Layout Test', 'styleName':'Regular', 'uniqueFontIdentifier':'DocView Layout Test 1', 'fullName':'DocView Layout Test', 'psName':'DocViewLayoutTest'})
|
||||
font.setupOS2(sTypoAscender=800, sTypoDescender=-200, usWinAscent=800, usWinDescent=200)
|
||||
font.setupPost()
|
||||
font.setupMaxp()
|
||||
font.font['head'].created = font.font['head'].modified = 2082844800
|
||||
font.font.recalcTimestamp = False
|
||||
path = Path(__file__).with_name('late-layout.ttf')
|
||||
font.save(path)
|
||||
path.with_suffix('.json').write_text(json.dumps({
|
||||
'file': path.name, 'sha256': hashlib.sha256(path.read_bytes()).hexdigest(),
|
||||
'generator': Path(__file__).name, 'purpose': 'Original wide rectangle glyphs for font-swap layout tests',
|
||||
}, indent=2) + '\n')
|
||||
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="80"><rect width="200" height="80" fill="#147d79"/><text x="12" y="46" font-size="24" fill="white">Local SVG</text></svg>
|
||||
|
After Width: | Height: | Size: 180 B |
+1
@@ -0,0 +1 @@
|
||||
body{font-family:serif;margin:32px;line-height:1.6;color:#16293a}h1{border-bottom:3px solid #147d79}section{min-height:720px}.hidden{display:none}nav{background:#eef8f8;padding:16px}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
<!doctype html><html lang="ja"><head><meta charset="UTF-8"><title>DocView local document</title><link rel="stylesheet" href="assets/style.css"></head><body>
|
||||
<h1 id="start">文書リーダー検証 / Local document</h1><nav role="doc-toc"><a href="#second">第二節へ</a> · <a href="next.html">別のHTML</a></nav>
|
||||
<img src="assets/local.svg" alt="Local asset"><section><h2 id="first">第一節</h2><p>日本語、Latin, <ruby>漢字<rt>かんじ</rt></ruby>。This is locally authored acceptance text.</p><h3 class="hidden">Hidden heading</h3></section>
|
||||
<section><h2 id="second">第二節</h2><p>同じ文書内の資源とアンカーを検証します。</p><div role="heading" aria-level="3">ARIA見出し</div><p><a href="#start">先頭へ戻る</a></p></section></body></html>
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<!doctype html><html><meta charset="UTF-8"><title>Second resource</title><h1>別HTML</h1><a href="index.html#second">第二節へ戻る</a></html>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<!doctype html><html><meta charset="UTF-8"><title>Static security fixture</title>
|
||||
<meta http-equiv="refresh" content="1;url=next.html"><style>@import url('http://127.0.0.1:18765/style.css');@font-face{font-family:blocked;src:url('http://127.0.0.1:18765/font.woff')}</style>
|
||||
<h1>Static security fixture</h1><p id="script-marker">SCRIPT DID NOT RUN</p>
|
||||
<script>document.getElementById('script-marker').textContent='SCRIPT EXECUTED';fetch('http://127.0.0.1:18765/script');</script>
|
||||
<img src="http://127.0.0.1:18765/image"><iframe src="file:///etc/passwd"></iframe><iframe src="http://127.0.0.1:18765/frame"></iframe>
|
||||
<form action="http://127.0.0.1:18765/form"><input value="READ ONLY"><button>Submit</button></form>
|
||||
<a href="file:///etc/passwd">Blocked file</a><a href="doc://different-session/index.html">Blocked other session</a>
|
||||
<a href="http://127.0.0.1:18765/external">Explicit external link</a></html>
|
||||
+1
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="ja"><meta charset="UTF-8"><style>body{writing-mode:vertical-rl;height:85vh;line-height:2;font-size:22px}section{min-width:900px}</style><section><h1>縦書き第一節</h1><p>縦書きの読書方向と物理スクロールを分けて検証する。</p></section><section><h2>縦書き第二節</h2><p>章内進捗は右から左へ増加する。</p></section></html>
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"file": "late-layout.ttf",
|
||||
"sha256": "fc0bc6e1390e7af926721b5e8c44768154fc72988282e976df259c5b8785355d",
|
||||
"generator": "generate_late_font.py",
|
||||
"purpose": "Original wide rectangle glyphs for font-swap layout tests"
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"origin": "Original project-authored fixtures; no external documents",
|
||||
"license": "Same as the DocView source repository",
|
||||
"sha256": {
|
||||
"epub2-ncx.epub": "87b3e80e406210c0afa99021ab5fa441f5551813f6ded8b6fb41d8dda6085e84",
|
||||
"fixed-mixed.epub": "ec2e13c4d942118de7a2875096cdaa0919d846ec80972700d2126494f6621d6d",
|
||||
"html/assets/local.svg": "3c56a229973afc2920450570c9ef0c83e4f741e62f28a704e814a43456da8982",
|
||||
"html/assets/style.css": "fd088b6dd813329f5175de02daeb02eaad54245426288d08acf37debb5d66157",
|
||||
"html/index.html": "dea8f12f6b2569e6849325554171682009acd07e9040f1b22fe743067561b8b1",
|
||||
"html/next.html": "e7819fc5a50e4b546422c49bd375f2de234f81a229c5f2d38e8ff113c78bfa91",
|
||||
"html/security.html": "b695a45530dd6fa2a545e9356066db5da074e3dbbb57635250526365e67e8ae0",
|
||||
"html/vertical.html": "a76fea2bde5ca00be4930aa8f9cb1eb5ea36ad56362021bcdab7686b7266aac9",
|
||||
"html-book.zip": "23f3eac7886f79964e26990b1b3d5e90428f363f47109fc37fdaf570c8e31984",
|
||||
"html-entry-choice.zip": "3e35722b80758a9132f08def24a10c8b99e90e39f0c18ae3a90537f2e7a7ae62",
|
||||
"reflow-rtl.epub": "7ca4ae56b08912b50657547238c9f71367105c8604ba6a8c537c900996ef4746",
|
||||
"unsafe-traversal.zip": "b80e7c6c46e9e51d91750a67672700e8112ae7e3e915a3dc36df1b8234c2f391"
|
||||
}
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user