Skip to content

Commit 6935de2

Browse files
committed
fixed: Bug in margin / padding with position: absolute #79
1 parent 1154e56 commit 6935de2

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/render_block_context.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ int litehtml::render_item_block_context::_render_content(int x, int y, int max_w
3030
if(el->src_el()->css().get_position() == element_position_absolute || el->src_el()->css().get_position() == element_position_fixed)
3131
{
3232
el->render(0, child_top, max_width);
33-
el->pos().x += el->content_offset_left();
34-
el->pos().y += el->content_offset_top();
3533
} else
3634
{
3735
child_top = get_cleared_top(el, child_top);

test/render/test15.htm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
div {
6+
position: absolute;
7+
width: 100px;
8+
height: 100px;
9+
margin-left: 100px;
10+
background-color: red;
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
16+
<div></div>
17+
18+
</body>
19+
</html>

test/render/test15.htm.png

112 Bytes
Loading

0 commit comments

Comments
 (0)