From 0d57a1d6378148be01a879b8f318e704c21a7625 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 22 Dec 2010 16:30:38 +1300 Subject: [PATCH] Bug 620295 - Give SVGAElement objects an href property in JS r=jwatt a=roc --- content/svg/content/src/nsSVGAElement.cpp | 3 +- content/svg/content/test/Makefile.in | 6 ++ .../svg/content/test/a_href_destination.svg | 3 + content/svg/content/test/a_href_helper_01.svg | 5 + .../svg/content/test/a_href_helper_02_03.svg | 5 + content/svg/content/test/a_href_helper_04.svg | 6 ++ content/svg/content/test/test_a_href_01.xhtml | 92 +++++++++++++++++++ content/svg/content/test/test_a_href_02.xhtml | 38 ++++++++ dom/base/nsDOMClassInfo.cpp | 1 + 9 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 content/svg/content/test/a_href_destination.svg create mode 100644 content/svg/content/test/a_href_helper_01.svg create mode 100644 content/svg/content/test/a_href_helper_02_03.svg create mode 100644 content/svg/content/test/a_href_helper_04.svg create mode 100644 content/svg/content/test/test_a_href_01.xhtml create mode 100644 content/svg/content/test/test_a_href_02.xhtml diff --git a/content/svg/content/src/nsSVGAElement.cpp b/content/svg/content/src/nsSVGAElement.cpp index 53f9fa2edc4..5e6e663f05b 100644 --- a/content/svg/content/src/nsSVGAElement.cpp +++ b/content/svg/content/src/nsSVGAElement.cpp @@ -63,11 +63,12 @@ NS_IMPL_RELEASE_INHERITED(nsSVGAElement, nsSVGAElementBase) DOMCI_NODE_DATA(SVGAElement, nsSVGAElement) NS_INTERFACE_TABLE_HEAD(nsSVGAElement) - NS_NODE_INTERFACE_TABLE6(nsSVGAElement, + NS_NODE_INTERFACE_TABLE7(nsSVGAElement, nsIDOMNode, nsIDOMElement, nsIDOMSVGElement, nsIDOMSVGAElement, + nsIDOMSVGURIReference, nsILink, Link) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAElement) diff --git a/content/svg/content/test/Makefile.in b/content/svg/content/test/Makefile.in index c3b538878fc..2ed481e8a16 100644 --- a/content/svg/content/test/Makefile.in +++ b/content/svg/content/test/Makefile.in @@ -83,6 +83,12 @@ _TEST_FILES = \ test_viewport.html \ zoom-helper.svg \ test_zoom.xhtml \ + test_a_href_01.xhtml \ + test_a_href_02.xhtml \ + a_href_destination.svg \ + a_href_helper_01.svg \ + a_href_helper_02_03.svg \ + a_href_helper_04.svg \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/svg/content/test/a_href_destination.svg b/content/svg/content/test/a_href_destination.svg new file mode 100644 index 00000000000..43e4c812f4b --- /dev/null +++ b/content/svg/content/test/a_href_destination.svg @@ -0,0 +1,3 @@ + + + diff --git a/content/svg/content/test/a_href_helper_01.svg b/content/svg/content/test/a_href_helper_01.svg new file mode 100644 index 00000000000..8f33cea4049 --- /dev/null +++ b/content/svg/content/test/a_href_helper_01.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/content/svg/content/test/a_href_helper_02_03.svg b/content/svg/content/test/a_href_helper_02_03.svg new file mode 100644 index 00000000000..af4b7e27360 --- /dev/null +++ b/content/svg/content/test/a_href_helper_02_03.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/content/svg/content/test/a_href_helper_04.svg b/content/svg/content/test/a_href_helper_04.svg new file mode 100644 index 00000000000..50aca288987 --- /dev/null +++ b/content/svg/content/test/a_href_helper_04.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/content/svg/content/test/test_a_href_01.xhtml b/content/svg/content/test/test_a_href_01.xhtml new file mode 100644 index 00000000000..0579030f0a2 --- /dev/null +++ b/content/svg/content/test/test_a_href_01.xhtml @@ -0,0 +1,92 @@ + + + + Test that activating SVG 'a' elements navigate to their xlink:href + + + + + +Mozilla Bug 620295 +

+ +
+
+
+ + diff --git a/content/svg/content/test/test_a_href_02.xhtml b/content/svg/content/test/test_a_href_02.xhtml new file mode 100644 index 00000000000..ca8a84cc046 --- /dev/null +++ b/content/svg/content/test/test_a_href_02.xhtml @@ -0,0 +1,38 @@ + + + + Test that the href property reflects xlink:href="" on 'a' elements + + + + + +Mozilla Bug 620295 +

+
+ + + +
+
+
+
+ + diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index b35bf93be12..c75263d5f61 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -3055,6 +3055,7 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SVGAElement, nsIDOMSVGAElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAElement) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference) DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END