Skip to content

Commit da02e19

Browse files
mikesherovdmethvin
authored andcommitted
Fixes #10828, .attr("coords") returns undefined in IE7
1 parent 5642626 commit da02e19

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ if ( !getSetAttribute ) {
524524

525525
fixSpecified = {
526526
name: true,
527-
id: true
527+
id: true,
528+
coords: true
528529
};
529530

530531
// Use this for any attribute in IE6/7

test/unit/attributes.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,3 +1176,16 @@ test("contents().hasClass() returns correct values", function() {
11761176
ok( $contents.hasClass("foo"), "Found 'foo' in $contents" );
11771177
ok( !$contents.hasClass("undefined"), "Did not find 'undefined' in $contents (correctly)" );
11781178
});
1179+
1180+
test("coords returns correct values in IE6/IE7, see #10828", function() {
1181+
expect(2);
1182+
1183+
var map = jQuery("<map />"),
1184+
area;
1185+
1186+
area = map.html("<area shape='rect' coords='0,0,0,0' href='#' alt='a' />").find("area");
1187+
equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly");
1188+
1189+
area = map.html("<area shape='rect' href='#' alt='a' /></map>").find("area");
1190+
equal( area.attr("coords"), undefined, "did not retrieve coords correctly");
1191+
});

0 commit comments

Comments
 (0)