RESOLVED FIXED 24110
cloneNode should call cloneElement and not the reverse
https://bugs.webkit.org/show_bug.cgi?id=24110
Summary cloneNode should call cloneElement and not the reverse
Julien Chaffraix
Reported 2009-02-23 17:26:34 PST
Suggested as part of the review of bug23956 as it would remove a static_cast.
Attachments
Trivial change: move cloneNode into cloneElement, updated cloneElement signature and call sites (8.66 KB, patch)
2009-02-24 01:54 PST, Julien Chaffraix
darin: review-
Version updated that should address all Darin's comments (12.38 KB, patch)
2009-03-06 03:14 PST, Julien Chaffraix
darin: review+
Julien Chaffraix
Comment 1 2009-02-24 01:54:18 PST
Created attachment 27908 [details] Trivial change: move cloneNode into cloneElement, updated cloneElement signature and call sites
Darin Adler
Comment 2 2009-02-24 09:06:31 PST
Comment on attachment 27908 [details] Trivial change: move cloneNode into cloneElement, updated cloneElement signature and call sites Thanks for doing this! I know I suggested it. I do not like boolean arguments. I think they make call sites hard to read and understand. I think we should leave the cloneChildNodes logic inside the cloneNode function, and then we would not need to add a boolean argument to cloneElement. I also think that all the "shallow clone" comments at cloneElement call sites make it clear that it should be renamed to shallowCloneElement or cloneElementWithoutChildren, so we can remove those comments. I think we should make the cloneNode virtual function override private, because if someone has an Element* it's a waste to have them make a virtual function call just to clone. Then, if we find callers that need a shallow clone, they can call the current cloneElement (perhaps under its new clearer name) and if we find callers that also want to clone the children, then I suggest we make a new non-virtual cloneElement call that does clone children.
Julien Chaffraix
Comment 3 2009-03-06 03:14:39 PST
Created attachment 28355 [details] Version updated that should address all Darin's comments
Darin Adler
Comment 4 2009-03-06 07:11:37 PST
Comment on attachment 28355 [details] Version updated that should address all Darin's comments r=me
Julien Chaffraix
Comment 5 2009-03-12 05:43:11 PDT
Landed in r41621.
Note You need to log in before you can comment on or make changes to this bug.