Bug 55720 - Refactor createRendererIfNeeded to avoid premature nextRenderer calculation
Summary: Refactor createRendererIfNeeded to avoid premature nextRenderer calculation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Eric Seidel (no email)
URL:
Keywords:
Depends on:
Blocks: 55626
  Show dependency treegraph
 
Reported: 2011-03-03 15:28 PST by Eric Seidel (no email)
Modified: 2011-03-04 00:33 PST (History)
10 users (show)

See Also:


Attachments
Patch (8.06 KB, patch)
2011-03-03 15:58 PST, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff
Fix ChangeLog typo (8.06 KB, patch)
2011-03-03 16:01 PST, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2011-03-03 15:28:59 PST
Refactor createRendererIfNeeded to avoid premature nextRenderer calculation
Comment 1 Eric Seidel (no email) 2011-03-03 15:58:13 PST
Created attachment 84643 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-03-03 15:58:51 PST
(the CC list is care of webkit-patch --suggest-reviewers, feel free to remove yourself if this change to Node.cpp does not interest you)
Comment 3 Eric Seidel (no email) 2011-03-03 16:01:27 PST
Created attachment 84644 [details]
Fix ChangeLog typo
Comment 4 Dimitri Glazkov (Google) 2011-03-03 16:12:43 PST
Comment on attachment 84644 [details]
Fix ChangeLog typo

great!
Comment 5 Darin Adler 2011-03-03 16:55:54 PST
Comment on attachment 84644 [details]
Fix ChangeLog typo

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

> Source/WebCore/dom/Node.cpp:1394
> +    newRenderer->setAnimatableStyle(style.release()); // setAnimatableStyle() can depend on renderer() already being set.

I don’t understand this comment.
Comment 6 Eric Seidel (no email) 2011-03-03 17:32:29 PST
(In reply to comment #5)
> (From update of attachment 84644 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=84644&action=review
> 
> > Source/WebCore/dom/Node.cpp:1394
> > +    newRenderer->setAnimatableStyle(style.release()); // setAnimatableStyle() can depend on renderer() already being set.
> 
> I don’t understand this comment.

I can dig up the callstack if you like.  But deep inside setAnimatable style it calls back through RenderLayer which grabs renderer() w/o checking for null.  So it's required to call setRenderer before setting the animatable style on the renderer it seems.
Comment 7 Darin Adler 2011-03-03 18:05:36 PST
(In reply to comment #6)
> (In reply to comment #5)
> > > Source/WebCore/dom/Node.cpp:1394
> > > +    newRenderer->setAnimatableStyle(style.release()); // setAnimatableStyle() can depend on renderer() already being set.
> > 
> > I don’t understand this comment.
> 
> I can dig up the callstack if you like. But deep inside setAnimatable style it calls back through RenderLayer which grabs renderer() w/o checking for null. So it's required to call setRenderer before setting the animatable style on the renderer it seems.

OK, but I am not sure this comment is helpful.

The code was setting the renderer and then setting the animatable style, and you added a comment that basically says “this has to be in this order”, but I don’t think that adds value.

Also the wording “can depend” gives me a feeling of fear, and since the comment doesn’t say why there is a dependency, I’m not sure it adds anything beyond what the test coverage already provides.
Comment 8 WebKit Commit Bot 2011-03-03 23:04:11 PST
Comment on attachment 84644 [details]
Fix ChangeLog typo

Clearing flags on attachment: 84644

Committed r80330: <http://trac.webkit.org/changeset/80330>
Comment 9 WebKit Commit Bot 2011-03-03 23:04:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Eric Seidel (no email) 2011-03-04 00:33:17 PST
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > > Source/WebCore/dom/Node.cpp:1394
> > > > +    newRenderer->setAnimatableStyle(style.release()); // setAnimatableStyle() can depend on renderer() already being set.
> > > 
> > > I don’t understand this comment.
> > 
> > I can dig up the callstack if you like. But deep inside setAnimatable style it calls back through RenderLayer which grabs renderer() w/o checking for null. So it's required to call setRenderer before setting the animatable style on the renderer it seems.
> 
> OK, but I am not sure this comment is helpful.
> 
> The code was setting the renderer and then setting the animatable style, and you added a comment that basically says “this has to be in this order”, but I don’t think that adds value.
> 
> Also the wording “can depend” gives me a feeling of fear, and since the comment doesn’t say why there is a dependency, I’m not sure it adds anything beyond what the test coverage already provides.

I'll remove it in a follow-up.