From fdd78fad19ea3390cd96971cd29430e36378d137 Mon Sep 17 00:00:00 2001 From: Oleg Date: Sun, 12 Jan 2014 23:44:07 +0400 Subject: [PATCH] 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. --- src/attributes/val.js | 8 -------- test/unit/attributes.js | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/attributes/val.js b/src/attributes/val.js index 6fc4a84bb..ca5fa0838 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -71,14 +71,6 @@ jQuery.fn.extend({ jQuery.extend({ 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: { get: function( elem ) { var value, option, diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 548c6f318..7fc604470 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -1445,3 +1445,12 @@ test( "coords returns correct values in IE6/IE7, see #10828", function() { area = map.html("a").find("area"); 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( "