summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_transitions_at_start.html
blob: 15805bbc090b8d59995c21ca74833073f0f9c3cc (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
31
32
33
34
35
36
37
38
<!doctype html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1380133
-->
<head>
  <meta charset=utf-8>
  <title>Test for transition value at start (Bug 1380133)</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <link rel="stylesheet" href="/resources/testharness.css">
  <style>
    a {
      color: red;
      transition: 100s color;
    }
    a.active {
      color: blue;
    }
  </style>
</head>
<body>
<a id=anchor><span id=span>Test</span></a>
</body>
<script>
'use strict';

const anchor = document.getElementById('anchor');
const span   = document.getElementById('span');

test(() => {
  anchor.classList.add('active');
  assert_equals(getComputedStyle(span).color, 'rgb(255, 0, 0)',
                'The child of a transitioning element should inherit its'
                + ' parent\'s transition start value');
}, 'Transition start value should be inherited');
</script>
</html>