summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/aspect-ratio-inheritance.html
blob: 76e50429b922916f91e34a910378e9f50c160af6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<div style="-webkit-aspect-ratio: 1 / 2;">
  <div id="aspectRatioTest"></div>
</div>
<script>
    function testComputedValue(elementId, value, styleAttribute)
    {
        var div = document.getElementById(elementId);
        div.style[styleAttribute] = value;
        var computedValue = window.getComputedStyle(div)[styleAttribute];
        return computedValue;
    }
    shouldBeEqualToString('testComputedValue("aspectRatioTest", "1 / 4", "-webkit-aspect-ratio")', '1/4');
    shouldBeEqualToString('testComputedValue("aspectRatioTest", "inherit", "-webkit-aspect-ratio")', '1/2');
    shouldBeEqualToString('testComputedValue("aspectRatioTest", "none", "-webkit-aspect-ratio")', 'none');
</script>
<script src="../../fast/js/resources/js-test-post.js"></script>