This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+6 -2
View File
@@ -78,7 +78,7 @@ function TRBL(name) {
TRBL.prototype.getValueSequence = function(declaration, count) {
var values = [];
var iehack = '';
var hasBadValues = declaration.value.children.some(function(child) {
var hasBadValues = declaration.value.type !== 'Value' || declaration.value.children.some(function(child) {
var special = false;
switch (child.type) {
@@ -115,12 +115,16 @@ TRBL.prototype.getValueSequence = function(declaration, count) {
}
break;
case 'HexColor': // color
case 'Hash': // color
case 'Number':
case 'Percentage':
break;
case 'Function':
if (child.name === 'var') {
return true;
}
special = child.name;
break;
+17 -17
View File
@@ -14,17 +14,21 @@ var DONT_MIX_VALUE = {
'text-align': /^(start|end|match-parent|justify-all)$/i
};
var CURSOR_SAFE_VALUE = [
'auto', 'crosshair', 'default', 'move', 'text', 'wait', 'help',
'n-resize', 'e-resize', 's-resize', 'w-resize',
'ne-resize', 'nw-resize', 'se-resize', 'sw-resize',
'pointer', 'progress', 'not-allowed', 'no-drop', 'vertical-text', 'all-scroll',
'col-resize', 'row-resize'
];
var POSITION_SAFE_VALUE = [
'static', 'relative', 'absolute', 'fixed'
];
var SAFE_VALUES = {
cursor: [
'auto', 'crosshair', 'default', 'move', 'text', 'wait', 'help',
'n-resize', 'e-resize', 's-resize', 'w-resize',
'ne-resize', 'nw-resize', 'se-resize', 'sw-resize',
'pointer', 'progress', 'not-allowed', 'no-drop', 'vertical-text', 'all-scroll',
'col-resize', 'row-resize'
],
overflow: [
'hidden', 'visible', 'scroll', 'auto'
],
position: [
'static', 'relative', 'absolute', 'fixed'
]
};
var NEEDLESS_TABLE = {
'border-width': ['border'],
@@ -105,12 +109,8 @@ function getPropertyFingerprint(propertyName, declaration, fingerprints) {
iehack = RegExp.lastMatch;
}
if (realName === 'cursor') {
if (CURSOR_SAFE_VALUE.indexOf(name) === -1) {
special[name] = true;
}
} else if (realName === 'position') {
if (POSITION_SAFE_VALUE.indexOf(name) === -1) {
if (SAFE_VALUES.hasOwnProperty(realName)) {
if (SAFE_VALUES[realName].indexOf(name) === -1) {
special[name] = true;
}
} else if (DONT_MIX_VALUE.hasOwnProperty(realName)) {
+2 -2
View File
@@ -44,7 +44,7 @@ module.exports = function freeze(node, usageData) {
var name = node.name.toLowerCase();
if (!nonFreezePseudoClasses.hasOwnProperty(name)) {
pseudos[name] = true;
pseudos[':' + name] = true;
hasPseudo = true;
}
break;
@@ -53,7 +53,7 @@ module.exports = function freeze(node, usageData) {
var name = node.name.toLowerCase();
if (!nonFreezePseudoElements.hasOwnProperty(name)) {
pseudos[name] = true;
pseudos['::' + name] = true;
hasPseudo = true;
}
break;