source: imaps-frontend/node_modules/clean-css/lib/optimizer/level-2/properties/optimize.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.4 KB
Line 
1var mergeIntoShorthands = require('./merge-into-shorthands');
2var overrideProperties = require('./override-properties');
3var populateComponents = require('./populate-components');
4
5var restoreWithComponents = require('../restore-with-components');
6
7var wrapForOptimizing = require('../../wrap-for-optimizing').all;
8var removeUnused = require('../../remove-unused');
9var restoreFromOptimizing = require('../../restore-from-optimizing');
10
11var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
12
13function optimizeProperties(properties, withOverriding, withMerging, context) {
14 var levelOptions = context.options.level[OptimizationLevel.Two];
15 var _properties = wrapForOptimizing(properties, levelOptions.skipProperties);
16 var _property;
17 var i, l;
18
19 populateComponents(_properties, context.validator, context.warnings);
20
21 for (i = 0, l = _properties.length; i < l; i++) {
22 _property = _properties[i];
23 if (_property.block) {
24 optimizeProperties(_property.value[0][1], withOverriding, withMerging, context);
25 }
26 }
27
28 if (withMerging && levelOptions.mergeIntoShorthands) {
29 mergeIntoShorthands(_properties, context.validator);
30 }
31
32 if (withOverriding && levelOptions.overrideProperties) {
33 overrideProperties(_properties, withMerging, context.options.compatibility, context.validator);
34 }
35
36 restoreFromOptimizing(_properties, restoreWithComponents);
37 removeUnused(_properties);
38}
39
40module.exports = optimizeProperties;
Note: See TracBrowser for help on using the repository browser.