Skip to content
Permalink
Browse files
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.


Canonical link: https://commits.webkit.org/93681@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mikelawther committed Jan 23, 2012
1 parent 0915e4d commit 948a1eef737d187255ae1836fe2b29c5cae55af0
Showing 3 changed files with 59 additions and 0 deletions.
@@ -1,3 +1,18 @@
2012-01-23 Mike Lawther <mikelawther@chromium.org>

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 <abarth@webkit.org>

Update the baselines for a number of tests that use gradients. The new
@@ -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

@@ -0,0 +1,31 @@
<!DOCTYPE html>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<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="../../fast/js/resources/js-test-post.js"></script>

0 comments on commit 948a1ee

Please sign in to comment.