Skip to content

Commit a16c9f7

Browse files
committed
Merge branch 'grunt' of https://github.com/sindresorhus/Modernizr into sindresorhus-grunt
* 'grunt' of https://github.com/sindresorhus/Modernizr: Close GH-1: Match Modernizr's current style as close as possible!. Forgot to remove the old build script Add grunt Conflicts: modernizr.js
2 parents 928edb7 + b389d0b commit a16c9f7

17 files changed

+150
-89
lines changed

compress.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

feature-detects/canvas-todataurl-type.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
});
2525
};
2626

27-
image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg=='
27+
image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==';
2828
}());

feature-detects/cors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// cors
22
// By Theodoor van Donge
3-
Modernizr.addTest('cors', 'withCredentials' in new XMLHttpRequest);
3+
Modernizr.addTest('cors', 'withCredentials' in new XMLHttpRequest());

feature-detects/css-calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ Modernizr.addTest('csscalc', function(el, prop, value) {
55
prop = 'width:';
66
value = 'calc(10px);';
77
el = document.createElement('div');
8-
el.style.cssText = prop + Modernizr._prefixes.join(value + prop)
8+
el.style.cssText = prop + Modernizr._prefixes.join(value + prop);
99
return !!el.style.length;
1010
});

feature-detects/css-cubicbezierrange.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// By @calvein
33

44
Modernizr.addTest('cubicbezierrange', function() {
5-
el = document.createElement('div');
5+
var el = document.createElement('div');
66
el.style.cssText = Modernizr._prefixes.join('transition-timing-function' + ':cubic-bezier(1,0,0,1.1); ');
77
return !!el.style.length;
88
});

feature-detects/css-hyphens.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/* see http://davidnewton.ca/the-current-state-of-hyphenation-on-the-web
2-
http://davidnewton.ca/demos/hyphenation/test.html
1+
/* see http://davidnewton.ca/the-current-state-of-hyphenation-on-the-web
2+
http://davidnewton.ca/demos/hyphenation/test.html
33
44
55
There are three tests:
6-
1. csshyphens - tests hyphens:auto actually adds hyphens to text
7-
2. softhyphens - tests that ­ does its job
8-
3. softhyphensfind - tests that in-browser Find functionality still works correctly with ­
6+
1. csshyphens - tests hyphens:auto actually adds hyphens to text
7+
2. softhyphens - tests that ­ does its job
8+
3. softhyphensfind - tests that in-browser Find functionality still works correctly with ­
99
10-
These tests currently require document.body to be present
10+
These tests currently require document.body to be present
1111
12-
Hyphenation is language specific, sometimes.
12+
Hyphenation is language specific, sometimes.
1313
See for more details: http://code.google.com/p/hyphenator/source/diff?spec=svn975&r=975&format=side&path=/trunk/Hyphenator.js#sc_svn975_313
1414
1515
If loading Hyphenator.js via Modernizr.load, be cautious of issue 158: http://code.google.com/p/hyphenator/issues/detail?id=158
@@ -21,7 +21,7 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
2121
(function() {
2222

2323
if (!document.body){
24-
window.console && console.warn('document.body doesn\'t exist. Modernizr hyphens test needs it.')
24+
window.console && console.warn('document.body doesn\'t exist. Modernizr hyphens test needs it.');
2525
return;
2626
}
2727

@@ -37,21 +37,21 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
3737
spanWidth = 0,
3838
result = false,
3939
firstChild = document.body.firstElementChild || document.body.firstChild;
40-
40+
4141
div.appendChild(span);
4242
span.innerHTML = 'Bacon ipsum dolor sit amet jerky velit in culpa hamburger et. Laborum dolor proident, enim dolore duis commodo et strip steak. Salami anim et, veniam consectetur dolore qui tenderloin jowl velit sirloin. Et ad culpa, fatback cillum jowl ball tip ham hock nulla short ribs pariatur aute. Pig pancetta ham bresaola, ut boudin nostrud commodo flank esse cow tongue culpa. Pork belly bresaola enim pig, ea consectetur nisi. Fugiat officia turkey, ea cow jowl pariatur ullamco proident do laborum velit sausage. Magna biltong sint tri-tip commodo sed bacon, esse proident aliquip. Ullamco ham sint fugiat, velit in enim sed mollit nulla cow ut adipisicing nostrud consectetur. Proident dolore beef ribs, laborum nostrud meatball ea laboris rump cupidatat labore culpa. Shankle minim beef, velit sint cupidatat fugiat tenderloin pig et ball tip. Ut cow fatback salami, bacon ball tip et in shank strip steak bresaola. In ut pork belly sed mollit tri-tip magna culpa veniam, short ribs qui in andouille ham consequat. Dolore bacon t-bone, velit short ribs enim strip steak nulla. Voluptate labore ut, biltong swine irure jerky. Cupidatat excepteur aliquip salami dolore. Ball tip strip steak in pork dolor. Ad in esse biltong. Dolore tenderloin exercitation ad pork loin t-bone, dolore in chicken ball tip qui pig. Ut culpa tongue, sint ribeye dolore ex shank voluptate hamburger. Jowl et tempor, boudin pork chop labore ham hock drumstick consectetur tri-tip elit swine meatball chicken ground round. Proident shankle mollit dolore. Shoulder ut duis t-bone quis reprehenderit. Meatloaf dolore minim strip steak, laboris ea aute bacon beef ribs elit shank in veniam drumstick qui. Ex laboris meatball cow tongue pork belly. Ea ball tip reprehenderit pig, sed fatback boudin dolore flank aliquip laboris eu quis. Beef ribs duis beef, cow corned beef adipisicing commodo nisi deserunt exercitation. Cillum dolor t-bone spare ribs, ham hock est sirloin. Brisket irure meatloaf in, boudin pork belly sirloin ball tip. Sirloin sint irure nisi nostrud aliqua. Nostrud nulla aute, enim officia culpa ham hock. Aliqua reprehenderit dolore sunt nostrud sausage, ea boudin pork loin ut t-bone ham tempor. Tri-tip et pancetta drumstick laborum. Ham hock magna do nostrud in proident. Ex ground round fatback, venison non ribeye in.';
4343

4444
document.body.insertBefore(div, firstChild);
45-
45+
4646
/* get size of unhyphenated text */
4747
divStyle.cssText = 'position:absolute;top:0;left:0;width:5em;text-align:justify;text-justification:newspaper;';
4848
spanHeight = span.offsetHeight;
4949
spanWidth = span.offsetWidth;
5050

5151
/* compare size with hyphenated text */
5252
divStyle.cssText = 'position:absolute;top:0;left:0;width:5em;text-align:justify;'+
53-
'text-justification:newspaper;'
54-
+ Modernizr._prefixes.join('hyphens:auto; ');
53+
'text-justification:newspaper;'+
54+
Modernizr._prefixes.join('hyphens:auto; ');
5555

5656
result = (span.offsetHeight != spanHeight || span.offsetWidth != spanWidth);
5757

@@ -82,8 +82,8 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
8282
divStyle.cssText = 'position:absolute;top:0;left:0;overflow:visible;width:1.25em;';
8383
div.appendChild(span);
8484
document.body.insertBefore(div, firstChild);
85-
86-
85+
86+
8787
/* get height of unwrapped text */
8888
span.innerHTML = 'mm';
8989
spanSize = span.offsetHeight;
@@ -110,7 +110,7 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
110110
if (result1 === true && result2 === true) { result = true; }
111111
document.body.removeChild(div);
112112
div.removeChild(span);
113-
113+
114114
return result;
115115
} catch(e) {
116116
return false;
@@ -136,7 +136,7 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
136136
document.body.insertBefore(div, firstChild);
137137
document.body.insertBefore(dummy, div);
138138

139-
139+
140140
/* reset the selection to the dummy input element, i.e. BEFORE the div container
141141
* stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area */
142142
if (dummy.setSelectionRange) {
@@ -155,7 +155,7 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
155155
result = window.find(testword + testword);
156156
} else {
157157
try {
158-
textrange = self.document.body.createTextRange();
158+
textrange = window.self.document.body.createTextRange();
159159
result = textrange.findText(testword + testword);
160160
} catch(e) {
161161
result = false;
@@ -188,7 +188,7 @@ More details at https://github.com/Modernizr/Modernizr/issues/312
188188
Modernizr.addTest("softhyphens", function() {
189189
try {
190190
// use numeric entity instead of ­ in case it's XHTML
191-
return test_hyphens('­', true) && test_hyphens('​', false);
191+
return test_hyphens('­', true) && test_hyphens('​', false);
192192
} catch(e) {
193193
return false;
194194
}

feature-detects/css-remunit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// test by github.com/nsfmc
33

4-
// "The 'rem' unit ('root em') is relative to the computed
4+
// "The 'rem' unit ('root em') is relative to the computed
55
// value of the 'font-size' value of the root element."
66
// http://www.w3.org/TR/css3-values/#relative0
77
// you can test by checking if the prop was ditched
@@ -14,6 +14,6 @@ Modernizr.addTest('cssremunit', function(){
1414
try {
1515
div.style.fontSize = '3rem';
1616
} catch(er){}
17-
return /rem/.test(div.style.fontSize)
17+
return (/rem/).test(div.style.fontSize);
1818

1919
});

feature-detects/css-scrollbars.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Stylable scrollbars detection
22
Modernizr.addTest('cssscrollbar', function() {
3-
3+
44
var bool,
5-
6-
styles = "#modernizr{overflow: scroll; width: 40px }#" +
7-
Modernizr._prefixes
5+
6+
styles = "#modernizr{overflow: scroll; width: 40px }#" +
7+
Modernizr._prefixes
88
.join("scrollbar{width:0px}"+' #modernizr::')
99
.split('#')
1010
.slice(1)
1111
.join('#') + "scrollbar{width:0px}";
12-
12+
1313
Modernizr.testStyles(styles, function(node) {
1414
bool = 'scrollWidth' in node && node.scrollWidth == 40;
1515
});
16-
16+
1717
return bool;
1818

1919
});

feature-detects/elem-progress-meter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
//tests for progressbar-support. All browsers that don't support progressbar returns undefined =)
44
Modernizr.addTest("progressbar",function(){
5-
return document.createElement('progress').max != undefined;
5+
return document.createElement('progress').max !== undefined;
66
});
77

88
//tests for meter-support. All browsers that don't support meters returns undefined =)
99
Modernizr.addTest("meter",function(){
10-
return document.createElement('meter').max != undefined;
10+
return document.createElement('meter').max !== undefined;
1111
});

feature-detects/elem-ruby.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Modernizr.addTest('ruby', function () {
1717
docElement.appendChild(ruby);
1818

1919
// browsers that support <ruby> hide the <rp> via "display:none"
20-
if ( getStyle(rp, displayStyleProperty) == 'none' // for non-IE browsers
20+
if ( getStyle(rp, displayStyleProperty) == 'none' || // for non-IE browsers
2121
// but in IE browsers <rp> has "display:inline" so, the test needs other conditions:
22-
|| getStyle(ruby, displayStyleProperty) == 'ruby' && getStyle(rt, displayStyleProperty) == 'ruby-text' // for IE8 & IE9
23-
|| getStyle(rp, fontSizeStyleProperty) == '6pt' && getStyle(rt, fontSizeStyleProperty) == '6pt' ) { // for IE6 & IE7
22+
getStyle(ruby, displayStyleProperty) == 'ruby' && getStyle(rt, displayStyleProperty) == 'ruby-text' || // for IE8 & IE9
23+
getStyle(rp, fontSizeStyleProperty) == '6pt' && getStyle(rt, fontSizeStyleProperty) == '6pt' ) { // for IE6 & IE7
2424

2525
cleanUp();
2626
return true;

0 commit comments

Comments
 (0)