summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-05-08 22:40:20 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-08 22:40:20 +0200
commit6e9c57fcc304f0dae475b40826bd4faec28f0472 (patch)
treecb613a7c031abed6dca4f6387ef57d9e8f4f47c7
parent85a3678b4fde901fde743c347a4847ef7e73ed20 (diff)
downloadserenity-6e9c57fcc304f0dae475b40826bd4faec28f0472.zip
LibWeb: Generate a new list item marker on every layout
This is a workaround for the silly issue where some content would move one pixel upward on every layout. The block layout code was finding the list item marker and doing regular inline layout on it. We were not prepared to handle this, which caused it to move in a silly way. For now, just regenerate markers on every layout to work around the issue. In the future we should figure out a nice way to layout markers.
-rw-r--r--Libraries/LibWeb/Layout/LayoutListItem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutListItem.cpp b/Libraries/LibWeb/Layout/LayoutListItem.cpp
index 0be7366b74..2d14fb0ce6 100644
--- a/Libraries/LibWeb/Layout/LayoutListItem.cpp
+++ b/Libraries/LibWeb/Layout/LayoutListItem.cpp
@@ -40,6 +40,11 @@ LayoutListItem::~LayoutListItem()
void LayoutListItem::layout()
{
+ if (m_marker) {
+ remove_child(*m_marker);
+ m_marker = nullptr;
+ }
+
LayoutBlock::layout();
if (!m_marker) {