File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
main/java/com/itextpdf/styledxmlparser/css/util
test/java/com/itextpdf/styledxmlparser/css/util Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ private static boolean isDigit(char ch) {
441441 }
442442
443443 private static boolean isExponentNotation (String s , int index ) {
444- return index < s .length () && s .charAt (index ) == 'e' &&
444+ return index < s .length () && Character . toLowerCase ( s .charAt (index ) ) == 'e' &&
445445 // e.g. 12e5
446446 (index + 1 < s .length () && isDigit (s .charAt (index + 1 )) ||
447447 // e.g. 12e-5, 12e+5
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ public void parseAbsoluteLengthFromNull() {
166166 }
167167
168168 @ Test
169- public void parseAboluteLengthExponential01 () {
169+ public void parseAbsoluteLengthExponentialPtTest () {
170170 String value = "1e2pt" ;
171171 float actual = CssDimensionParsingUtils .parseAbsoluteLength (value );
172172 float expected = 1e2f ;
@@ -175,14 +175,23 @@ public void parseAboluteLengthExponential01() {
175175 }
176176
177177 @ Test
178- public void parseAboluteLengthExponential02 () {
178+ public void parseAbsoluteLengthExponentialPxTest () {
179179 String value = "1e2px" ;
180180 float actual = CssDimensionParsingUtils .parseAbsoluteLength (value );
181181 float expected = 1e2f * 0.75f ;
182182
183183 Assert .assertEquals (expected , actual , 0 );
184184 }
185185
186+ @ Test
187+ public void parseAbsoluteLengthExponentialCapitalTest () {
188+ String value = "1E-4" ;
189+ float actual = CssDimensionParsingUtils .parseAbsoluteLength (value );
190+ float expected = 1e-4f * 0.75f ;
191+
192+ Assert .assertEquals (expected , actual , 1e-9 );
193+ }
194+
186195 @ Test
187196 public void parseAbsoluteLength12cmTest () {
188197 // Calculations in CssUtils#parseAbsoluteLength were changed to work
You can’t perform that action at this time.
0 commit comments