Bug 1544432 part 2: Add WPT for text being scaled up via SVG viewBox. r=longsonr

--HG--
extra : rebase_source : f1bf953add83bbe6781112eee0973bdc59239f15
This commit is contained in:
Daniel Holbert 2019-06-21 10:16:08 -07:00
parent 3dc2f0f450
commit 395362fcd6
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Reference case for text scaled via SVG viewBox</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<style>
body { margin: 0; }
svg {
width: 100px;
height: 100px;
background: red;
}
rect {
fill: lime;
}
</style>
</head>
<body>
<svg>
<rect height="100%" width="100%"></rect>
</svg>
</body>

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Testcase for text scaled via SVG viewBox</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="help" href="https://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute">
<link rel="match" href="support/viewBox-scaling-text-001-ref.html">
<style>
body { margin: 0; }
svg {
width: 100px;
height: 100px;
background: red;
}
text {
fill: lime;
font: 1px/1 Ahem;
}
</style>
</head>
<body>
<!-- We position the <text> at y=0.8px, which is the alphabetic baseline for
the Ahem font. This puts the bottom of the rendered square glyph at
y=1px, i.e. the bottom of the SVG viewport. With that, the 1px-tall Ahem
square 'X' character should fully fill the SVG viewport (which is then
scaled up from 1x1 to 100x100). -->
<svg viewBox="0 0 1 1">
<text x="0" y="0.8">X̂̂̂̂̂̂</text>
</svg>
</body>