@@ -430,6 +430,14 @@ public CssPercentage getPercentage() throws InvalidParamException {
430430 return val2 .getPercentage ();
431431 }
432432 }
433+ if (computed_type == CssTypes .CSS_NUMBER ) {
434+ if (val1 .getType () == CssTypes .CSS_NUMBER ) {
435+ return val1 .getPercentage ();
436+ }
437+ if (val2 .getType () == CssTypes .CSS_NUMBER ) {
438+ return val2 .getPercentage ();
439+ }
440+ }
433441 throw new ClassCastException ("unknown" );
434442 }
435443
@@ -454,6 +462,14 @@ public CssTime getTime() throws InvalidParamException {
454462 return val2 .getTime ();
455463 }
456464 }
465+ if (computed_type == CssTypes .CSS_NUMBER ) {
466+ if (val1 .getType () == CssTypes .CSS_NUMBER ) {
467+ return val1 .getTime ();
468+ }
469+ if (val2 .getType () == CssTypes .CSS_NUMBER ) {
470+ return val2 .getTime ();
471+ }
472+ }
457473 throw new ClassCastException ("unknown" );
458474 }
459475
@@ -466,6 +482,14 @@ public CssAngle getAngle() throws InvalidParamException {
466482 return val2 .getAngle ();
467483 }
468484 }
485+ if (computed_type == CssTypes .CSS_NUMBER ) {
486+ if (val1 .getType () == CssTypes .CSS_NUMBER ) {
487+ return val1 .getAngle ();
488+ }
489+ if (val2 .getType () == CssTypes .CSS_NUMBER ) {
490+ return val2 .getAngle ();
491+ }
492+ }
469493 throw new ClassCastException ("unknown" );
470494 }
471495
@@ -478,6 +502,14 @@ public CssFrequency getFrequency() throws InvalidParamException {
478502 return val2 .getFrequency ();
479503 }
480504 }
505+ if (computed_type == CssTypes .CSS_NUMBER ) {
506+ if (val1 .getType () == CssTypes .CSS_NUMBER ) {
507+ return val1 .getFrequency ();
508+ }
509+ if (val2 .getType () == CssTypes .CSS_NUMBER ) {
510+ return val2 .getFrequency ();
511+ }
512+ }
481513 throw new ClassCastException ("unknown" );
482514 }
483515
0 commit comments