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

Function parse

src/test/resources/libraries/html2canvas/html2canvas.js:3730–3764  ·  view source on GitHub ↗
(context, descriptor, style)

Source from the content-addressed store, hash-verified

3728 }());
3729 // eslint-disable-next-line @typescript-eslint/no-explicit-any
3730 var parse = function (context, descriptor, style) {
3731 var tokenizer = new Tokenizer();
3732 var value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;
3733 tokenizer.write(value);
3734 var parser = new Parser(tokenizer.read());
3735 switch (descriptor.type) {
3736 case 2 /* IDENT_VALUE */:
3737 var token = parser.parseComponentValue();
3738 return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);
3739 case 0 /* VALUE */:
3740 return descriptor.parse(context, parser.parseComponentValue());
3741 case 1 /* LIST */:
3742 return descriptor.parse(context, parser.parseComponentValues());
3743 case 4 /* TOKEN_VALUE */:
3744 return parser.parseComponentValue();
3745 case 3 /* TYPE_VALUE */:
3746 switch (descriptor.format) {
3747 case 'angle':
3748 return angle.parse(context, parser.parseComponentValue());
3749 case 'color':
3750 return color$1.parse(context, parser.parseComponentValue());
3751 case 'image':
3752 return image.parse(context, parser.parseComponentValue());
3753 case 'length':
3754 var length_1 = parser.parseComponentValue();
3755 return isLength(length_1) ? length_1 : ZERO_LENGTH;
3756 case 'length-percentage':
3757 var value_1 = parser.parseComponentValue();
3758 return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
3759 case 'time':
3760 return time.parse(context, parser.parseComponentValue());
3761 }
3762 break;
3763 }
3764 };
3765
3766 var elementDebuggerAttribute = 'data-html2canvas-debug';
3767 var getElementDebugType = function (element) {

Callers 3

CSSParsedDeclarationFunction · 0.70

Calls 7

isIdentTokenFunction · 0.85
isLengthFunction · 0.85
isLengthPercentageFunction · 0.85
parseMethod · 0.65
toStringMethod · 0.45
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…