Bug 215634 - Rename replaceAllChildren to replaceAllChildrenWithNewText
Summary: Rename replaceAllChildren to replaceAllChildrenWithNewText
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on: 215600
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-18 17:32 PDT by Ryosuke Niwa
Modified: 2020-08-18 18:29 PDT (History)
8 users (show)

See Also:


Attachments
Renamed the function (5.09 KB, patch)
2020-08-18 17:36 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Updated per Darin's comment (5.04 KB, patch)
2020-08-18 18:08 PDT, Ryosuke Niwa
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2020-08-18 17:32:27 PDT
Rename replaceAllChildren to replaceAllChildrenWithNewText
Comment 1 Ryosuke Niwa 2020-08-18 17:36:51 PDT
Created attachment 406825 [details]
Renamed the function
Comment 2 Darin Adler 2020-08-18 17:38:04 PDT
Comment on attachment 406825 [details]
Renamed the function

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

> Source/WebCore/dom/ContainerNode.h:62
> +    void replaceAllChildrenWithNewText(Ref<Text>&&);

Why not just take a String instead of requiring the caller make the text node?
Comment 3 Ryosuke Niwa 2020-08-18 17:38:31 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 406825 [details]
> Renamed the function
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=406825&action=review
> 
> > Source/WebCore/dom/ContainerNode.h:62
> > +    void replaceAllChildrenWithNewText(Ref<Text>&&);
> 
> Why not just take a String instead of requiring the caller make the text
> node?

That's a good point. Let's just do that.
Comment 4 Darin Adler 2020-08-18 17:38:49 PDT
Comment on attachment 406825 [details]
Renamed the function

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

> Source/WebCore/dom/ContainerNode.cpp:635
>      // This function assumes the input node is not a DocumentFragment and is parentless to decrease complexity.

I realized that there is one call site that *wishes* it could use this for DocumentFragment.
Comment 5 Ryosuke Niwa 2020-08-18 17:41:34 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 406825 [details]
> Renamed the function
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=406825&action=review
> 
> > Source/WebCore/dom/ContainerNode.cpp:635
> >      // This function assumes the input node is not a DocumentFragment and is parentless to decrease complexity.
> 
> I realized that there is one call site that *wishes* it could use this for
> DocumentFragment.

Yeah but now that I think about it more, that just needs a separate function.
Comment 6 Ryosuke Niwa 2020-08-18 18:08:49 PDT
Created attachment 406827 [details]
Updated per Darin's comment
Comment 7 Ryosuke Niwa 2020-08-18 18:28:58 PDT
Committed r265844: <https://trac.webkit.org/changeset/265844>
Comment 8 Radar WebKit Bug Importer 2020-08-18 18:29:13 PDT
<rdar://problem/67367468>