1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:57:35 +00:00

LibWeb: Remove Layout::Node::m_visible and compute it on the fly

This fixes an issue where the value would be out of sync with reality
in anonymous wrapper block boxes, since we forgot to compute m_visible
after assigning the computed values to them.

Fixes #21106
This commit is contained in:
Andreas Kling 2023-09-18 13:08:20 +02:00
parent 0a133ccba4
commit 1f69e9cddf
8 changed files with 32 additions and 9 deletions

View file

@ -640,8 +640,6 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
if (auto maybe_visibility = computed_style.visibility(); maybe_visibility.has_value())
computed_values.set_visibility(maybe_visibility.release_value());
m_visible = computed_values.opacity() != 0 && computed_values.visibility() == CSS::Visibility::Visible;
computed_values.set_width(computed_style.size_value(CSS::PropertyID::Width));
computed_values.set_min_width(computed_style.size_value(CSS::PropertyID::MinWidth));
computed_values.set_max_width(computed_style.size_value(CSS::PropertyID::MaxWidth));

View file

@ -156,9 +156,6 @@ public:
void removed_from(Node&) { }
void children_changed() { }
bool is_visible() const { return m_visible; }
void set_visible(bool visible) { m_visible = visible; }
virtual void set_needs_display();
bool children_are_inline() const { return m_children_are_inline; }
@ -194,7 +191,6 @@ private:
bool m_anonymous { false };
bool m_has_style { false };
bool m_visible { true };
bool m_children_are_inline { false };
SelectionState m_selection_state { SelectionState::None };