Browse Source

Don't dirty parents of layout boundaries

Michael Ragazzon 6 months ago
parent
commit
525d48e25a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      Source/Core/Layout/LayoutNode.cpp

+ 6 - 0
Source/Core/Layout/LayoutNode.cpp

@@ -39,6 +39,12 @@ void LayoutNode::DirtyUpToClosestLayoutBoundary()
 	if (!IsSelfDirty())
 		return;
 
+	// Later on, we might expand the definition of layout boundaries from just absolutely positioned elements. For
+	// example, for flexible boxes, we can make them conditional, in the sense that its parent layout boundary needs to
+	// be layed-out again if (and only if) the flex container changes size after its next layout.
+	if (IsLayoutBoundary())
+		return;
+
 	for (Element* parent = element->GetParentNode(); parent; parent = parent->GetParentNode())
 	{
 		LayoutNode* parent_node = parent->GetLayoutNode();