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 423058 140171ba59ecab3326002a269b21e25d1b1b64c0
parent 423057 3bcd8efdd376d4d3dfcc5dda64631f048417c661
child 423059 0d32624a93df3ec459fe3eccf116f2575705ef08
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1381235, 868975
milestone56.0a1
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
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.