Bug 1381235 - add reftest for transitioning on visited links. draft
authorJeremy Chen <jeremychen@mozilla.com>
Fri, 28 Jul 2017 16:52:53 +0800
changeset 618238 84ebf8d04a373d1533e8ad307960e17a687ef908
parent 617246 5845151f1a2cd00957fdd48e204542ccbdfaba1e
child 640001 9b6d3a2de05f30ac2d8c85f84ccddec16b6924cf
push id71258
push userbmo:jeremychen@mozilla.com
push dateMon, 31 Jul 2017 01:44:37 +0000
bugs1381235, 868975
milestone56.0a1
Bug 1381235 - add reftest for transitioning on visited links. 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
layout/reftests/css-visited/transition-on-visited-ref.html
layout/reftests/css-visited/transition-on-visited.html
layout/style/test/moz.build
layout/style/test/test_visited_reftests.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-visited/transition-on-visited-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span {
+  color: rgb(128, 0, 128);
+}
+</style>
+</head>
+<body>
+<span>Visited Link</span>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-visited/transition-on-visited.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1381235
+-->
+<head>
+<title>Test for Bug 1381235</title>
+<style>
+a {
+  text-decoration: none;
+  color: rgb(255, 0, 0);
+  transition: color 1000s steps(2, start);
+}
+</style>
+</head>
+<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)";
+}
+</script>
+</body>
+</html>
--- 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/selector-descendant-2.xhtml',
     '/layout/reftests/css-visited/subject-of-selector-1-ref.html',
     '/layout/reftests/css-visited/subject-of-selector-adj-sibling-1.html',
     '/layout/reftests/css-visited/subject-of-selector-any-sibling-1.html',
     '/layout/reftests/css-visited/subject-of-selector-child-1.html',
     '/layout/reftests/css-visited/subject-of-selector-descendant-1.html',
     '/layout/reftests/css-visited/subject-of-selector-descendant-2-ref.xhtml',
     '/layout/reftests/css-visited/subject-of-selector-descendant-2.xhtml',
+    '/layout/reftests/css-visited/transition-on-visited-ref.html',
+    '/layout/reftests/css-visited/transition-on-visited.html',
     '/layout/reftests/css-visited/visited-inherit-1-ref.html',
     '/layout/reftests/css-visited/visited-inherit-1.html',
     '/layout/reftests/css-visited/visited-page.html',
     '/layout/reftests/css-visited/white-to-transparent-1-ref.html',
     '/layout/reftests/css-visited/white-to-transparent-1.html',
     '/layout/reftests/css-visited/width-1-ref.html',
     '/layout/reftests/css-visited/width-on-link-1.html',
     '/layout/reftests/css-visited/width-on-visited-1.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.