RESOLVED FIXED Bug 55720
Refactor createRendererIfNeeded to avoid premature nextRenderer calculation
https://bugs.webkit.org/show_bug.cgi?id=55720
Summary Refactor createRendererIfNeeded to avoid premature nextRenderer calculation
Eric Seidel (no email)
Reported 2011-03-03 15:28:59 PST
Refactor createRendererIfNeeded to avoid premature nextRenderer calculation
Attachments
Patch (8.06 KB, patch)
2011-03-03 15:58 PST, Eric Seidel (no email)
no flags
Fix ChangeLog typo (8.06 KB, patch)
2011-03-03 16:01 PST, Eric Seidel (no email)
no flags
Eric Seidel (no email)
Comment 1 2011-03-03 15:58:13 PST
Eric Seidel (no email)
Comment 2 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)
Eric Seidel (no email)
Comment 3 2011-03-03 16:01:27 PST
Created attachment 84644 [details] Fix ChangeLog typo
Dimitri Glazkov (Google)
Comment 4 2011-03-03 16:12:43 PST
Comment on attachment 84644 [details] Fix ChangeLog typo great!
Darin Adler
Comment 5 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.
Eric Seidel (no email)
Comment 6 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.
Darin Adler
Comment 7 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.
WebKit Commit Bot
Comment 8 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>
WebKit Commit Bot
Comment 9 2011-03-03 23:04:17 PST
All reviewed patches have been landed. Closing bug.
Eric Seidel (no email)
Comment 10 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.
Note You need to log in before you can comment on or make changes to this bug.