Commit ca5e06a1 authored by aFarkas's avatar aFarkas Committed by Dave Methvin

Fix #12915, add propHook for scrip src property on oldIE. Close gh-1035.

parent 20be650b
...@@ -568,12 +568,14 @@ if ( !jQuery.support.hrefNormalized ) { ...@@ -568,12 +568,14 @@ if ( !jQuery.support.hrefNormalized ) {
}); });
}); });
// link's href property should get the full normalized URL (#10299) // href/src property should get the full normalized URL (#10299/#12915)
jQuery.propHooks.href = { jQuery.each([ "href", "src" ], function( i, name ) {
get: function( elem, name ) { jQuery.propHooks[ name ] = {
get: function( elem ) {
return elem.getAttribute( name, 4 ); return elem.getAttribute( name, 4 );
} }
}; };
});
} }
if ( !jQuery.support.style ) { if ( !jQuery.support.style ) {
......
...@@ -54,7 +54,7 @@ test( "jQuery.propFix integrity test", function() { ...@@ -54,7 +54,7 @@ test( "jQuery.propFix integrity test", function() {
}); });
test( "attr(String)", function() { test( "attr(String)", function() {
expect( 47 ); expect( 48 );
equal( jQuery("#text1").attr("type"), "text", "Check for type attribute" ); equal( jQuery("#text1").attr("type"), "text", "Check for type attribute" );
equal( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" ); equal( jQuery("#radio1").attr("type"), "radio", "Check for type attribute" );
...@@ -95,6 +95,9 @@ test( "attr(String)", function() { ...@@ -95,6 +95,9 @@ test( "attr(String)", function() {
jQuery("<a id='tAnchor6' href='#5' />").appendTo("#qunit-fixture"); 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" ); equal( jQuery("#tAnchor5").prop("href"), jQuery("#tAnchor6").prop("href"), "Check for absolute href prop on an anchor" );
$("<script type='jquery/test' src='#5' id='scriptSrc'></script>").appendTo("#qunit-fixture");
equal( jQuery("#tAnchor5").prop("href"), jQuery("#scriptSrc").prop("src"), "Check for absolute src prop on a script" );
// list attribute is readonly by default in browsers that support it // list attribute is readonly by default in browsers that support it
jQuery("#list-test").attr( "list", "datalist" ); jQuery("#list-test").attr( "list", "datalist" );
equal( jQuery("#list-test").attr("list"), "datalist", "Check setting list attribute" ); equal( jQuery("#list-test").attr("list"), "datalist", "Check setting list attribute" );
......
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