summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout/LayoutBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibWeb/Layout/LayoutBlock.cpp')
-rw-r--r--Libraries/LibWeb/Layout/LayoutBlock.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp
index 863cec0b40..65579994e1 100644
--- a/Libraries/LibWeb/Layout/LayoutBlock.cpp
+++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp
@@ -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());