summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssTransformComponent-toMatrix-relative-units.html
blob: 432943b6da03c1ea6587587007cc9e778096db86 (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
<!doctype html>
<meta charset="utf-8">
<title>CSSTransformComponent.toMatrix with Relative Units</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-csstransformcomponent-tomatrix">
<meta name="assert" content="Test CSSTransformComponent.toMatrix throws when given relative units" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<script>
'use strict';

test(() => {
  assert_throws_js(TypeError, () => {
    return new CSSTranslate(
      new CSSUnitValue(1, 'px'),
      new CSSUnitValue(1, 'em')
    ).toMatrix();
  });
}, 'CSSTranslate.toMatrix() containing relative units throws TypeError');

test(() => {
  assert_throws_js(TypeError, () => {
    return new CSSPerspective(new CSSUnitValue(1, 'em')).toMatrix();
  });
}, 'CSSPerspective.toMatrix() containing relative units throws TypeError');

</script>