Auto merge of #7496 - servo:calc_, r=SimonSapin

Implement CSS3 Calc

This is #7185 with one commit added to make it build merged with master, which got support for the `ch` unit in the meantime.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7496)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-02 02:33:18 -06:00
commit a547ae6826
21 changed files with 873 additions and 63 deletions

View file

@ -82,6 +82,7 @@ flaky_cpu == append_style_a.html append_style_b.html
== box_sizing_border_box_a.html box_sizing_border_box_ref.html
== box_sizing_sanity_check_a.html box_sizing_sanity_check_ref.html
== br.html br-ref.html
== calc-basic.html calc-basic-ref.html
== canvas_as_block_element_a.html canvas_as_block_element_ref.html
== canvas_linear_gradient_a.html canvas_linear_gradient_ref.html
== canvas_radial_gradient_a.html canvas_radial_gradient_ref.html

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<div id="outer">
<div id="inner">
</div>
</div>
<style>
#outer {
height: 100px;
width: 200px;
}
#inner {
height: 100%;
width: 110px;
background-color: green;
}
</style>

19
tests/ref/calc-basic.html Normal file
View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<div id="outer">
<div id="inner">
</div>
</div>
<style>
#outer {
height: 100px;
width: 200px;
}
#inner {
height: 100%;
width: calc(50px + 30%);
background-color: green;
}
</style>

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<title>font-size (issues #1435, #3417)</title>
<style>p { margin: .5em }</style>
<body style="font-size: 20px">
<p style="font-size: 24pt">24pt is 32px.
<p style="font-size: 2em">2em is 40px.

View file

@ -1,5 +1,6 @@
<!DOCTYPE html>
<title>font-size (issues #1435, #3417)</title>
<style>p { margin: .5em }</style>
<body>
<p style="font-size: 32px">24pt is 32px.
<p style="font-size: 40px">2em is 40px.