Comparing version 0.10.5 to 0.11.0
@@ -21,2 +21,6 @@ var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}(); | ||
} | ||
//都是tag结尾则无冲突 | ||
else if(this.allTag(list, first, last)) { | ||
return this.imCache[first + ',' + last + ',' + child] = true; | ||
} | ||
//非紧邻若无相同样式或important优先级不同无影响 | ||
@@ -131,2 +135,37 @@ else { | ||
} | ||
Impact.prototype.allTag = function(list, first, last) { | ||
var hash = {}; | ||
for(var i = 0, len = list[first].selectors.length; i < len; i++) { | ||
var s = list[first].selectors[i]; | ||
//div全字母为tag | ||
if(/^[a-z]+$/i.test(s)) { | ||
hash[s] = true; | ||
continue; | ||
} | ||
// div前面空格类型 | ||
if(/ [a-z]+$/i.test(s)) { | ||
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
//>div | ||
if(/>[a-z]+$/i.test(s)) { | ||
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
return false; | ||
} | ||
for(var i = 0, len = list[last].selectors.length; i < len; i++) { | ||
var s = list[last].selectors[i]; | ||
if(/^[a-z]+$/i.test(s) && !hash[s]) { | ||
continue; | ||
} | ||
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
return false; | ||
} | ||
} | ||
@@ -133,0 +172,0 @@ |
@@ -21,2 +21,6 @@ var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}(); | ||
} | ||
//都是tag结尾则无冲突 | ||
else if(this.allTag(list, first, last)) { | ||
return this.imCache[first + ',' + last + ',' + child] = true; | ||
} | ||
//非紧邻若无相同样式或important优先级不同无影响 | ||
@@ -36,3 +40,4 @@ else { | ||
var item = list[i]; | ||
if(this.isChildren(item, list[last]) || this.isChildren(item, list[first])) { | ||
if(this.isChildren(item, list[last]) | ||
|| this.isChildren(item, list[first])) { | ||
this.imCache[i + ',' + last + ',' + child] = true; | ||
@@ -81,2 +86,37 @@ continue; | ||
} | ||
ImpactChild.prototype.allTag = function(list, first, last) { | ||
var hash = {}; | ||
for(var i = 0, len = list[first].selectors.length; i < len; i++) { | ||
var s = list[first].selectors[i]; | ||
//div全字母为tag | ||
if(/^[a-z]+$/i.test(s)) { | ||
hash[s] = true; | ||
continue; | ||
} | ||
// div前面空格类型 | ||
if(/ [a-z]+$/i.test(s)) { | ||
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
//>div | ||
if(/>[a-z]+$/i.test(s)) { | ||
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
return false; | ||
} | ||
for(var i = 0, len = list[last].selectors.length; i < len; i++) { | ||
var s = list[last].selectors[i]; | ||
if(/^[a-z]+$/i.test(s) && !hash[s]) { | ||
continue; | ||
} | ||
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
return false; | ||
} | ||
} | ||
@@ -83,0 +123,0 @@ |
@@ -24,2 +24,3 @@ var sort=function(){var _0=require('./sort');return _0.hasOwnProperty("sort")?_0.sort:_0.hasOwnProperty("default")?_0.default:_0}(); | ||
2和3已被clean-css实现,无需重复 | ||
追加:除5外都被clean-css实现,但尚不完整,对!important冲突判断有误 | ||
*/ | ||
@@ -33,2 +34,4 @@ this.merge(this.list); | ||
this.extract(this.list); | ||
this.merge(this.list); | ||
this.merge(this.list, true); | ||
return this.join(this.list); | ||
@@ -35,0 +38,0 @@ } |
{ | ||
"name": "more-css", | ||
"version": "0.10.5", | ||
"version": "0.11.0", | ||
"description": "a css pre-compiler&agressive compressor", | ||
@@ -33,3 +33,3 @@ "maintainers": [ | ||
"dependencies": { | ||
"clean-css": "~3.0.10", | ||
"clean-css": "~3.2.8", | ||
"homunculus": "~0.9.2", | ||
@@ -36,0 +36,0 @@ "glob": "~5.0.5", |
@@ -21,2 +21,6 @@ import KEY_HASH from './abbreviationKey.js'; | ||
} | ||
//都是tag结尾则无冲突 | ||
else if(this.allTag(list, first, last)) { | ||
return this.imCache[first + ',' + last + ',' + child] = true; | ||
} | ||
//非紧邻若无相同样式或important优先级不同无影响 | ||
@@ -131,2 +135,37 @@ else { | ||
} | ||
allTag(list, first, last) { | ||
var hash = {}; | ||
for(var i = 0, len = list[first].selectors.length; i < len; i++) { | ||
var s = list[first].selectors[i]; | ||
//div全字母为tag | ||
if(/^[a-z]+$/i.test(s)) { | ||
hash[s] = true; | ||
continue; | ||
} | ||
// div前面空格类型 | ||
if(/ [a-z]+$/i.test(s)) { | ||
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
//>div | ||
if(/>[a-z]+$/i.test(s)) { | ||
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
return false; | ||
} | ||
for(var i = 0, len = list[last].selectors.length; i < len; i++) { | ||
var s = list[last].selectors[i]; | ||
if(/^[a-z]+$/i.test(s) && !hash[s]) { | ||
continue; | ||
} | ||
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
return false; | ||
} | ||
} | ||
} | ||
@@ -133,0 +172,0 @@ |
@@ -21,2 +21,6 @@ import KEY_HASH from './abbreviationKey.js'; | ||
} | ||
//都是tag结尾则无冲突 | ||
else if(this.allTag(list, first, last)) { | ||
return this.imCache[first + ',' + last + ',' + child] = true; | ||
} | ||
//非紧邻若无相同样式或important优先级不同无影响 | ||
@@ -36,3 +40,4 @@ else { | ||
var item = list[i]; | ||
if(this.isChildren(item, list[last]) || this.isChildren(item, list[first])) { | ||
if(this.isChildren(item, list[last]) | ||
|| this.isChildren(item, list[first])) { | ||
this.imCache[i + ',' + last + ',' + child] = true; | ||
@@ -81,2 +86,37 @@ continue; | ||
} | ||
allTag(list, first, last) { | ||
var hash = {}; | ||
for(var i = 0, len = list[first].selectors.length; i < len; i++) { | ||
var s = list[first].selectors[i]; | ||
//div全字母为tag | ||
if(/^[a-z]+$/i.test(s)) { | ||
hash[s] = true; | ||
continue; | ||
} | ||
// div前面空格类型 | ||
if(/ [a-z]+$/i.test(s)) { | ||
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
//>div | ||
if(/>[a-z]+$/i.test(s)) { | ||
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
return false; | ||
} | ||
for(var i = 0, len = list[last].selectors.length; i < len; i++) { | ||
var s = list[last].selectors[i]; | ||
if(/^[a-z]+$/i.test(s) && !hash[s]) { | ||
continue; | ||
} | ||
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
return false; | ||
} | ||
} | ||
} | ||
@@ -83,0 +123,0 @@ |
@@ -24,2 +24,3 @@ import sort from './sort'; | ||
2和3已被clean-css实现,无需重复 | ||
追加:除5外都被clean-css实现,但尚不完整,对!important冲突判断有误 | ||
*/ | ||
@@ -33,2 +34,4 @@ this.merge(this.list); | ||
this.extract(this.list); | ||
this.merge(this.list); | ||
this.merge(this.list, true); | ||
return this.join(this.list); | ||
@@ -35,0 +38,0 @@ } |
@@ -21,2 +21,6 @@ define(function(require, exports, module){var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}(); | ||
} | ||
//都是tag结尾则无冲突 | ||
else if(this.allTag(list, first, last)) { | ||
return this.imCache[first + ',' + last + ',' + child] = true; | ||
} | ||
//非紧邻若无相同样式或important优先级不同无影响 | ||
@@ -131,2 +135,37 @@ else { | ||
} | ||
Impact.prototype.allTag = function(list, first, last) { | ||
var hash = {}; | ||
for(var i = 0, len = list[first].selectors.length; i < len; i++) { | ||
var s = list[first].selectors[i]; | ||
//div全字母为tag | ||
if(/^[a-z]+$/i.test(s)) { | ||
hash[s] = true; | ||
continue; | ||
} | ||
// div前面空格类型 | ||
if(/ [a-z]+$/i.test(s)) { | ||
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
//>div | ||
if(/>[a-z]+$/i.test(s)) { | ||
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
return false; | ||
} | ||
for(var i = 0, len = list[last].selectors.length; i < len; i++) { | ||
var s = list[last].selectors[i]; | ||
if(/^[a-z]+$/i.test(s) && !hash[s]) { | ||
continue; | ||
} | ||
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
return false; | ||
} | ||
} | ||
@@ -133,0 +172,0 @@ |
@@ -21,2 +21,6 @@ define(function(require, exports, module){var KEY_HASH=function(){var _0=require('./abbreviationKey.js');return _0.hasOwnProperty("KEY_HASH")?_0.KEY_HASH:_0.hasOwnProperty("default")?_0.default:_0}(); | ||
} | ||
//都是tag结尾则无冲突 | ||
else if(this.allTag(list, first, last)) { | ||
return this.imCache[first + ',' + last + ',' + child] = true; | ||
} | ||
//非紧邻若无相同样式或important优先级不同无影响 | ||
@@ -36,3 +40,4 @@ else { | ||
var item = list[i]; | ||
if(this.isChildren(item, list[last]) || this.isChildren(item, list[first])) { | ||
if(this.isChildren(item, list[last]) | ||
|| this.isChildren(item, list[first])) { | ||
this.imCache[i + ',' + last + ',' + child] = true; | ||
@@ -81,2 +86,37 @@ continue; | ||
} | ||
ImpactChild.prototype.allTag = function(list, first, last) { | ||
var hash = {}; | ||
for(var i = 0, len = list[first].selectors.length; i < len; i++) { | ||
var s = list[first].selectors[i]; | ||
//div全字母为tag | ||
if(/^[a-z]+$/i.test(s)) { | ||
hash[s] = true; | ||
continue; | ||
} | ||
// div前面空格类型 | ||
if(/ [a-z]+$/i.test(s)) { | ||
hash[/ [a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
//>div | ||
if(/>[a-z]+$/i.test(s)) { | ||
hash[/>[a-z]+$/i.exec(s)[0].slice(1)] = true; | ||
continue; | ||
} | ||
return false; | ||
} | ||
for(var i = 0, len = list[last].selectors.length; i < len; i++) { | ||
var s = list[last].selectors[i]; | ||
if(/^[a-z]+$/i.test(s) && !hash[s]) { | ||
continue; | ||
} | ||
if(/ [a-z]+$/i.test(s) && !hash[/ [a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
if(/>[a-z]+$/i.test(s) && !hash[/>[a-z]+$/i.exec(s)[0].slice(1)]) { | ||
continue; | ||
} | ||
return false; | ||
} | ||
} | ||
@@ -83,0 +123,0 @@ |
@@ -24,2 +24,3 @@ define(function(require, exports, module){var sort=function(){var _0=require('./sort');return _0.hasOwnProperty("sort")?_0.sort:_0.hasOwnProperty("default")?_0.default:_0}(); | ||
2和3已被clean-css实现,无需重复 | ||
追加:除5外都被clean-css实现,但尚不完整,对!important冲突判断有误 | ||
*/ | ||
@@ -33,2 +34,4 @@ this.merge(this.list); | ||
this.extract(this.list); | ||
this.merge(this.list); | ||
this.merge(this.list, true); | ||
return this.join(this.list); | ||
@@ -35,0 +38,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
393517
10373
+ Addedclean-css@3.2.11(transitive)
+ Addedcommander@2.8.1(transitive)
+ Addedgraceful-readlink@1.0.1(transitive)
+ Addedsource-map@0.4.4(transitive)
- Removedclean-css@3.0.10(transitive)
- Removedcommander@2.5.1(transitive)
- Removedsource-map@0.1.43(transitive)
Updatedclean-css@~3.2.8