mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:17:46 +00:00
LibWeb: Tidy up Layout::TreeBuilder ancestor stack a little bit
- Make it a vector of references since we never put null pointers on the ancestor stack. - Use Vector::in_reverse() to iterate backwards.
This commit is contained in:
parent
118d381091
commit
6712bbc0ee
2 changed files with 9 additions and 9 deletions
|
@ -26,8 +26,8 @@ private:
|
|||
|
||||
void create_layout_tree(DOM::Node&, Context&);
|
||||
|
||||
void push_parent(Layout::NodeWithStyle& node) { m_parent_stack.append(&node); }
|
||||
void pop_parent() { m_parent_stack.take_last(); }
|
||||
void push_parent(Layout::NodeWithStyle& node) { m_ancestor_stack.append(node); }
|
||||
void pop_parent() { m_ancestor_stack.take_last(); }
|
||||
|
||||
template<CSS::Display::Internal, typename Callback>
|
||||
void for_each_in_tree_with_internal_display(NodeWithStyle& root, Callback);
|
||||
|
@ -41,7 +41,7 @@ private:
|
|||
void generate_missing_parents(NodeWithStyle& root);
|
||||
|
||||
RefPtr<Layout::Node> m_layout_root;
|
||||
Vector<Layout::NodeWithStyle*> m_parent_stack;
|
||||
Vector<Layout::NodeWithStyle&> m_ancestor_stack;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue