+2011-06-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/9513180> REGRESSION (r84166): recalcStyle for display:inline to display:none transition has complexity N^2 where N is the number of child Text nodes
+ https://bugs.webkit.org/show_bug.cgi?id=61557
+
+ Replaced the fix for bug 58500 with a refined version.
+
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::clippedOverflowRectForRepaint): Use the containing block unless it is
+ across a layer boundary.
+
2011-06-12 Adam Barth <abarth@webkit.org>
Reviewed by Andreas Kling.
IntRect RenderText::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
{
- bool repaintContainerSkipped;
- RenderObject* container = this->container(repaintContainer, &repaintContainerSkipped);
- // The container may be an ancestor of repaintContainer, but we need to do a repaintContainer-relative repaint.
- if (repaintContainerSkipped)
+ RenderObject* rendererToRepaint = containingBlock();
+
+ // Do not cross self-painting layer boundaries.
+ RenderObject* enclosingLayerRenderer = enclosingLayer()->renderer();
+ if (enclosingLayerRenderer != rendererToRepaint && !rendererToRepaint->isDescendantOf(enclosingLayerRenderer))
+ rendererToRepaint = enclosingLayerRenderer;
+
+ // The renderer we chose to repaint may be an ancestor of repaintContainer, but we need to do a repaintContainer-relative repaint.
+ if (repaintContainer && repaintContainer != rendererToRepaint && !rendererToRepaint->isDescendantOf(repaintContainer))
return repaintContainer->clippedOverflowRectForRepaint(repaintContainer);
- return container->clippedOverflowRectForRepaint(repaintContainer);
+ return rendererToRepaint->clippedOverflowRectForRepaint(repaintContainer);
}
IntRect RenderText::selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool clipToVisibleContent)