summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-typed-om/stylevalue-serialization/cssStyleValue-string.html
blob: 747635d319471094d93fd399f60e05a116873276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!doctype html>
<meta charset="utf-8">
<title>CSSStyleValue serialization from parsing</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#stylevalue-serialization">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';

test(() => {
  const result = CSSStyleValue.parse('color', 'red');
  assert_equals(result.toString(), 'red');
}, 'CSSStyleValue parsed from string serializes to given string');

test(() => {
  const result = CSSStyleValue.parse('background', 'blue');
  assert_equals(result.toString(), 'blue');
}, 'Shorthand CSSStyleValue parsed from string serializes to given string');

</script>