mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
LibWeb: Delete parent state pointer in LayoutState
It's safe to remove this pointer because intrinsic layout should never look up a box's state beyond its containing block. This change affects the expectations of two layout tests, but both already differ slightly from other browsers, and the difference between expectations is less than 5px.
This commit is contained in:
parent
53cac71cec
commit
d8ff71fbb5
Notes:
github-actions[bot]
2025-03-26 12:09:02 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: d8ff71fbb5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3929
5 changed files with 29 additions and 58 deletions
|
@ -55,11 +55,6 @@ struct StaticPositionRect {
|
|||
};
|
||||
|
||||
struct LayoutState {
|
||||
LayoutState() = default;
|
||||
|
||||
explicit LayoutState(LayoutState const* parent);
|
||||
~LayoutState();
|
||||
|
||||
struct UsedValues {
|
||||
NodeWithStyle const& node() const { return *m_node; }
|
||||
NodeWithStyle& node() { return const_cast<NodeWithStyle&>(*m_node); }
|
||||
|
@ -200,19 +195,16 @@ struct LayoutState {
|
|||
Optional<StaticPositionRect> m_static_position_rect;
|
||||
};
|
||||
|
||||
~LayoutState();
|
||||
|
||||
// Commits the used values produced by layout and builds a paintable tree.
|
||||
void commit(Box& root);
|
||||
|
||||
// NOTE: get_mutable() will CoW the UsedValues if it's inherited from an ancestor state;
|
||||
UsedValues& get_mutable(NodeWithStyle const&);
|
||||
|
||||
// NOTE: get() will not CoW the UsedValues.
|
||||
UsedValues const& get(NodeWithStyle const&) const;
|
||||
|
||||
HashMap<GC::Ref<Layout::Node const>, NonnullOwnPtr<UsedValues>> used_values_per_layout_node;
|
||||
|
||||
LayoutState const* m_parent { nullptr };
|
||||
|
||||
private:
|
||||
void resolve_relative_positions();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue