Skip to content
Permalink
Browse files
Fix #10299. Add a propHook for oldIE link href.
  • Loading branch information
dmethvin committed Nov 2, 2012
1 parent 9c2f000 commit 240b141a22c4783d619fc67c91f990d1535e7c57
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
@@ -562,6 +562,7 @@ if ( !getSetAttribute ) {


// Some attributes require a special call on IE
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
@@ -571,6 +572,13 @@ if ( !jQuery.support.hrefNormalized ) {
}
});
});

// link's href property should get the full normalized URL (#10299)
jQuery.propHooks.href = {
get: function( elem, name ) {
return elem.getAttribute( name, 4 );
}
};
}

if ( !jQuery.support.style ) {
@@ -54,7 +54,7 @@ test( "jQuery.propFix integrity test", function() {
});

test( "attr(String)", function() {
expect( 46 );
expect( 47 );

equal( jQuery("#text1").attr("type"), "text", "Check for type attribute" );
equal( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" );
@@ -92,6 +92,8 @@ test( "attr(String)", function() {
"href": "#5"
}).appendTo("#qunit-fixture");
equal( jQuery("#tAnchor5").attr("href"), "#5", "Check for non-absolute href (an anchor)" );
jQuery("<a id='tAnchor6' href='#5' />").appendTo("#qunit-fixture");
equal( jQuery("#tAnchor5").prop("href"), jQuery("#tAnchor6").prop("href"), "Check for absolute href prop on an anchor" );

// list attribute is readonly by default in browsers that support it
jQuery("#list-test").attr( "list", "datalist" );

3 comments on commit 240b141

@aFarkas
Copy link

@aFarkas aFarkas commented on 240b141 Nov 17, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, just saw, that this little bug is fixed now. Can you also add the exact same propHook for the src property?

@dmethvin
Copy link
Member Author

@dmethvin dmethvin commented on 240b141 Nov 17, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aFarkas, can you create a ticket for that?

@aFarkas
Copy link

@aFarkas aFarkas commented on 240b141 Nov 18, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.