mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 14:12:52 +00:00
LibHTML: Move layout root from HtmlView to Document
The layout root is now kept alive via Document::m_layout_root. This will allow us to do more layout-related things inside the inner layer of LibHTML without reaching out to the HtmlView. I'd like to keep HtmlView at a slightly higher level, to prevent it from getting too complex. This patch also fixes accidental disconnection of the layout tree from the DOM after doing a layout tree rebuild. ~LayoutNode() now only unsets the DOM node's layout_node() if it's itself.
This commit is contained in:
parent
48ef1d1bd1
commit
49ac0c2e24
Notes:
sideshowbarker
2024-07-19 11:42:50 +09:00
Author: https://github.com/awesomekling
Commit: 49ac0c2e24
6 changed files with 51 additions and 20 deletions
|
@ -17,7 +17,7 @@ LayoutNode::LayoutNode(const Node* node)
|
|||
|
||||
LayoutNode::~LayoutNode()
|
||||
{
|
||||
if (m_node)
|
||||
if (m_node && m_node->layout_node() == this)
|
||||
m_node->set_layout_node({}, nullptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue