RESOLVED FIXED 213156
Text manipulation does not observe newly displayed element inside previously observed content
https://bugs.webkit.org/show_bug.cgi?id=213156
Summary Text manipulation does not observe newly displayed element inside previously ...
Sihui Liu
Reported 2020-06-12 16:45:13 PDT
...
Attachments
Patch (12.42 KB, patch)
2020-06-12 16:56 PDT, Sihui Liu
no flags
Patch for landing (12.67 KB, patch)
2020-06-15 10:21 PDT, Sihui Liu
no flags
Sihui Liu
Comment 1 2020-06-12 16:46:41 PDT
Sihui Liu
Comment 2 2020-06-12 16:56:28 PDT
Darin Adler
Comment 3 2020-06-13 14:34:07 PDT
Comment on attachment 401804 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401804&action=review > Source/WebCore/editing/TextManipulationController.cpp:774 > - updateInsertions(lastTopDownPath, topDownPath, nullptr, reusedOriginalNodes, insertions); > + updateInsertions(lastTopDownPath, topDownPath, nullptr, reusedOriginalNodes, insertions, false); This goes against WebKit coding style. We frown on functions with boolean arguments, where call sites pass a constant, since there’s no way to tell what "false" means. We prefer either separately named functions that make the difference clear, or enum classes for boolean values so you can see their meaning at the call site. > Source/WebCore/editing/TextManipulationController.cpp:781 > - insertions.append(NodeInsertion { lastTopDownPath.size() ? lastTopDownPath.last().second.ptr() : nullptr, *node }); > + insertions.append(NodeInsertion { lastTopDownPath.size() ? lastTopDownPath.last().second.ptr() : nullptr, *node, false }); I think the same applies here, even though this is aggregate initialization rather than function calling. The enum class approach helps make these things easier to understand at the call site. The "false" is quite mysterious.
Sihui Liu
Comment 4 2020-06-15 10:12:33 PDT
(In reply to Darin Adler from comment #3) > Comment on attachment 401804 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401804&action=review > > > Source/WebCore/editing/TextManipulationController.cpp:774 > > - updateInsertions(lastTopDownPath, topDownPath, nullptr, reusedOriginalNodes, insertions); > > + updateInsertions(lastTopDownPath, topDownPath, nullptr, reusedOriginalNodes, insertions, false); > > This goes against WebKit coding style. We frown on functions with boolean > arguments, where call sites pass a constant, since there’s no way to tell > what "false" means. We prefer either separately named functions that make > the difference clear, or enum classes for boolean values so you can see > their meaning at the call site. > > > Source/WebCore/editing/TextManipulationController.cpp:781 > > - insertions.append(NodeInsertion { lastTopDownPath.size() ? lastTopDownPath.last().second.ptr() : nullptr, *node }); > > + insertions.append(NodeInsertion { lastTopDownPath.size() ? lastTopDownPath.last().second.ptr() : nullptr, *node, false }); > > I think the same applies here, even though this is aggregate initialization > rather than function calling. The enum class approach helps make these > things easier to understand at the call site. The "false" is quite > mysterious. Thanks for the review. I will use enum class IsNodeManipulated.
Sihui Liu
Comment 5 2020-06-15 10:21:48 PDT
Created attachment 401909 [details] Patch for landing
EWS
Comment 6 2020-06-15 10:51:43 PDT
Committed r263044: <https://trac.webkit.org/changeset/263044> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401909 [details].
Note You need to log in before you can comment on or make changes to this bug.