table border spacing test for CSS3 calc
authormikelawther@chromium.org <mikelawther@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 12:39:03 +0000 (12:39 +0000)
committermikelawther@chromium.org <mikelawther@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jan 2012 12:39:03 +0000 (12:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76226

Reviewed by Julien Chaffraix.

Tests for future implementation of CSS3 calc() (see http://webkit.org/b/16662)

These tests are expected to 'fail', and will pass once calc() functionality is landed.
For now, they serve to demonstrate that the current code doesn't crash on these tests.

* css3/calc/table-border-spacing-expected.txt: Added.
* css3/calc/table-border-spacing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105869 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/css3/calc/table-border-spacing-expected.txt [new file with mode: 0644]
LayoutTests/css3/calc/table-border-spacing.html [new file with mode: 0644]

index d4ca761..26c403b 100644 (file)
@@ -1,3 +1,18 @@
+2012-01-25  Mike Lawther  <mikelawther@chromium.org>
+
+        table border spacing test for CSS3 calc
+        https://bugs.webkit.org/show_bug.cgi?id=76226
+
+        Reviewed by Julien Chaffraix.
+
+        Tests for future implementation of CSS3 calc() (see http://webkit.org/b/16662)
+
+        These tests are expected to 'fail', and will pass once calc() functionality is landed.
+        For now, they serve to demonstrate that the current code doesn't crash on these tests.
+
+        * css3/calc/table-border-spacing-expected.txt: Added.
+        * css3/calc/table-border-spacing.html: Added.
+
 2012-01-25  Csaba Osztrogonác  <ossy@webkit.org>
 
         Unreviewed gardening, Skipped list cleanup.
diff --git a/LayoutTests/css3/calc/table-border-spacing-expected.txt b/LayoutTests/css3/calc/table-border-spacing-expected.txt
new file mode 100644 (file)
index 0000000..358ef03
--- /dev/null
@@ -0,0 +1,6 @@
+FAIL document.getElementById("stimulus").offsetWidth should be 416. Was 278.
+FAIL document.getElementById("stimulus").offsetHeight should be 205. Was 136.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/css3/calc/table-border-spacing.html b/LayoutTests/css3/calc/table-border-spacing.html
new file mode 100644 (file)
index 0000000..cff1bd5
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<style>
+    td { 
+        padding: 0; 
+        width: 50px; 
+        height: 60px; 
+        background-color: blue; 
+        border: 1px solid black 
+    }
+    table { 
+        border-spacing: -webkit-calc(10px * 2 + 5px); 
+        border: 3px solid black; 
+    }
+</style>
+<table id="stimulus">
+    <tr>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+    </tr>
+    <tr>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+        <td></td>
+    </tr>
+</table>
+<script>
+    var innerBorder = 1;
+    var outerBorder = 3;
+    var innerWidth = 50 + 2 * innerBorder;
+    var innerHeight = 60 + 2 * innerBorder;
+    var borderSpacing = 25;
+    var rows = 2;
+    var columns = 5;
+
+    var expectedWidth = innerWidth * columns + borderSpacing * (columns + 1) + 2 * outerBorder;
+    var expectedHeight = innerHeight * rows + borderSpacing * (rows + 1) + 2 * outerBorder;
+
+    shouldEvaluateTo('document.getElementById("stimulus").offsetWidth', expectedWidth);
+    shouldEvaluateTo('document.getElementById("stimulus").offsetHeight', expectedHeight);
+</script>    
+<script src="../../fast/js/resources/js-test-post.js"></script>
+