LibWeb: Make intrinsic width/height/ratio a Box concept and simplify it

Apparently it's not only replaced elements that can have intrinsic
sizes, so let's move this concept from ReplacedBox to Box. To avoid
bloating Box, we make the accessors virtual.
This commit is contained in:
Andreas Kling 2021-10-14 18:37:24 +02:00
commit 81590b1804
Notes: sideshowbarker 2024-07-18 02:22:41 +09:00
9 changed files with 21 additions and 40 deletions

View file

@ -26,8 +26,6 @@ void FrameBox::prepare_for_replaced_layout()
{
VERIFY(dom_node().nested_browsing_context());
set_has_intrinsic_width(true);
set_has_intrinsic_height(true);
// FIXME: Do proper error checking, etc.
set_intrinsic_width(dom_node().attribute(HTML::AttributeNames::width).to_int().value_or(300));
set_intrinsic_height(dom_node().attribute(HTML::AttributeNames::height).to_int().value_or(150));