Bug 1380133 - Part 9: Automated test for inheriting the start value of a transition. r=heycam draft
authorBrian Birtles <bbirtles@mozilla.com>
Fri, 21 Jul 2017 11:51:04 +0800
changeset 612851 3e6da1f13dbd2767787d6d9b7f2553949e3d0ad2
parent 612850 ccd58db2c720c6ae3a6e2ec71154921abcaaf06f
child 612852 d9818efdf47e4f8bbafbccd96a66ee4193c2faff
push id69615
push userbmo:cam@mcc.id.au
push dateFri, 21 Jul 2017 03:51:35 +0000
reviewersheycam
bugs1380133, 100644
milestone56.0a1
Bug 1380133 - Part 9: Automated test for inheriting the start value of a transition. r=heycam MozReview-Commit-ID: 6uue8qUePUh --- layout/style/test/mochitest.ini | 1 + layout/style/test/test_transitions_at_start.html | 38 +++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 layout/style/test/test_transitions_at_start.html
layout/style/test/mochitest.ini
layout/style/test/test_transitions_at_start.html
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -282,16 +282,17 @@ skip-if = toolkit == 'android' #bug 7752
 skip-if = !stylo
 [test_stylesheet_clone_font_face.html]
 [test_supports_rules.html]
 [test_system_font_serialization.html]
 [test_text_decoration_shorthands.html]
 [test_transitions_and_reframes.html]
 [test_transitions_and_restyles.html]
 [test_transitions_and_zoom.html]
+[test_transitions_at_start.html]
 [test_transitions_cancel_near_end.html]
 [test_transitions_computed_values.html]
 [test_transitions_computed_value_combinations.html]
 [test_transitions_events.html]
 [test_transitions.html]
 skip-if = (android_version == '18' && debug) # bug 1159532
 [test_transitions_bug537151.html]
 [test_transitions_dynamic_changes.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_transitions_at_start.html
@@ -0,0 +1,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>