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) {
441
441
}
442
442
443
443
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' &&
445
445
// e.g. 12e5
446
446
(index + 1 < s .length () && isDigit (s .charAt (index + 1 )) ||
447
447
// e.g. 12e-5, 12e+5
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ public void parseAbsoluteLengthFromNull() {
166
166
}
167
167
168
168
@ Test
169
- public void parseAboluteLengthExponential01 () {
169
+ public void parseAbsoluteLengthExponentialPtTest () {
170
170
String value = "1e2pt" ;
171
171
float actual = CssDimensionParsingUtils .parseAbsoluteLength (value );
172
172
float expected = 1e2f ;
@@ -175,14 +175,23 @@ public void parseAboluteLengthExponential01() {
175
175
}
176
176
177
177
@ Test
178
- public void parseAboluteLengthExponential02 () {
178
+ public void parseAbsoluteLengthExponentialPxTest () {
179
179
String value = "1e2px" ;
180
180
float actual = CssDimensionParsingUtils .parseAbsoluteLength (value );
181
181
float expected = 1e2f * 0.75f ;
182
182
183
183
Assert .assertEquals (expected , actual , 0 );
184
184
}
185
185
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
+
186
195
@ Test
187
196
public void parseAbsoluteLength12cmTest () {
188
197
// Calculations in CssUtils#parseAbsoluteLength were changed to work
You can’t perform that action at this time.
0 commit comments