1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

LibWeb: Fix style updates for table box nodes

On style update, we have to preserve the invariant established when we
built the layout tree - some properties are applied to the table wrapper
and the table box values are reset to their initial values.

This also ensures that the containing block of a table box is always a
table wrapper, which isn't the case if we set absolute position on the
box instead of the wrapper.

Fixes #19452.
This commit is contained in:
Andi Gallo 2023-06-22 12:22:29 +00:00 committed by Andreas Kling
parent e28578363a
commit 55f1a70577
5 changed files with 57 additions and 15 deletions

View file

@ -195,13 +195,15 @@ public:
JS::NonnullGCPtr<NodeWithStyle> create_anonymous_wrapper() const;
void reset_table_box_computed_values_used_by_wrapper_to_init_values();
void transfer_table_box_computed_values_to_wrapper_computed_values(CSS::ComputedValues& wrapper_computed_values);
protected:
NodeWithStyle(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
NodeWithStyle(DOM::Document&, DOM::Node*, CSS::ComputedValues);
private:
void reset_table_box_computed_values_used_by_wrapper_to_init_values();
CSS::ComputedValues m_computed_values;
RefPtr<Gfx::Font const> m_font;
CSSPixels m_line_height { 0 };