Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.
  • Loading branch information...
commit fdd78fad19ea3390cd96971cd29430e36378d137 1 parent 38c122a
Oleg Gaidarenko markelog authored

Showing 2 changed files with 9 additions and 8 deletions. Show diff stats Hide diff stats

  1. +0 8 src/attributes/val.js
  2. +9 0 test/unit/attributes.js
8 src/attributes/val.js
@@ -71,14 +71,6 @@ jQuery.fn.extend({
71 71
72 72 jQuery.extend({
73 73 valHooks: {
74   - option: {
75   - get: function( elem ) {
76   - // attributes.value is undefined in Blackberry 4.7 but
77   - // uses .value. See #6932
78   - var val = elem.attributes.value;
79   - return !val || val.specified ? elem.value : elem.text;
80   - }
81   - },
82 74 select: {
83 75 get: function( elem ) {
84 76 var value, option,
9 test/unit/attributes.js
@@ -1445,3 +1445,12 @@ test( "coords returns correct values in IE6/IE7, see #10828", function() {
1445 1445 area = map.html("<area shape='rect' coords='0,0,0,0' href='#' alt='a' />").find("area");
1446 1446 equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" );
1447 1447 });
  1448 +
  1449 +test( "should not throw at $(option).val() (#14686)", 1, function() {
  1450 + try {
  1451 + jQuery( "<option/>" ).val();
  1452 + ok( true );
  1453 + } catch ( _ ) {
  1454 + ok( false );
  1455 + }
  1456 +});

0 comments on commit fdd78fa

Please sign in to comment.
Something went wrong with that request. Please try again.