mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Call prepare_for_replaced_layout() on replaced boxes in GFC
We need to call prepare_for_replaced_layout() on grid items to populate their natural sizes and aspect ration.
This commit is contained in:
committed by
Andreas Kling
parent
a559dca816
commit
549dee4db1
@@ -8,6 +8,7 @@
|
||||
#include <LibWeb/DOM/Node.h>
|
||||
#include <LibWeb/Layout/Box.h>
|
||||
#include <LibWeb/Layout/GridFormattingContext.h>
|
||||
#include <LibWeb/Layout/ReplacedBox.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
@@ -1845,6 +1846,12 @@ void GridFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const
|
||||
box_state.set_indefinite_content_width();
|
||||
if (!computed_values.height().is_length())
|
||||
box_state.set_indefinite_content_height();
|
||||
|
||||
if (item.box->is_replaced_box()) {
|
||||
auto& replaced_box = static_cast<Layout::ReplacedBox const&>(*item.box);
|
||||
// FIXME: This const_cast is gross.
|
||||
const_cast<Layout::ReplacedBox&>(replaced_box).prepare_for_replaced_layout();
|
||||
}
|
||||
}
|
||||
|
||||
// Do the first pass of resolving grid items box metrics to compute values that are independent of a track width
|
||||
|
||||
Reference in New Issue
Block a user