Closed oswetto closed 4 years ago
Hello @rbri htmlunit-cssparser not support css function calc()
Example 1
final String css = "#foo {width: calc(100px + 100px)}"; final InputSource source = new InputSource(new StringReader(css)); final CSSOMParser parser = new CSSOMParser(); final CSSStyleSheet sheet = parser.parseStyleSheet(source, null); final CSSRuleList rules = sheet.getCssRules(); CSSRule rule = rules.item(0); System.out.println(rule.getCssText()); [1:26] Error in expression. (Invalid token " ". Was expecting one of: <NUMBER>, "inherit", <IDENT>, <STRING>, <HASH>, <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, <PERCENTAGE>, <DIMENSION>, <UNICODE_RANGE>, <URI>, <FUNCTION>, "progid:".) *#foo { }
Example 2
final String css = "#foo {width: calc(100px+100px)}"; final InputSource source = new InputSource(new StringReader(css)); final CSSOMParser parser = new CSSOMParser(); final CSSStyleSheet sheet = parser.parseStyleSheet(source, null); final CSSRuleList rules = sheet.getCssRules(); CSSRule rule = rules.item(0); System.out.println(rule.getCssText()); ---- > Return *#foo { width: calc(100px 100px) }
Example 3
final String css = "#foo {width: calc(100px/100px)}"; final InputSource source = new InputSource(new StringReader(css)); final CSSOMParser parser = new CSSOMParser(); final CSSStyleSheet sheet = parser.parseStyleSheet(source, null); final CSSRuleList rules = sheet.getCssRules(); CSSRule rule = rules.item(0); System.out.println(rule.getCssText()); Return *#foo { width: calc(100px 100px) } null [1:24] Error in expression. (Invalid token "/". Was expecting one of: <S>, <NUMBER>, "inherit", <IDENT>, <STRING>, ")", "-", "=", <PLUS>, <COMMA>, <HASH>, <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, <PERCENTAGE>, <DIMENSION>, <UNICODE_RANGE>, <URI>, <FUNCTION>, "progid:".) *#foo { }
Example 4
final String css = "#foo {width: calc(100% - 100px)}"; final InputSource source = new InputSource(new StringReader(css)); final CSSOMParser parser = new CSSOMParser(); final CSSStyleSheet sheet = parser.parseStyleSheet(source, null); final CSSRuleList rules = sheet.getCssRules(); CSSRule rule = rules.item(0); System.out.println(rule.getCssText()); null [1:25] Error in expression. (Invalid token " ". Was expecting one of: <NUMBER>, "inherit", <IDENT>, <STRING>, <HASH>, <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, <PERCENTAGE>, <DIMENSION>, <UNICODE_RANGE>, <URI>, <FUNCTION>, "progid:".) *#foo { }
Any progress on this issue ?
Any progress on this issue ? Sorry but no time at the moment and so many things to do. Any help is welcome
Sorry but no time at the moment and so many things to do. Any help is welcome
RBRi
calc support is on the way
release 1.6.0 is out
Hello @rbri htmlunit-cssparser not support css function calc()
Example 1
Example 2
Example 3
Example 4