Skip to content

Commit b5709a1

Browse files
authored
Merge pull request #494 from w3c/fix-calc-number-getlength
fix: Handle calc() with number type in CSS position checking
2 parents e62bbcf + 1eb2aed commit b5709a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

org/w3c/css/values/CssCalc.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,14 @@ public CssLength getLength() throws InvalidParamException {
410410
return val2.getLength();
411411
}
412412
}
413+
if (computed_type == CssTypes.CSS_NUMBER) {
414+
if (val1.getType() == CssTypes.CSS_NUMBER) {
415+
return val1.getLength();
416+
}
417+
if (val2.getType() == CssTypes.CSS_NUMBER) {
418+
return val2.getLength();
419+
}
420+
}
413421
throw new ClassCastException("unknown");
414422
}
415423

0 commit comments

Comments
 (0)