| Summary: | TextManipulationController should put one Node in only one paragraph | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Sihui Liu <sihui_liu> | ||||||||||
| Component: | HTML Editing | Assignee: | Sihui Liu <sihui_liu> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | ews-watchlist, mifenton, webkit-bug-importer, wenson_hsieh | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Sihui Liu
2020-05-29 14:44:40 PDT
Created attachment 400622 [details]
Patch
Created attachment 400717 [details]
Patch
Created attachment 400742 [details]
Patch
Comment on attachment 400742 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400742&action=review > Source/WebCore/ChangeLog:11 > + When TextManipulationController manipulates the the first paragraph, it removes all the Nodes in its range and Nit - “the the” > Source/WebCore/ChangeLog:13 > + and fails to replace. Also, TextManipulationController does not reserve line breaks in text, which can be an Nit - do you mean “does not preserve”? > Source/WebCore/editing/TextManipulationController.cpp:208 > + while (!m_iterator.atEnd() && m_iteratorNode == m_node) { I think you can factor out this (!m_iterator.atEnd() && m_iteratorNode == m_node) check into a private helper method (maybe something like shouldAdvanceIteratorPastCurrentNode), and then use it both here and in the advance() function by early returning !shouldAdvanceIteratorPastCurrentNode(). > Source/WebCore/editing/TextManipulationController.h:158 > + bool containsOnlyHTMLSpace; > + bool containsLineBreak; > + bool firstTokenContainsLineBreak; > + bool lastTokenContainsLineBreak; Nit - probably a good idea to give these an initial value. Created attachment 400767 [details]
Patch for landing
Committed r262398: <https://trac.webkit.org/changeset/262398> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400767 [details]. |