Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/cssom-view/HTMLImageElement-x-and-y-ignore-transforms.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" href="mailto:mrobinson@igalia.com.org">
<link rel="help" href="https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlimageelement-interface">
<title>CSS OM View Test: HTMLImageElement's 'x' and 'y' property values should ignore transforms</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
.transformed {
transform: translate(40px, 40px);
}
</style>
<div id="container">
<img id="image" src="/images/green.png">
</div>
<script>
test(() => {
const unTransformedX = image.x;
const unTransformedY = image.y;
container.classList.add("transformed");
assert_equals(unTransformedX, image.x);
assert_equals(unTransformedY, image.y);
}, `HTMLImageElement's 'x' and 'y' property values ignore transforms`);
</script>