Skip to content

Commit

Permalink
range input type optimizations from bryan forbes over in has.js
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Oct 15, 2010
1 parent 999daa2 commit b1a71c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ window.Modernizr = (function(window,doc,undefined){

// Big thx to @miketaylr for the html5 forms expertise. http://miketaylr.com/
ret['inputtypes'] = (function(props) {
for (var i = 0,bool,len=props.length;i<len;i++) {
for (var i = 0, bool, len=props.length ; i < len ; i++) {

f.setAttribute('type', props[i]);
bool = f.type !== 'text';

Expand All @@ -756,10 +757,11 @@ window.Modernizr = (function(window,doc,undefined){
if (/^range$/.test(f.type) && f.style.WebkitAppearance !== undefined){

docElement.appendChild(f);
var defaultView = doc.defaultView;

// Safari 2-4 allows the smiley as a value, despite making a slider
bool = doc.defaultView.getComputedStyle &&
doc.defaultView.getComputedStyle(f, null).WebkitAppearance !== 'textfield' &&
bool = defaultView.getComputedStyle &&
defaultView.getComputedStyle(f, null).WebkitAppearance !== 'textfield' &&

// mobile android web browser has false positive, so must
// check the height to see if the widget is actually there.
Expand Down

0 comments on commit b1a71c2

Please sign in to comment.