Skip to content

Commit e8c6cbf

Browse files
mrobinsonservo-wpt-sync
authored andcommitted
layout: Normalize the input to euclid's rotation function when creating reference frames
The rotation values we get from Stylo are unnormalized, yet euclid expects them to be[^1]. This change enusures that before we give the rotation values to euclid we normalize them. Lucikly, Stylo already has normalization functionality available so we can reuse it. [^1]: https://github.com/servo/euclid/blob/main/src/rotation.rs#L276 Signed-off-by: Martin Robinson <mrobinson@abandonedwig.info>
1 parent f01d00b commit e8c6cbf

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>CSS Transforms: User agents should properly normalize parameters to 3D `rotate`</title>
5+
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions">
6+
<link rel="author" title="Martin Robinson" href="mrobinson@igalia.com" />
7+
<link rel="match" href="/css/reference/ref-filled-green-100px-square.xht">
8+
<style type="text/css">
9+
.rotated {
10+
background-color: green;
11+
rotate: 2 0 0 180deg;
12+
height: 100px;
13+
width: 100px;
14+
}
15+
</style>
16+
</head>
17+
<body>
18+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
19+
<div class="rotated"></div>
20+
</body>
21+
</html>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<link rel="help" href="https://github.com/servo/servo/issues/36870">
3+
<style>
4+
#outer {
5+
overflow-x: clip;
6+
}
7+
#inner {
8+
display: inline-block;
9+
rotate: 672 1 4096 180deg;
10+
overflow-x: clip;
11+
filter: contrast(0%);
12+
}
13+
</style>
14+
<div id="outer">
15+
<div id="inner">
16+
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
17+
</div>
18+
</div>

0 commit comments

Comments
 (0)