Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: LayoutTests/css-parser/scientific-notation.html

Issue 545173003: Support scientific notation in CSS numbers/percentages/dimensions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop parseSVGNumber; Add additional TC. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/css-parser/scientific-notation.html
diff --git a/LayoutTests/css-parser/scientific-notation.html b/LayoutTests/css-parser/scientific-notation.html
new file mode 100644
index 0000000000000000000000000000000000000000..b1f57f948c9be970539194efc643dcfece526a4a
--- /dev/null
+++ b/LayoutTests/css-parser/scientific-notation.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="resources/property-parsing-test.js"></script>
+<script>
+assert_valid_value("opacity", "2e2", "200");
+assert_valid_value("opacity", "2E2", "200");
+assert_valid_value("opacity", "2e+2", "200");
+assert_valid_value("opacity", "2E+2", "200");
+assert_valid_value("opacity", "2e-2", "0.02");
+assert_valid_value("opacity", "2E-2", "0.02");
+assert_valid_value("opacity", "2e200", "2e+200");
+assert_valid_value("opacity", "2E200", "2e+200");
+assert_valid_value("opacity", "2e+200", "2e+200");
+assert_valid_value("opacity", "2E+200", "2e+200");
+assert_valid_value("opacity", "2e-200", "2e-200");
+assert_valid_value("opacity", "2E-200", "2e-200");
+assert_valid_value("opacity", "1e0", "1");
+assert_valid_value("opacity", "1e+0", "1");
+assert_valid_value("opacity", "1e-0", "1");
+assert_valid_value("opacity", "1e10", "10000000000");
+assert_valid_value("opacity", "1e+10", "10000000000");
+assert_valid_value("opacity", "1e-10", "1e-10");
+assert_valid_value("width", "2e2px", "200px");
+assert_valid_value("width", "2E2px", "200px");
+assert_valid_value("width", "2e+2px", "200px");
+assert_valid_value("width", "2E+2px", "200px");
+assert_valid_value("width", "2e-2px", "0.02px");
+assert_valid_value("width", "2E-2px", "0.02px");
+assert_valid_value("width", "2e200px", "2e+200px");
+assert_valid_value("width", "2E200px", "2e+200px");
+assert_valid_value("width", "2e+200px", "2e+200px");
+assert_valid_value("width", "2E+200px", "2e+200px");
+assert_valid_value("width", "2e-200px", "2e-200px");
+assert_valid_value("width", "2E-200px", "2e-200px");
+assert_valid_value("width", "1e0px", "1px");
+assert_valid_value("width", "1e+0px", "1px");
+assert_valid_value("width", "1e-0px", "1px");
+assert_valid_value("width", "1e10px", "10000000000px");
+assert_valid_value("width", "1e+10px", "10000000000px");
+assert_valid_value("width", "1e-10px", "1e-10px");
+assert_valid_value("width", "1e0em", "1em");
+assert_valid_value("width", "1e+0em", "1em");
+assert_valid_value("width", "1e-0em", "1em");
+assert_valid_value("width", "1e10em", "10000000000em");
+assert_valid_value("width", "1e+10em", "10000000000em");
+assert_valid_value("width", "1e-10em", "1e-10em");
+assert_valid_value("width", "1e0%", "1%");
+assert_valid_value("width", "1e+0%", "1%");
+assert_valid_value("width", "1e-0%", "1%");
+assert_valid_value("width", "1e10%", "10000000000%");
+assert_valid_value("width", "1e+10%", "10000000000%");
+assert_valid_value("width", "1e-10%", "1e-10%");
+// Large exponents (not representable). This is not necessarily the correct value.
+assert_valid_value("opacity", "1e600", "0");
+assert_valid_value("opacity", "1e-600", "0");
+assert_valid_value("width", "1e600px", "0px");
+assert_valid_value("width", "1e-600px", "0px");
+
+assert_invalid_value("width", "1e1.0px");
+assert_invalid_value("width", "1e10.0px");
+assert_invalid_value("width", "1e1.0em");
+assert_invalid_value("width", "1e10.0em");
+</script>
« no previous file with comments | « LayoutTests/css-parser/resources/property-parsing-test.js ('k') | LayoutTests/svg/css/scientific-numbers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698