-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update quota mgmt test to req the actual object. cc @addyosmani. ref #…
- Loading branch information
Showing
6 changed files
with
110 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
// a[download] attribute | ||
// When used on an <a>, this attribute signifies that the resource it | ||
// points to should be downloaded by the browser rather than navigating to it. | ||
// http://developers.whatwg.org/links.html#downloading-resources | ||
// By Addy Osmani | ||
|
||
Modernizr.addTest('adownload', | ||
!!('download' in document.createElement('a')) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
|
||
// MathML omg! | ||
// http://www.w3.org/Math/ | ||
|
||
// this tests MathML in HTML, not MathML as XML. | ||
// test by Niels Leenheer | ||
|
||
// demo: | ||
// http://www1.chapman.edu/~jipsen/mathml/mathhtmltest.htm | ||
// MathML | ||
// http://www.w3.org/Math/ | ||
// By Addy Osmani | ||
// Based on work by Davide (@dpvc) and David (@davidcarlisle) | ||
// in https://github.com/mathjax/MathJax/issues/182 | ||
|
||
Modernizr.addTest('mathml', function(){ | ||
|
||
var e = document.createElement('div'); | ||
e.innerHTML = '<math></math>'; | ||
|
||
var bool = e.firstChild | ||
&& "namespaceURI" in e.firstChild | ||
&& e.firstChild.namespaceURI == 'http://www.w3.org/1998/Math/MathML'; | ||
|
||
return bool; | ||
|
||
}); | ||
var hasMathML = false; | ||
if ( document.createElementNS ) { | ||
var ns = "http://www.w3.org/1998/Math/MathML", | ||
div = document.createElement("div"); | ||
div.style.position = "absolute"; | ||
var mfrac = div.appendChild(document.createElementNS(ns,"math")) | ||
.appendChild(document.createElementNS(ns,"mfrac")); | ||
mfrac.appendChild(document.createElementNS(ns,"mi")) | ||
.appendChild(document.createTextNode("xx")); | ||
mfrac.appendChild(document.createElementNS(ns,"mi")) | ||
.appendChild(document.createTextNode("yy")); | ||
document.body.appendChild(div); | ||
hasMathML = div.offsetHeight > div.offsetWidth; | ||
} | ||
return hasMathML; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
// Quota storage management API | ||
// This API can be used to check how much quota an origin is using and request more | ||
|
||
// Currently only implemented in WebKit | ||
// https://groups.google.com/a/chromium.org/group/chromium-html5/msg/5261d24266ba4366 | ||
// By Addy Osmani | ||
|
||
Modernizr.addTest('quotamanagement', function(){ | ||
var storage = window[ Modernizr.prefixed('StorageInfo', window) ]; | ||
return !!('TEMPORARY' in storage && 'PERSISTENT' in storage); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
// requestAnimationFrame | ||
// Offload animation repainting to browser for optimized performance. | ||
// http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html | ||
// By Addy Osmani | ||
|
||
Modernizr.addTest('raf', !!Modernizr.prefixed('requestAnimationFrame', window)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7273d5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the head's up!