MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / linearGradient

Function linearGradient

src/test/resources/libraries/html2canvas/html2canvas.js:2182–2201  ·  view source on GitHub ↗
(context, tokens)

Source from the content-addressed store, hash-verified

2180 };
2181
2182 var linearGradient = function (context, tokens) {
2183 var angle$1 = deg(180);
2184 var stops = [];
2185 parseFunctionArgs(tokens).forEach(function (arg, i) {
2186 if (i === 0) {
2187 var firstToken = arg[0];
2188 if (firstToken.type === 20 /* IDENT_TOKEN */ && firstToken.value === 'to') {
2189 angle$1 = parseNamedSide(arg);
2190 return;
2191 }
2192 else if (isAngle(firstToken)) {
2193 angle$1 = angle.parse(context, firstToken);
2194 return;
2195 }
2196 }
2197 var colorStop = parseColorStop(context, arg);
2198 stops.push(colorStop);
2199 });
2200 return { angle: angle$1, stops: stops, type: 1 /* LINEAR_GRADIENT */ };
2201 };
2202
2203 var prefixLinearGradient = function (context, tokens) {
2204 var angle$1 = deg(180);

Callers

nothing calls this directly

Calls 8

degFunction · 0.85
parseFunctionArgsFunction · 0.85
parseNamedSideFunction · 0.85
isAngleFunction · 0.85
parseColorStopFunction · 0.85
parseMethod · 0.65
forEachMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…