mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +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:
parent
a559dca816
commit
549dee4db1
3 changed files with 28 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue