mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibWeb: Remove cache for Paintable::is_visible()
...because it depends on computed values that could be changed without rebuilding paintable tree.
This commit is contained in:
parent
61148e9bc2
commit
1036e104ef
Notes:
sideshowbarker
2024-07-17 04:10:16 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 1036e104ef
Pull-request: https://github.com/SerenityOS/serenity/pull/23709
4 changed files with 30 additions and 4 deletions
|
@ -17,8 +17,6 @@ Paintable::Paintable(Layout::Node const& layout_node)
|
|||
, m_browsing_context(const_cast<HTML::BrowsingContext&>(layout_node.browsing_context()))
|
||||
{
|
||||
auto& computed_values = layout_node.computed_values();
|
||||
m_visible = computed_values.visibility() == CSS::Visibility::Visible && computed_values.opacity() != 0;
|
||||
|
||||
if (layout_node.is_grid_item() && computed_values.z_index().has_value()) {
|
||||
// https://www.w3.org/TR/css-grid-2/#z-order
|
||||
// grid items with z_index should behave as if position were "relative"
|
||||
|
@ -48,6 +46,12 @@ void Paintable::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_containing_block.value());
|
||||
}
|
||||
|
||||
bool Paintable::is_visible() const
|
||||
{
|
||||
auto const& computed_values = this->computed_values();
|
||||
return computed_values.visibility() == CSS::Visibility::Visible && computed_values.opacity() != 0;
|
||||
}
|
||||
|
||||
void Paintable::set_dom_node(JS::GCPtr<DOM::Node> dom_node)
|
||||
{
|
||||
m_dom_node = dom_node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue