Skip to content

Commit 38c4342

Browse files
nt1mnullhook
andauthored
WebKit export: SVGLengthValue includes zoom when resolving rem and em units (#55802)
https://bugs.webkit.org/show_bug.cgi?id=298102 Co-authored-by: Taher Ali <[email protected]>
1 parent 5e1927c commit 38c4342

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!doctype html>
2+
<link rel="stylesheet" href="/fonts/ahem.css">
3+
<style>
4+
:root {
5+
font: 10px/1 Ahem;
6+
}
7+
body { margin: 0 }
8+
.container {
9+
font-size: 20px;
10+
}
11+
line {
12+
stroke-width: 8px;
13+
stroke: lime;
14+
}
15+
svg {
16+
background-color: black;
17+
}
18+
</style>
19+
<div class="container">
20+
<svg width=400 height=400>
21+
<line y1=40 y2=40 x1=0 x2=80 />
22+
<line y1=120 y2=120 x1=0 x2=80 />
23+
<line y1=140 y2=140 x1=0 x2=80 />
24+
25+
<line y1=220 y2=220 x1=0 x2=40 />
26+
<line y1=240 y2=240 x1=0 x2=40 />
27+
<line y1=280 y2=280 x1=0 x2=40 />
28+
<line y1=300 y2=300 x1=0 x2=40 />
29+
</svg>
30+
</div>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!doctype html>
2+
<meta charset="utf-8">
3+
<link rel="help" href="https://drafts.csswg.org/css-viewport/#zoom-property">
4+
<link rel="match" href="svg-font-relative-units-ref.html">
5+
<link rel="stylesheet" href="/fonts/ahem.css">
6+
<style>
7+
:root {
8+
font: 10px/1 Ahem;
9+
zoom: 2;
10+
}
11+
body { margin: 0 }
12+
.container {
13+
font-size: 20px;
14+
}
15+
.child {
16+
zoom: 2;
17+
}
18+
line {
19+
stroke-width: 2px;
20+
stroke: lime;
21+
}
22+
svg {
23+
background-color: black;
24+
}
25+
</style>
26+
<div class="container">
27+
<div class="child">
28+
<svg width=100 height=100>
29+
<!-- Font-relative units -->
30+
<line y1=10 y2=10 x1=0 x2=1em />
31+
<line y1=30 y2=30 x1=0 x2=1ch />
32+
<line y1=35 y2=35 x1=0 x2=1ic />
33+
34+
<!-- Root font-relative units -->
35+
<line y1=55 y2=55 x1=0 x2=1rch />
36+
<line y1=60 y2=60 x1=0 x2=1rem />
37+
<line y1=70 y2=70 x1=0 x2=1ric />
38+
<line y1=75 y2=75 x1=0 x2=1rlh />
39+
</svg>
40+
</div>
41+
</div>

0 commit comments

Comments
 (0)