[Webkit-unassigned] [Bug 61557] New: [REGRESSION] recalcStyle for display:inline to display:none transition has complexity N^2 where N is the number of child Text nodes.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu May 26 14:05:28 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=61557
Summary: [REGRESSION] recalcStyle for display:inline to
display:none transition has complexity N^2 where N is
the number of child Text nodes.
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Layout and Rendering
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: loislo at chromium.org
CC: eric at webkit.org, hyatt at apple.com, mitz at webkit.org
Blocks: 60959
Created an attachment (id=95037)
--> (https://bugs.webkit.org/attachment.cgi?id=95037&action=review)
test. It adds 50 new text nodes and dumps time/(count^2) at each iteration
The regression was introduced at http://trac.webkit.org/changeset/84166
When I change display:inline to display:none then
1) Node::detach() will be called for each child node;
2) repaint will be called for each child node's renderer for invalidating the affected area;
3) RenderText::clippedOverflowRectForRepaint was changed in the patch. As result parent RenderInline renderer object will be returned instead of RenderBlock in the old code
4) RenderInline::culledInlineVisualOverflowBoundingBox of the parent node's renderer will be called for each child node
but it has a cycle over all the child node's renderers
RenderInline::culledInlineBoundingBox has the same cycle too.
1> webkit.dll!WebCore::RenderInline::culledInlineBoundingBox(const WebCore::RenderInline * container=0x0d9ed9bc) Line 782 C++
2 webkit.dll!WebCore::RenderInline::culledInlineVisualOverflowBoundingBox() Line 890 + 0x10 bytes C++
3 webkit.dll!WebCore::RenderInline::linesVisualOverflowBoundingBox() Line 931 + 0xc bytes C++
4 webkit.dll!WebCore::RenderInline::clippedOverflowRectForRepaint(WebCore::RenderBoxModelObject * repaintContainer=0x00000000) Line 967 C++
5 webkit.dll!WebCore::RenderText::clippedOverflowRectForRepaint(WebCore::RenderBoxModelObject * repaintContainer=0x00000000) Line 1357 + 0x1a bytes C++
6 webkit.dll!WebCore::RenderObject::repaint(bool immediate=false) Line 1208 + 0x32 bytes C++
7 webkit.dll!WebCore::RenderObjectChildList::removeChildNode(WebCore::RenderObject * owner=0x0d9ed9bc, WebCore::RenderObject * oldChild=0x0da64c3c, bool fullRemove=true) Line 80 C++
8 webkit.dll!WebCore::RenderObject::removeChild(WebCore::RenderObject * oldChild=0x0da64c3c) Line 334 C++
9 webkit.dll!WebCore::RenderObject::remove() Line 764 + 0x42 bytes C++
10 webkit.dll!WebCore::RenderObject::destroy() Line 2070 C++
11 webkit.dll!WebCore::RenderText::destroy() Line 201 C++
12 webkit.dll!WebCore::Node::detach() Line 1367 + 0x1d bytes C++
13 webkit.dll!WebCore::ContainerNode::detach() Line 761 + 0x12 bytes C++
14 webkit.dll!WebCore::Element::detach() Line 1026 C++
15 webkit.dll!WebCore::Element::recalcStyle(WebCore::Node::StyleChange change=NoChange) Line 1090 + 0x12 bytes C++
Should I just revert it or add something like
while (container->isRenderInline() && container->parent())
container = container->parent();
into RenderText::clippedOverflowRectForRepaint
Another idea with caching the rect looks much more complex.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list