Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4243738

Browse filesBrowse files
committed
fix: disable top/bottom margin collapse for elements with 'position:fixed'
1 parent 2d34cb9 commit 4243738
Copy full SHA for 4243738

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed

‎include/litehtml/render_item.h

Copy file name to clipboardExpand all lines: include/litehtml/render_item.h
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ namespace litehtml
348348
m_element->css().get_float() == float_none &&
349349
m_margins.top >= 0 &&
350350
!is_flex_item() &&
351-
!is_root();
351+
!is_root() &&
352+
css().get_position() != element_position_fixed;
352353
}
353354

354355
bool collapse_bottom_margin() const
@@ -358,7 +359,8 @@ namespace litehtml
358359
m_element->in_normal_flow() &&
359360
m_element->css().get_float() == float_none &&
360361
m_margins.bottom >= 0 &&
361-
!is_root();
362+
!is_root() &&
363+
css().get_position() != element_position_fixed;
362364
}
363365

364366
bool is_visible() const

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.