Changeset 249307 in webkit
- Timestamp:
- Aug 29, 2019 6:40:58 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249305 r249307 1 2019-08-29 Timothy Hatcher <timothy@apple.com> 2 3 Copying and pasting two paragraphs with a newline between them results in stray paragraph with newline inside. 4 https://bugs.webkit.org/show_bug.cgi?id=201306 5 6 Reviewed by Wenson Hsieh. 7 8 * editing/pasteboard/paste-without-nesting-expected.txt: Updated results. 9 * editing/pasteboard/paste-without-nesting.html: Added new test case. 10 1 11 2019-08-29 Devin Rousso <drousso@apple.com> 2 12 -
trunk/LayoutTests/editing/pasteboard/paste-without-nesting-expected.txt
r101629 r249307 7 7 PASS confirmedMarkup is '<div><b><i>Hello</i></b></div><div><b><i>world</i></b></div>' 8 8 PASS confirmedMarkup is '<div style="text-align: center;"><div><font color="#ff0000"><b><i>hello</i></b></font></div><div><font color="#ff0000"><b><i>world</i></b></font></div></div>' 9 PASS confirmedMarkup is '<p>Line One</p><p>Line Two</p>' 9 10 PASS successfullyParsed is true 10 11 -
trunk/LayoutTests/editing/pasteboard/paste-without-nesting.html
r155276 r249307 41 41 testCopyPaste("div", "<div><b><i>Hello</i></b></div><div><b><i>world</i></b></div>", "<div><b><i>Hello</i></b></div><div><b><i>world</i></b></div>"); 42 42 testCopyPaste("div", "<div style=\"text-align: center;\"><div><font color=\"#ff0000\"><b><i>hello</i></b></font></div><div><font color=\"#ff0000\"><b><i>world</i></b></font></div></div>", "<div style=\"text-align: center;\"><div><font color=\"#ff0000\"><b><i>hello</i></b></font></div><div><font color=\"#ff0000\"><b><i>world</i></b></font></div></div>"); 43 testCopyPaste("div", "<p>Line One</p> <p>Line Two</p>", "<p>Line One</p><p>Line Two</p>"); 43 44 44 45 root.style.display = "none"; -
trunk/Source/WebCore/ChangeLog
r249305 r249307 1 2019-08-29 Timothy Hatcher <timothy@apple.com> 2 3 Copying and pasting two paragraphs with a newline between them results in stray paragraph with newline inside. 4 https://bugs.webkit.org/show_bug.cgi?id=201306 5 6 Reviewed by Wenson Hsieh. 7 8 Test: editing/pasteboard/paste-without-nesting.html 9 10 * editing/ReplaceSelectionCommand.cpp: 11 (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): Consider the ancestor node safe to remove 12 if there is no rendered text inside, not just if there are any child nodes. 13 1 14 2019-08-29 Devin Rousso <drousso@apple.com> 2 15 -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r248846 r249307 705 705 } 706 706 707 static inline bool hasRenderedText(const Text& text) 708 { 709 return text.renderer() && text.renderer()->hasRenderedText(); 710 } 711 707 712 void ReplaceSelectionCommand::moveNodeOutOfAncestor(Node& node, Node& ancestor, InsertedNodes& insertedNodes) 708 713 { … … 723 728 insertNodeBefore(WTFMove(protectedNode), *nodeToSplitTo); 724 729 } 725 if (!ancestor.firstChild()) { 730 731 document().updateLayoutIgnorePendingStylesheets(); 732 733 bool safeToRemoveAncestor = true; 734 for (auto* child = ancestor.firstChild(); child; child = child->nextSibling()) { 735 if (is<Text>(child) && hasRenderedText(downcast<Text>(*child))) { 736 safeToRemoveAncestor = false; 737 break; 738 } 739 740 if (is<Element>(child)) { 741 safeToRemoveAncestor = false; 742 break; 743 } 744 } 745 746 if (safeToRemoveAncestor) { 726 747 insertedNodes.willRemoveNode(&ancestor); 727 748 removeNode(ancestor); 728 749 } 729 }730 731 static inline bool hasRenderedText(const Text& text)732 {733 return text.renderer() && text.renderer()->hasRenderedText();734 750 } 735 751
Note: See TracChangeset
for help on using the changeset viewer.