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

Function parseNamedSide

src/test/resources/libraries/html2canvas/html2canvas.js:1677–1717  ·  view source on GitHub ↗
(tokens)

Source from the content-addressed store, hash-verified

1675 return false;
1676 };
1677 var parseNamedSide = function (tokens) {
1678 var sideOrCorner = tokens
1679 .filter(isIdentToken)
1680 .map(function (ident) { return ident.value; })
1681 .join(' ');
1682 switch (sideOrCorner) {
1683 case 'to bottom right':
1684 case 'to right bottom':
1685 case 'left top':
1686 case 'top left':
1687 return [ZERO_LENGTH, ZERO_LENGTH];
1688 case 'to top':
1689 case 'bottom':
1690 return deg(0);
1691 case 'to bottom left':
1692 case 'to left bottom':
1693 case 'right top':
1694 case 'top right':
1695 return [ZERO_LENGTH, HUNDRED_PERCENT];
1696 case 'to right':
1697 case 'left':
1698 return deg(90);
1699 case 'to top left':
1700 case 'to left top':
1701 case 'right bottom':
1702 case 'bottom right':
1703 return [HUNDRED_PERCENT, HUNDRED_PERCENT];
1704 case 'to bottom':
1705 case 'top':
1706 return deg(180);
1707 case 'to top right':
1708 case 'to right top':
1709 case 'left bottom':
1710 case 'bottom left':
1711 return [HUNDRED_PERCENT, ZERO_LENGTH];
1712 case 'to left':
1713 case 'right':
1714 return deg(270);
1715 }
1716 return 0;
1717 };
1718 var deg = function (deg) { return (Math.PI * deg) / 180; };
1719
1720 var color$1 = {

Callers 2

linearGradientFunction · 0.85
prefixLinearGradientFunction · 0.85

Calls 4

degFunction · 0.85
joinMethod · 0.80
mapMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…