Tests: Import a bunch of WPT tests from /css/css-transforms

This commit is contained in:
Andreas Kling
2024-11-22 16:02:24 +01:00
committed by Andreas Kling
parent b64ccb95ec
commit d6f7fccf49
Notes: github-actions[bot] 2024-11-22 19:08:01 +00:00
34 changed files with 1752 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Individual transform: combine individual transform properties</title>
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#individual-transforms">
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#ctm">
<style>
.block {
display: inline-block;
width: 50px;
height: 50px;
margin: 50px;
padding: 0;
transform-origin: center center;
background: lime;
transform: rotate(90deg) scale(2, 1);
}
</style>
</head>
<body>
<div>
<div class="block"></div>
<div class="block"></div>
</div>
<div>
<div class="block"></div>
<div class="block"></div>
</div>
<div>
<div class="block"></div>
<div class="block"></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Individual transform: combine individual transform properties</title>
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#individual-transforms">
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#ctm">
<style>
@keyframes anim {
to {
transform: translate(50px, 50px) rotate(45deg) scale(2, 1);
}
}
.block {
display: inline-block;
width: 50px;
height: 50px;
margin: 50px;
padding: 0;
transform-origin: 0 0;
background: lime;
/* Freeze the animation at the midpoint. */
animation-timing-function: cubic-bezier(0, 1, 1, 0);
animation-duration: 1000000s;
animation-delay: -500000s;
animation-name: anim;
}
</style>
</head>
<body>
<div>
<div class="block"></div>
<div class="block"></div>
</div>
<div>
<div class="block"></div>
<div class="block"></div>
</div>
<div>
<div class="block"></div>
<div class="block"></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Individual transform: compare individual transform with transform functions</title>
<link rel="author" title="CJ Ku" href="mailto:cku@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#individual-transforms">
<meta name="assert" content="Tests whether individaul transform works correctlyi by compare the rendering result with transfrom functions of the 'transform' property."/>
<style>
div {
position: fixed;
width: 100px;
height: 100px;
transform-origin: 0 0;
border-style: solid;
border-width: 10px 0px 10px 0px;
border-color: lime;
}
.row_1 {
top: 100px;
}
.scale_1{
left: 100px;
width: 50px;
height: 100px;
transform: scale(2, 2);
}
.translate_1 {
left: 150px;
transform: translateX(150px);
}
.rotate_1 {
left: 450px;
transform-origin: 50% 50%;
transform: rotate(90deg);
}
.row_2 {
top: 250px;
}
.scale_2{
left: 100px;
width: 50px;
height: 50px;
transform: scale(2, 2);
}
.translate_2 {
left: 150px;
top: 200px;
transform: translate(150px, 50px);
}
.rotate_2 {
left: 450px;
transform-origin: 50% 50%;
transform: rotate3d(1, 0, 0, 45deg);
}
.row_3 {
transform: perspective(500px);
top: 400px;
}
.scale_3{
left: 100px;
width: 50px;
height: 50px;
transform: scale3d(2, 2, 2);
}
.translate_3 {
left: 150px;
transform: translate3d(150px, 10px, 10px);
}
.rotate_3 {
left: 450px;
transform-origin: 50% 50%;
transform: rotate3d(0, 1, 0, 45deg);
}
</style>
</head>
<body>
<div class="scale_1 row_1"></div>
<div class="translate_1 row_1"></div>
<div class="rotate_1 row_1"></div>
<div class="scale_2 row_2"></div>
<div class="translate_2 row_2"></div>
<div class="rotate_2 row_2"></div>
<div class="scale_3 row_3"></div>
<div class="translate_3 row_3"></div>
<div class="rotate_3 row_3"></div>
</body>
</html>

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Individual transform: combine individual transform properties</title>
<link rel="author" title="CJ Ku" href="mailto:cku@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#individual-transforms">
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#ctm">
<meta name="assert" content="Tests that we combine transforms in the correct order."/>
<style>
div {
position: fixed;
width: 100px;
height: 100px;
top: 200px;
left: 200px;
transform-origin: 0 0;
border-style: solid;
border-width: 10px 0px 10px 0px;
border-color: lime;
transform: translate(50px, 50px) rotate(45deg) scale(2, 2);
}
</style>
</head>
<body>
<div></div>
</body>
</html>

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>
Reference: Individual transform properties' animations create stacking context in delay phase
</title>
<style>
#back {
height: 100px;
width: 100px;
position: fixed;
background: green;
margin-top: 50px;
}
#test {
width: 100px;
height: 100px;
background: blue;
will-change: transform;
}
</style>
</head>
<body>
<div id="back"></div>
<div id="test"></div>
</body>
</html>

View File

@@ -0,0 +1,3 @@
<!DOCTYPE html>
<p>There should be a green 200x200 rectangle below, and no red.</p>
<div style="width: 200px; height: 200px; background-color: green"></div>