1<?php
2
3class TestLineHeight100 extends GenericTest {
4  function testHeightsWithBR() {
5    $tree = $this->runPipeline('
6<html>
7<head>
8<style type="text/css">
9body   { font-size: 10mm; }
10#div1 { height: 100mm; float: left; background-color: green; width: 100mm; }
11#div2 { line-height: 1; float: left; background-color: red; width: 100mm; }
12</style>
13</head>
14<body>
15<div id="div1">&nbsp;</div>
16<div id="div2">
17LINE1<br/>
18LINE2<br/>
19LINE3<br/>
20LINE4<br/>
21LINE5<br/>
22LINE6<br/>
23LINE7<br/>
24LINE8<br/>
25LINE9<br/>
26LINE10<br/>
27</div>
28</body>
29</html>
30');
31
32    $first_div  = $tree->get_element_by_id('div1');
33    $second_div = $tree->get_element_by_id('div2');
34
35    $this->assertWithinMargin($first_div->get_full_height(),
36                              $second_div->get_full_height(),
37                              0.01,
38                              "DIVs have different heights! [%s]");
39  }
40
41  function testHeightsWithoutBR() {
42    $tree = $this->runPipeline('
43<html>
44<head>
45<style type="text/css">
46body   { font-size: 10mm; }
47#div1 { height: 100mm; float: left; background-color: green; width: 100mm; }
48#div2 { line-height: 1; float: left; background-color: red; width: 2em; }
49</style>
50</head>
51<body>
52<div id="div1">&nbsp;</div>
53<div id="div2">
54LINE1
55LINE2
56LINE3
57LINE4
58LINE5
59LINE6
60LINE7
61LINE8
62LINE9
63LINE10
64</div>
65</body>
66</html>
67');
68
69    $first_div  = $tree->get_element_by_id('div1');
70    $second_div = $tree->get_element_by_id('div2');
71
72    $this->assertWithinMargin($first_div->get_full_height(),
73                              $second_div->get_full_height(),
74                              0.01,
75                              "DIVs have different heights! [%s]");
76  }
77}
78
79?>