mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibWeb: Percentage 'height' should sometimes behave as 'auto'
Something like "height: 50%" is equivalent to "height: auto" unless the containing block has explicitly specified height.
This commit is contained in:
parent
afebbd1cd7
commit
8be74ea65c
1 changed files with 8 additions and 1 deletions
|
@ -659,7 +659,14 @@ void LayoutBlock::compute_height()
|
|||
{
|
||||
auto& containing_block = *this->containing_block();
|
||||
|
||||
auto specified_height = style().height().resolved_or_auto(*this, containing_block.height());
|
||||
Length specified_height;
|
||||
|
||||
if (style().height().is_percentage() && !containing_block.style().height().is_absolute()) {
|
||||
specified_height = Length::make_auto();
|
||||
} else {
|
||||
specified_height = style().height().resolved_or_auto(*this, containing_block.height());
|
||||
}
|
||||
|
||||
auto specified_max_height = style().max_height().resolved_or_auto(*this, containing_block.height());
|
||||
|
||||
box_model().margin.top = style().margin().top.resolved_or_zero(*this, containing_block.width());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue