summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/implicit-sizes-ignores-width.html
blob: db61db351eacb5f38ce6767a55a61e588f5580e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!doctype html>
<title>Implicit sizes ignores width</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
img {width: auto;}
</style>
<img srcset="../srcset/resources/image.png 100w" sizes="400px" id="sizes">
<img srcset="../srcset/resources/image.png 100w" width="400" id="width">
<script>
setup({explicit_done:true});
onload = () => {
  test(() => {
    assert_equals(document.getElementById("sizes").width, 400);
    assert_equals(document.getElementById("width").width, window.innerWidth);
    done();
  });
};
</script>