]> source.dussan.org Git - jquery.git/commitdiff
Fixes #10828, .attr("coords") returns undefined in IE7
authorMike Sherov <mike.sherov@gmail.com>
Sat, 25 Feb 2012 20:05:15 +0000 (15:05 -0500)
committerDave Methvin <dave.methvin@gmail.com>
Fri, 2 Mar 2012 16:08:52 +0000 (11:08 -0500)
src/attributes.js
test/unit/attributes.js

index 475f4031e9b40db83f01f688abbfc66352b04ac0..4d15e805471186be123c21b874724d16dc8da2c3 100644 (file)
@@ -524,7 +524,8 @@ if ( !getSetAttribute ) {
 
        fixSpecified = {
                name: true,
-               id: true
+               id: true,
+               coords: true
        };
 
        // Use this for any attribute in IE6/7
index dbfa8c0c12e11c9238f72ac8ee2248b39183873a..5d9a11139e67685e15a372d8b4d4f8879180e46e 100644 (file)
@@ -1176,3 +1176,16 @@ test("contents().hasClass() returns correct values", function() {
        ok( $contents.hasClass("foo"), "Found 'foo' in $contents" );
        ok( !$contents.hasClass("undefined"), "Did not find 'undefined' in $contents (correctly)" );
 });
+
+test("coords returns correct values in IE6/IE7, see #10828", function() {
+       expect(2);
+
+       var map = jQuery("<map />"),
+               area;
+
+       area = map.html("<area shape='rect' coords='0,0,0,0' href='#' alt='a' />").find("area");
+       equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly");
+
+       area = map.html("<area shape='rect' href='#' alt='a' /></map>").find("area");
+       equal( area.attr("coords"), undefined, "did not retrieve coords correctly");
+});