Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/css-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ this.CSSTest || (this.CSSTest = (function(global) {

var version = '0.4',

sheet, style,
sheet,

doc = global.document,
root = doc.documentElement,
Expand All @@ -24,7 +24,7 @@ this.CSSTest || (this.CSSTest = (function(global) {
// transform (p)roperty name to Camel Case (fontSize, lineHeight)
var toCamelCase =
function(p) {
if (p == 'float') {
if (p === 'float') {
return 'styleFloat' in root.style ? 'styleFloat' :
'cssFloat' in root.style ? 'cssFloat' : p;
}
Expand All @@ -44,7 +44,7 @@ this.CSSTest || (this.CSSTest = (function(global) {
try {
sheet.insertRule(rule, 0);
result = !(/unknown/i).test(sheet.cssRules[0].cssText);/* &&
sheet.cssRules[0].cssText.replace(/[\s;\\\x22\x27]/g, '') ==
sheet.cssRules[0].cssText.replace(/[\s;\\\x22\x27]/g, '') ===
rule.replace(/[\s;\\\x22\x27]/g, '');*/
sheet.deleteRule(sheet.cssRules.length - 1);
} catch(e) { }
Expand All @@ -66,7 +66,7 @@ this.CSSTest || (this.CSSTest = (function(global) {
try {
sheet.insertRule(media, 0);
result = !(/unknown/i).test(sheet.cssRules[0].cssText);/* &&
sheet.cssRules[0].cssText.replace(/[\s;\\\x22\x27]/g, '') ==
sheet.cssRules[0].cssText.replace(/[\s;\\\x22\x27]/g, '') ===
media.replace(/[\s;\\\x22\x27]/g, '');*/
sheet.deleteRule(sheet.cssRules.length - 1);
} catch(e) { }
Expand Down Expand Up @@ -103,7 +103,7 @@ this.CSSTest || (this.CSSTest = (function(global) {
if (!property) return false;
var result = false, prop = toCamelCase(property);
if (!value && prop in root.style) {
return typeof root.style[prop] == 'string';
return typeof root.style[prop] === 'string';
} else {
if (!(sheet)) return false;
try {
Expand All @@ -123,8 +123,8 @@ this.CSSTest || (this.CSSTest = (function(global) {
return sheet.cssText.indexOf(property.toUpperCase()) > - 1;
}
return name in root.style &&
typeof root.style[name] == 'string' ||
typeof root.style[name] == 'number';
typeof root.style[name] === 'string' ||
typeof root.style[name] === 'number';
}

};
Expand Down