Bug 1381235 - add reftest for transitioning on visited links. r=hiro
authorJeremy Chen <jeremychen@mozilla.com>
Fri, 28 Jul 2017 16:52:53 +0800
changeset 371940 140171ba59ecab3326002a269b21e25d1b1b64c0
parent 371939 3bcd8efdd376d4d3dfcc5dda64631f048417c661
child 371941 0d32624a93df3ec459fe3eccf116f2575705ef08
push id47628
push userjichen@mozilla.com
push dateMon, 31 Jul 2017 06:15:12 +0000
treeherderautoland@140171ba59ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1381235, 868975
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1381235 - add reftest for transitioning on visited links. r=hiro With this patch, we now have an automated test to verify if a transition is run properly on a visited link. Note that the test aims to verify the behavior in Stylo should match that in Gecko. Due to Bug 868975, we haven't supported transitioning on visited styles yet, so the test should be put in our own repo for now. This test can be tweaked and put into web-platform repo once we resolve Bug 868975. MozReview-Commit-ID: Ci1cERXkIUK
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-visited/transition-on-visited-ref.html
@@ -0,0 +1,13 @@
+span {
+  color: rgb(128, 0, 128);
+<span>Visited Link</span>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-visited/transition-on-visited.html
@@ -0,0 +1,25 @@
+<title>Test for Bug 1381235</title>
+a {
+  text-decoration: none;
+  color: rgb(255, 0, 0);
+  transition: color 1000s steps(2, start);
+<body onload="runTest()">
+<a id="link" href="visited-page.html">Visited Link</a>
+<script type="application/javascript">
+function runTest() {
+  var a = document.getElementById("link");
+  a.style.color = "rgb(0, 0, 255)";
--- a/layout/style/test/moz.build
+++ b/layout/style/test/moz.build
@@ -100,16 +100,18 @@ TEST_HARNESS_FILES.testing.mochitest.tes
+    '/layout/reftests/css-visited/transition-on-visited-ref.html',
+    '/layout/reftests/css-visited/transition-on-visited.html',
--- a/layout/style/test/test_visited_reftests.html
+++ b/layout/style/test/test_visited_reftests.html
@@ -81,16 +81,17 @@ var gTests = [
   // FIXME: commented out because dynamic changes on the non-first-line
   // part of the test don't work right when the link becomes visited.
   //"== first-line-1.html first-line-1-ref.html",
   "== white-to-transparent-1.html white-to-transparent-1-ref.html",
   "== link-root-1.xhtml link-root-1-ref.xhtml",
   "== mathml-links.html mathml-links-ref.html",
   "== placeholder-1.html placeholder-1-ref.html",
   "== visited-inherit-1.html visited-inherit-1-ref.html",
+  "== transition-on-visited.html transition-on-visited-ref.html"
 // We record the maximum number of times we had to look at a test before
 // it switched to the passing state (though we assume it's 10 to start
 // rather than 0 so that we have a reasonable default).  Then we make a
 // test "time out" if it takes more than gTimeoutFactor times that
 // amount of time.  This allows us to report a test failure rather than
 // making a test failure just show up as a timeout.