MCPcopy Create free account
hub / github.com/totaljs/framework / autoprefixer

Function autoprefixer

internal.js:895–1046  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

893}
894
895function autoprefixer(value) {
896
897 value = autoprefixer_keyframes(value);
898
899 var builder = [];
900 var index = 0;
901 var property;
902
903 // properties
904 for (var i = 0, length = AUTOVENDOR.length; i < length; i++) {
905
906 property = AUTOVENDOR[i];
907 index = 0;
908
909 while (index !== -1) {
910
911 index = value.indexOf(property, index + 1);
912 if (index === -1)
913 continue;
914
915 var a = value.indexOf(';', index);
916 var b = value.indexOf('}', index);
917
918 var end = Math.min(a, b);
919 if (end === -1)
920 end = Math.max(a, b);
921
922 if (end === -1)
923 continue;
924
925 // text-transform
926 var before = value.substring(index - 1, index);
927 var isPrefix = before === '-';
928 if (isPrefix)
929 continue;
930
931 var css = value.substring(index, end);
932 end = css.indexOf(':');
933
934 if (end === -1 || css.substring(0, end + 1).replace(/\s/g, '') !== property + ':')
935 continue;
936
937 builder.push({ name: property, property: before + css, css: css });
938 }
939 }
940
941 var output = [];
942 var length = builder.length;
943
944 for (var i = 0; i < length; i++) {
945
946 var name = builder[i].name;
947 var replace = builder[i].property;
948 var before = replace[0];
949
950 property = builder[i].css.trim();
951
952 var plus = property;

Callers 1

compile_autovendorFunction · 0.85

Calls 1

autoprefixer_keyframesFunction · 0.85

Tested by

no test coverage detected