Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-transforms/change-transform-origin-property.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<title>Change transform-origin property</title>
<link rel="author" title="Philip Rogers" href="mailto:pdr@chromium.org">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<style>
#target {
will-change: transform;
transform: rotate(90deg);
transform-origin: 100px 100px;
width: 100px;
height: 100px;
background: green;
}
#container {
width: 100px;
height: 100px;
background: red;
}
</style>
<p>Test passes if there is a filled green square.</p>
<div id="container">
<div id="target"></div>
</div>
<script>
requestAnimationFrame(() => {
requestAnimationFrame(() => {
target.style.transformOrigin = '50px 50px';
document.documentElement.removeAttribute('class');
});
});
</script>