summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/cssom-view/HTMLImageElement-x-and-y-ignore-transforms.html
blob: 45c79f3672473961d06ff8fc2dba573bf90e330a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!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">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1676952">
<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>