Title: [144689] trunk/LayoutTests
Revision
144689
Author
[email protected]
Date
2013-03-04 15:45:05 -0800 (Mon, 04 Mar 2013)

Log Message

CSS3 calc: identify divide by zero cases at parse time
https://bugs.webkit.org/show_bug.cgi?id=80411

Patch by Alan Cutter <[email protected]> on 2013-03-04
Reviewed by Tony Chang.

Added tests to check whether divide by 0 cases are caught.

* css3/calc/catch-divide-by-0-expected.txt: Added.
* css3/calc/catch-divide-by-0.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (144688 => 144689)


--- trunk/LayoutTests/ChangeLog	2013-03-04 23:36:25 UTC (rev 144688)
+++ trunk/LayoutTests/ChangeLog	2013-03-04 23:45:05 UTC (rev 144689)
@@ -1,3 +1,15 @@
+2013-03-04  Alan Cutter  <[email protected]>
+
+        CSS3 calc: identify divide by zero cases at parse time
+        https://bugs.webkit.org/show_bug.cgi?id=80411
+
+        Reviewed by Tony Chang.
+
+        Added tests to check whether divide by 0 cases are caught.
+
+        * css3/calc/catch-divide-by-0-expected.txt: Added.
+        * css3/calc/catch-divide-by-0.html: Added.
+
 2013-03-04  Julien Chaffraix  <[email protected]>
 
         [CSS Grid Layout] Add parsing for grid-{start|before}

Added: trunk/LayoutTests/css3/calc/catch-divide-by-0-expected.txt (0 => 144689)


--- trunk/LayoutTests/css3/calc/catch-divide-by-0-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/calc/catch-divide-by-0-expected.txt	2013-03-04 23:45:05 UTC (rev 144689)
@@ -0,0 +1,11 @@
+This tests catching of divide by 0 in calc() at parse time
+
+100px / 0 => 
+100px / (0) => 
+100px / (2 - 2) => 
+100px / (2 - (-62 + 64)) => 
+100px * (1 / 0) => 
+100px * (1 / (0)) => 
+100px * (1 / (2 - 2)) => 
+100px * (1 / (2 - (-62 + 64))) => 
+

Added: trunk/LayoutTests/css3/calc/catch-divide-by-0.html (0 => 144689)


--- trunk/LayoutTests/css3/calc/catch-divide-by-0.html	                        (rev 0)
+++ trunk/LayoutTests/css3/calc/catch-divide-by-0.html	2013-03-04 23:45:05 UTC (rev 144689)
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<div id="dummy"></div>
+<div id="results">This tests catching of divide by 0 in calc() at parse time<br><br></div>
+<script>
+if (window.testRunner)
+    window.testRunner.dumpAsText();
+
+var tests = [
+    "100px / 0",
+    "100px / (0)",
+    "100px / (2 - 2)",
+    "100px / (2 - (-62 + 64))",
+    "100px * (1 / 0)",
+    "100px * (1 / (0))",
+    "100px * (1 / (2 - 2))",
+    "100px * (1 / (2 - (-62 + 64)))",
+];
+
+var results = document.getElementById("results");
+var dummy = document.getElementById("dummy");
+for (var i = 0; i < tests.length; ++i) {
+    var _expression_ = tests[i];
+    dummy.style.width = 'calc(' + _expression_ + ')';
+    results.innerHTML += _expression_ + " => " + dummy.style.width + "<br>";
+}
+</script>
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to