mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Attrs: Remove outdated valHook for option element
This hook was relevant for BlackBerry 4.7 which is no longer supported. But this code path now raises error in IE10-11 (#14686) in 1.x-master branch. So to just to be safe, also add test for IE issue to this branch too.
This commit is contained in:
parent
38c122a73a
commit
fdd78fad19
@ -71,14 +71,6 @@ jQuery.fn.extend({
|
|||||||
|
|
||||||
jQuery.extend({
|
jQuery.extend({
|
||||||
valHooks: {
|
valHooks: {
|
||||||
option: {
|
|
||||||
get: function( elem ) {
|
|
||||||
// attributes.value is undefined in Blackberry 4.7 but
|
|
||||||
// uses .value. See #6932
|
|
||||||
var val = elem.attributes.value;
|
|
||||||
return !val || val.specified ? elem.value : elem.text;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
select: {
|
select: {
|
||||||
get: function( elem ) {
|
get: function( elem ) {
|
||||||
var value, option,
|
var value, option,
|
||||||
|
@ -1445,3 +1445,12 @@ test( "coords returns correct values in IE6/IE7, see #10828", function() {
|
|||||||
area = map.html("<area shape='rect' coords='0,0,0,0' href='#' alt='a' />").find("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" );
|
equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test( "should not throw at $(option).val() (#14686)", 1, function() {
|
||||||
|
try {
|
||||||
|
jQuery( "<option/>" ).val();
|
||||||
|
ok( true );
|
||||||
|
} catch ( _ ) {
|
||||||
|
ok( false );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user