summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
index d14fac4065..4129758f8e 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
@@ -937,6 +937,11 @@ NonnullRefPtr<StyleProperties> StyleComputer::create_document_style() const
compute_font(style, nullptr);
compute_defaulted_values(style, nullptr);
absolutize_values(style, nullptr);
+ if (auto* browsing_context = m_document.browsing_context()) {
+ auto viewport_rect = browsing_context->viewport_rect();
+ style->set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length::make_px(viewport_rect.width())));
+ style->set_property(CSS::PropertyID::Height, CSS::LengthStyleValue::create(CSS::Length::make_px(viewport_rect.height())));
+ }
return style;
}