mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Store visibility for Paintables
For every invocation of `::before_paint()` and `::after_paint()`, we would reach into the node's computed values to determine its visibility. Let's just do this once during construction of the paintable instead, since this was showing up in profiles.
This commit is contained in:
parent
1871843acb
commit
7dc8062283
Notes:
github-actions[bot]
2025-06-17 09:56:41 +00:00
Author: https://github.com/gmta
Commit: 7dc8062283
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5104
2 changed files with 3 additions and 7 deletions
|
@ -24,6 +24,7 @@ Paintable::Paintable(Layout::Node const& layout_node)
|
|||
m_positioned = computed_values.position() != CSS::Positioning::Static;
|
||||
}
|
||||
|
||||
m_visible = computed_values.visibility() == CSS::Visibility::Visible && computed_values.opacity() != 0;
|
||||
m_fixed_position = computed_values.position() == CSS::Positioning::Fixed;
|
||||
m_sticky_position = computed_values.position() == CSS::Positioning::Sticky;
|
||||
m_absolutely_positioned = computed_values.position() == CSS::Positioning::Absolute;
|
||||
|
@ -45,12 +46,6 @@ 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;
|
||||
}
|
||||
|
||||
DOM::Document const& Paintable::document() const
|
||||
{
|
||||
return layout_node().document();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue