Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: third_party/WebKit/LayoutTests/svg/css/anchor-change-href.svg

Issue 1484083005: Invalidate visited state changes for svg links. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/css/anchor-change-href-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/css/anchor-change-href.svg
diff --git a/third_party/WebKit/LayoutTests/svg/css/anchor-change-href.svg b/third_party/WebKit/LayoutTests/svg/css/anchor-change-href.svg
new file mode 100644
index 0000000000000000000000000000000000000000..b460a4c86619c20fd9e8531f292659358a90a2be
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/css/anchor-change-href.svg
@@ -0,0 +1,43 @@
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <style>
+ :link { fill: red }
+ :visited { fill: green }
+ </style>
+ <a xlink:href="http://notvisited" name="x">
+ <text x="20" y="40">This text should be green</text>
+ </a>
+ <text x="20" y="60" id="result1">Not run (requires window.internals).</text>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ window.location.hash = "#x";
+
+ requestAnimationFrame(function(){
+
+ // Change href from non-visited to visited link.
+ getComputedStyle(document.documentElement);
+ document.querySelector("a").setAttribute("xlink:href", "#x");
+
+ if (window.internals) {
+ var resultText = document.getElementById("result1").firstChild;
+ var elementCount = internals.updateStyleAndReturnAffectedElementCount();
+
+ // The elementCount should have been 2, but visited links are
fs 2015/12/01 13:32:58 This has a dodgy feel to it, but I guess we can pr
+ // not recognized in content_shell, thus the text color doesn't
+ // change and an inheritance propagation to text element is not
+ // necessary. Running this test in Chrome will cause a 2-element
+ // recalc and green text as expected.
+ if (elementCount == 1)
+ resultText.data = "PASS";
+ else
+ resultText.data = "FAIL: " + elementCount;
+ }
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+ </script>
+</svg>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/css/anchor-change-href-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698