Bug 1073924 - Hovering over links in SVG does not cause cursor to change. r=jwatt, a=sledru
authorRobert Longson <longsonr@gmail.com>
Mon, 29 Sep 2014 09:20:22 +0100
changeset 216879 19338c25065c
parent 216878 3ff9831143fd
child 216880 dabbfa2c0eac
push id3951
push userryanvm@gmail.com
push date2014-09-29 18:48 +0000
treeherdermozilla-beta@19338c25065c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, sledru
bugs1073924
milestone33.0
Bug 1073924 - Hovering over links in SVG does not cause cursor to change. r=jwatt, a=sledru
content/svg/content/test/test_a_href_01.xhtml
layout/style/ua.css
layout/svg/svg.css
--- a/content/svg/content/test/test_a_href_01.xhtml
+++ b/content/svg/content/test/test_a_href_01.xhtml
@@ -52,16 +52,17 @@ function doNavigation() {
   // Test clicking on an <a> whose xlink:href is modified by animation.
   doNavigationTest(4, "a_href_helper_04.svg");
 }
 
 function doNavigationTest(testNumber, initialHref, f) {
   var iframe = document.getElementById("iframe" + testNumber);
   var a = iframe.contentDocument.getElementById("a");
   ok(endsWith(iframe.contentWindow.location, initialHref), "Initial href of test " + testNumber);
+  is("pointer", window.getComputedStyle(a).getPropertyValue("cursor"), "expected pointer cursor");
   iframe.onload = function() {
     ok(endsWith(iframe.contentWindow.location, "a_href_destination.svg"), "Final href of test " + testNumber);
     if (++navigationCount == testCount) {
       SimpleTest.finish();
     }
   };
   if (f) {
     f(a);
--- a/layout/style/ua.css
+++ b/layout/style/ua.css
@@ -78,16 +78,21 @@
   display: inline;
   vertical-align: baseline;
   /* TODO: Replace this with font-variant-numeric:tabular-nums once the
      font-variant-* properties are enabled for all channels (bug 975744). */
   -moz-font-feature-settings: "tnum";
   font-feature-settings: "tnum";
 }
 
+/* SVG documents don't always load this file but they do have links.
+ * If you change the link rules, consider carefully whether to make
+ * the same changes to svg.css.
+ */
+
 /* Links */
 
 *|*:-moz-any-link {
   cursor: pointer;
 }
 
 *|*:-moz-any-link:-moz-focusring {
   /* Don't specify the outline-color, we should always use initial value. */
--- a/layout/svg/svg.css
+++ b/layout/svg/svg.css
@@ -70,15 +70,31 @@ foreignObject {
 
 *|*::-moz-svg-marker-anon-child {
   clip-path: inherit;
   filter: inherit;
   mask: inherit;
   opacity: inherit;
 }
 
-/* nsDocumentViewer::CreateStyleSet doesn't load ua.css for SVG-as-an-image,
- * but SVG-as-an-image needs this rule from that file.
+/* nsDocumentViewer::CreateStyleSet doesn't load ua.css.
+ * A few styles are common to html and SVG though
+ * so we copy the rules below from that file.
+ */
+
+/* Links */
+
+*|*:-moz-any-link {
+  cursor: pointer;
+}
+
+*|*:-moz-any-link:-moz-focusring {
+  /* Don't specify the outline-color, we should always use initial value. */
+  outline: 1px dotted;
+}
+
+/*
+ * SVG-as-an-image needs this rule
  */
 *|*::-moz-viewport, *|*::-moz-viewport-scroll, *|*::-moz-canvas, *|*::-moz-scrolled-canvas {
   display: block !important;
   background-color: inherit;
 }