Skip to content

Commit

Permalink
Fixes #10828, .attr("coords") returns undefined in IE7
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesherov authored and dmethvin committed Mar 2, 2012
1 parent 5642626 commit da02e19
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/attributes.js
Expand Up @@ -524,7 +524,8 @@ if ( !getSetAttribute ) {


fixSpecified = { fixSpecified = {
name: true, name: true,
id: true id: true,
coords: true
}; };


// Use this for any attribute in IE6/7 // Use this for any attribute in IE6/7
Expand Down
13 changes: 13 additions & 0 deletions test/unit/attributes.js
Expand Up @@ -1176,3 +1176,16 @@ test("contents().hasClass() returns correct values", function() {
ok( $contents.hasClass("foo"), "Found 'foo' in $contents" ); ok( $contents.hasClass("foo"), "Found 'foo' in $contents" );
ok( !$contents.hasClass("undefined"), "Did not find 'undefined' in $contents (correctly)" ); 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");
});

0 comments on commit da02e19

Please sign in to comment.