| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
class TestPositionHorizontalAbsolutePositioned extends GenericTest {
|
|
|
4 |
function testPositionHorizontalbsolutePositioned1() {
|
|
|
5 |
$media = null;
|
|
|
6 |
$pipeline = null;
|
|
|
7 |
$tree = $this->runPipeline(file_get_contents('test.position.horizontal.absolute.positioned.1.html'),
|
|
|
8 |
$media,
|
|
|
9 |
$pipeline);
|
|
|
10 |
|
|
|
11 |
$font_size = $tree->getCSSProperty(CSS_FONT_SIZE);
|
|
|
12 |
$base = $font_size->getPoints();
|
|
|
13 |
|
|
|
14 |
$element =& $tree->get_element_by_id('div1');
|
|
|
15 |
$this->assertEqual($element->get_left(),
|
|
|
16 |
mm2pt($media->margins['left']),
|
|
|
17 |
'DIV with no positioning is positioned incorrectly [%s]');
|
|
|
18 |
|
|
|
19 |
$element =& $tree->get_element_by_id('div2');
|
|
|
20 |
$this->assertEqual($element->get_left(),
|
|
|
21 |
mm2pt($media->margins['left']) + px2pt(100),
|
|
|
22 |
'DIV with "left" property is positioned incorrectly [%s]');
|
|
|
23 |
|
|
|
24 |
$element =& $tree->get_element_by_id('div3');
|
|
|
25 |
$this->assertEqual($element->get_right(),
|
|
|
26 |
mm2pt($media->width() - $media->margins['right']) - px2pt(100),
|
|
|
27 |
'DIV with "right" property is positioned incorrectly [%s]');
|
|
|
28 |
|
|
|
29 |
$element =& $tree->get_element_by_id('div4');
|
|
|
30 |
$this->assertEqual($element->get_left(),
|
|
|
31 |
mm2pt($media->margins['left']),
|
|
|
32 |
'DIV with long text and "right" property is positioned incorrectly [%s]');
|
|
|
33 |
|
|
|
34 |
$element =& $tree->get_element_by_id('div5');
|
|
|
35 |
$this->assertEqual($element->get_left(),
|
|
|
36 |
mm2pt($media->margins['left']) + px2pt(100),
|
|
|
37 |
'DIV with long text and "left" property is positioned incorrectly [%s]');
|
|
|
38 |
}
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
?>
|