@@ -181,7 +181,7 @@ void litehtml::element::draw( uint_ptr hdc, int x, int y, const position* clip )
181
181
182
182
draw_background (hdc, x, y, clip);
183
183
184
- if (m_overflow == overflow_hidden )
184
+ if (m_overflow > overflow_visible )
185
185
{
186
186
m_doc->container ()->set_clip (pos, true , true );
187
187
}
@@ -218,7 +218,7 @@ void litehtml::element::draw( uint_ptr hdc, int x, int y, const position* clip )
218
218
el->draw (hdc, pos.left (), pos.top (), clip);
219
219
}
220
220
221
- if (m_overflow == overflow_hidden )
221
+ if (m_overflow > overflow_visible )
222
222
{
223
223
m_doc->container ()->del_clip ();
224
224
}
@@ -442,6 +442,16 @@ int litehtml::element::render( int x, int y, int max_width )
442
442
m_margins.top = m_doc->cvt_units (m_css_margins.top , m_font_size);
443
443
m_margins.bottom = m_doc->cvt_units (m_css_margins.bottom , m_font_size);
444
444
445
+ // reset auto margins
446
+ if (m_css_margins.left .is_predefined ())
447
+ {
448
+ m_margins.left = 0 ;
449
+ }
450
+ if (m_css_margins.right .is_predefined ())
451
+ {
452
+ m_margins.right = 0 ;
453
+ }
454
+
445
455
m_pos.move_to (x, y);
446
456
447
457
m_pos.x += content_margins_left ();
@@ -2157,6 +2167,17 @@ int litehtml::element::place_element( element* el, int max_width )
2157
2167
case display_inline_block:
2158
2168
ret_width = el->render (line_left, line_top, line_right);
2159
2169
break ;
2170
+ case display_block:
2171
+ if (el->is_replaced () || el->is_floats_holder ())
2172
+ {
2173
+ el->m_pos .width = el->m_css_width .calc_percent (line_right - line_left);
2174
+ el->m_pos .height = el->m_css_height .calc_percent (0 );
2175
+ if (el->m_pos .width || el->m_pos .height )
2176
+ {
2177
+ el->calc_outlines (line_right - line_left);
2178
+ }
2179
+ }
2180
+ break ;
2160
2181
case display_inline_text:
2161
2182
{
2162
2183
litehtml::size sz;
@@ -2228,7 +2249,7 @@ int litehtml::element::place_element( element* el, int max_width )
2228
2249
case display_table_cell:
2229
2250
case display_table_caption:
2230
2251
case display_table_row:
2231
- if (el->is_replaced ())
2252
+ if (el->is_replaced () || el-> is_floats_holder () )
2232
2253
{
2233
2254
ret_width = el->render (line_left, line_top, line_right - line_left);
2234
2255
} else
@@ -2448,3 +2469,8 @@ litehtml::position litehtml::element::get_placement()
2448
2469
}
2449
2470
return pos;
2450
2471
}
2472
+
2473
+ void litehtml::element::reset_size ()
2474
+ {
2475
+
2476
+ }
0 commit comments