Commit 26421928 authored by mikelawther@chromium.org's avatar mikelawther@chromium.org
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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 09041a4e
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
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
<!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>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment