mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Check navigable container for whether element needs style update
The style of an element depends on it's navigable's viewport size which in turn depends on the navigable's container's style - so if requires a style update then so does the original element.
This commit is contained in:
Notes:
github-actions[bot]
2026-03-09 14:37:47 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/33c0e557629 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8244 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -1826,6 +1826,15 @@ bool Document::element_needs_style_update(AbstractElement const& abstract_elemen
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the navigable has a container and that container needs a style update, then we need one as well, since the
|
||||
// container's style can affect this element (e.g. via media queries or viewport units).
|
||||
if (auto navigable = this->navigable()) {
|
||||
if (auto container = navigable->container()) {
|
||||
if (container->document().element_needs_style_update(AbstractElement { *container }))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user