From 6e9c57fcc304f0dae475b40826bd4faec28f0472 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 8 May 2020 22:40:20 +0200 Subject: [PATCH] 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. --- Libraries/LibWeb/Layout/LayoutListItem.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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) {