Title: [105647] trunk/LayoutTests
Revision
105647
Author
[email protected]
Date
2012-01-23 15:32:40 -0800 (Mon, 23 Jan 2012)

Log Message

getComputedStyle margin percentage test for CSS calc
https://bugs.webkit.org/show_bug.cgi?id=76130

Reviewed by Darin Adler.

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/getComputedStyle-margin-percentage-expected.txt: Added.
* css3/calc/getComputedStyle-margin-percentage.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105646 => 105647)


--- trunk/LayoutTests/ChangeLog	2012-01-23 23:30:57 UTC (rev 105646)
+++ trunk/LayoutTests/ChangeLog	2012-01-23 23:32:40 UTC (rev 105647)
@@ -1,3 +1,18 @@
+2012-01-23  Mike Lawther  <[email protected]>
+
+        getComputedStyle margin percentage test for CSS calc
+        https://bugs.webkit.org/show_bug.cgi?id=76130
+
+        Reviewed by Darin Adler.
+
+        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/getComputedStyle-margin-percentage-expected.txt: Added.
+        * css3/calc/getComputedStyle-margin-percentage.html: Added.
+
 2012-01-23  Adam Barth  <[email protected]>
 
         Update the baselines for a number of tests that use gradients.  The new

Added: trunk/LayoutTests/css3/calc/getComputedStyle-margin-percentage-expected.txt (0 => 105647)


--- trunk/LayoutTests/css3/calc/getComputedStyle-margin-percentage-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/calc/getComputedStyle-margin-percentage-expected.txt	2012-01-23 23:32:40 UTC (rev 105647)
@@ -0,0 +1,13 @@
+Tests calling getPropertyValue on computed margin styles involving CSS calc
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+FAIL getComputedStyle(document.getElementById('calc'), null).getPropertyValue('margin-left') should be 253px. Was 0px.
+FAIL getComputedStyle(document.getElementById('calc'), null).getPropertyValue('margin-top') should be 76px. Was 0px.
+FAIL getComputedStyle(document.getElementById('calc'), null).getPropertyValue('margin-right') should be 346px. Was 0px.
+FAIL getComputedStyle(document.getElementById('calc'), null).getPropertyValue('margin-bottom') should be 530px. Was 0px.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/css3/calc/getComputedStyle-margin-percentage.html (0 => 105647)


--- trunk/LayoutTests/css3/calc/getComputedStyle-margin-percentage.html	                        (rev 0)
+++ trunk/LayoutTests/css3/calc/getComputedStyle-margin-percentage.html	2012-01-23 23:32:40 UTC (rev 105647)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src=""
+<style>
+#control { 
+    margin-left: 33%;
+    margin-top: 10%;
+    margin-right: 45%;
+    margin-bottom: 69%;
+}
+#calc { 
+    margin-left: -webkit-calc(33%);
+    margin-top: -webkit-calc(10%);
+    margin-right: -webkit-calc(45%);
+    margin-bottom: -webkit-calc(69%);
+}
+</style>
+<div id="control"></div>
+<div id="calc"></div>
+<script>
+    function test(prop) {
+        shouldEvaluateTo("getComputedStyle(document.getElementById('calc'), null).getPropertyValue('" + prop + "')", "getComputedStyle(document.getElementById('control', null)).getPropertyValue('" + prop + "')");
+    }
+    
+    description("Tests calling getPropertyValue on computed margin styles involving CSS calc");
+    
+    test('margin-left');
+    test('margin-top');
+    test('margin-right');
+    test('margin-bottom');
+</script>
+<script src=""
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to