Bug 79319 - Cleanup RenderBlock::moveChildrenTo
Summary: Cleanup RenderBlock::moveChildrenTo
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Julien Chaffraix
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 19:58 PST by Julien Chaffraix
Modified: 2012-02-23 11:11 PST (History)
5 users (show)

See Also:


Attachments
Simple cleanup, removed unneeded inline check, while -> for and use moveChildTo. (2.47 KB, patch)
2012-02-22 20:03 PST, Julien Chaffraix
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Chaffraix 2012-02-22 19:58:55 PST
Seen during a review, the function is pretty difficult to read but also has some redundant code hidden in it.

Patch forthcoming.
Comment 1 Julien Chaffraix 2012-02-22 20:03:44 PST
Created attachment 128376 [details]
Simple cleanup, removed unneeded inline check, while -> for and use moveChildTo.
Comment 2 Abhishek Arya 2012-02-22 22:32:50 PST
(In reply to comment #1)
> Created an attachment (id=128376) [details]
> Simple cleanup, removed unneeded inline check, while -> for and use moveChildTo.

Yay! now i can just fix stuff in central RenderBlock::moveChildTo
Comment 3 Eric Seidel (no email) 2012-02-22 22:38:32 PST
Comment on attachment 128376 [details]
Simple cleanup, removed unneeded inline check, while -> for and use moveChildTo.

View in context: https://bugs.webkit.org/attachment.cgi?id=128376&action=review

I wonder if this will have a performance effect.

> Source/WebCore/rendering/RenderBlock.cpp:992
> +    for (RenderObject* child = startChild; child && child != endChild; ) {
> +        // Save our next sibling as moveChildTo will clear it.
> +        RenderObject* nextSibling = child->nextSibling();
> +        moveChildTo(toBlock, child, beforeChild, fullRemoveInsert);
> +        child = nextSibling;
>      }

Just to make sure... there are no mutation events (or other JavaScript) run by moveChildTo such that we would need to hold a RefPtr for child?
Comment 4 Abhishek Arya 2012-02-22 22:42:49 PST
(In reply to comment #3)
> (From update of attachment 128376 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=128376&action=review
> 
> I wonder if this will have a performance effect.
> 
> > Source/WebCore/rendering/RenderBlock.cpp:992
> > +    for (RenderObject* child = startChild; child && child != endChild; ) {
> > +        // Save our next sibling as moveChildTo will clear it.
> > +        RenderObject* nextSibling = child->nextSibling();
> > +        moveChildTo(toBlock, child, beforeChild, fullRemoveInsert);
> > +        child = nextSibling;
> >      }
> 
> Just to make sure... there are no mutation events (or other JavaScript) run by moveChildTo such that we would need to hold a RefPtr for child?

No Refptrs in the rendering world :(
Comment 5 Julien Chaffraix 2012-02-23 09:22:49 PST
Comment on attachment 128376 [details]
Simple cleanup, removed unneeded inline check, while -> for and use moveChildTo.

View in context: https://bugs.webkit.org/attachment.cgi?id=128376&action=review

> I wonder if this will have a performance effect.

I was wondering that too. Some archaeology did not show the split was done for performance so we should be fine. In case, we can always inline moveChildTo.

>>> Source/WebCore/rendering/RenderBlock.cpp:992
>>>      }
>> 
>> Just to make sure... there are no mutation events (or other JavaScript) run by moveChildTo such that we would need to hold a RefPtr for child?
> 
> No Refptrs in the rendering world :(

Indeed, but more importantly, the operations are atomic from a JS perspective.
Comment 6 WebKit Review Bot 2012-02-23 11:11:43 PST
Comment on attachment 128376 [details]
Simple cleanup, removed unneeded inline check, while -> for and use moveChildTo.

Clearing flags on attachment: 128376

Committed r108645: <http://trac.webkit.org/changeset/108645>
Comment 7 WebKit Review Bot 2012-02-23 11:11:48 PST
All reviewed patches have been landed.  Closing bug.