mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:28:11 +00:00
LibWeb: Invalidate style when a browsing context's viewport is resized
Anything with viewport-relative CSS lengths (vw/vh/vmin/vmax) needs to have its style recomputed if the viewport size changes.
This commit is contained in:
parent
2be4064ca8
commit
cf69cc7f7d
1 changed files with 4 additions and 2 deletions
|
@ -97,8 +97,10 @@ void BrowsingContext::set_viewport_rect(Gfx::IntRect const& rect)
|
||||||
|
|
||||||
if (m_size != rect.size()) {
|
if (m_size != rect.size()) {
|
||||||
m_size = rect.size();
|
m_size = rect.size();
|
||||||
if (auto* document = active_document())
|
if (auto* document = active_document()) {
|
||||||
document->set_needs_layout();
|
// NOTE: Resizing the viewport changes the reference value for viewport-relative CSS lengths.
|
||||||
|
document->invalidate_style();
|
||||||
|
}
|
||||||
did_change = true;
|
did_change = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue