Commit ca5bc202 authored by timmywil's avatar timmywil

IE9's support for SVG elements unfortunately does not extend to...

IE9's support for SVG elements unfortunately does not extend to clearAttributes. Checks for its presence before proceeding.
parent 149a0407
...@@ -388,11 +388,15 @@ function cloneFixAttributes( src, dest ) { ...@@ -388,11 +388,15 @@ function cloneFixAttributes( src, dest ) {
// clearAttributes removes the attributes, which we don't want, // clearAttributes removes the attributes, which we don't want,
// but also removes the attachEvent events, which we *do* want // but also removes the attachEvent events, which we *do* want
dest.clearAttributes(); if ( dest.clearAttributes ) {
dest.clearAttributes();
}
// mergeAttributes, in contrast, only merges back on the // mergeAttributes, in contrast, only merges back on the
// original attributes, not the events // original attributes, not the events
dest.mergeAttributes(src); if ( dest.mergeAttributes ) {
dest.mergeAttributes( src );
}
// IE6-8 fail to clone children inside object elements that use // IE6-8 fail to clone children inside object elements that use
// the proprietary classid attribute value (rather than the type // the proprietary classid attribute value (rather than the type
......
...@@ -285,7 +285,7 @@ test("attr(String, Object)", function() { ...@@ -285,7 +285,7 @@ test("attr(String, Object)", function() {
equals( "button", button.attr("type"), "Verify that you can't change the type of a button element" ); equals( "button", button.attr("type"), "Verify that you can't change the type of a button element" );
// Setting attributes on svg elements (bug #3116) // Setting attributes on svg elements (bug #3116)
var $svg = jQuery("<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' baseProfile='full' width='3000' height='3000'>" var $svg = jQuery("<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' baseProfile='full' width='200' height='200'>"
+ "<circle cx='200' cy='200' r='150' />" + "<circle cx='200' cy='200' r='150' />"
+ "</svg>").appendTo("body"); + "</svg>").appendTo("body");
equals( $svg.attr("cx", 100).attr("cx"), "100", "Set attribute on svg element" ); equals( $svg.attr("cx", 100).attr("cx"), "100", "Set attribute on svg element" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment