Changeset 112444 in webkit
- Timestamp:
- Mar 28, 2012 2:41:34 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 14 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112441 r112444 1 2012-03-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Deleting a paragraph of text should not add elements for typing style 4 https://bugs.webkit.org/show_bug.cgi?id=82401 5 6 Reviewed by Enrica Casucci. 7 8 Rebaselined the tests per behavior changes. Also renamed 19653-3.html to deleting-text-rests-typing-style.html 9 which tests this behavioral change. 10 11 * editing/deleting/delete-and-cleanup-expected.txt: 12 * editing/deleting/delete-and-cleanup.html: Elements added for typing styles have been removed. 13 * editing/deleting/delete-br-012-expected.txt: Ditto. 14 * editing/deleting/delete-select-all-001-expected.txt: Ditto. 15 * editing/execCommand/19653-3-expected.txt: Removed. 16 * editing/execCommand/19653-3.html: Removed. 17 * editing/execCommand/apply-style-text-decoration-crash-expected.txt: 18 * editing/execCommand/delete-image-in-anchor-expected.txt: Ditto. 19 * editing/execCommand/deleting-text-rests-typing-style-expected.txt: Copied from LayoutTests/editing/execCommand/19653-3-expected.txt. 20 * editing/execCommand/deleting-text-rests-typing-style.html: Copied from LayoutTests/editing/execCommand/19653-3.html. 21 * editing/inserting/5994480-2-expected.txt: 22 * editing/inserting/5994480-2.html: Ditto; converted this test to a dump-as-markup test for clarity. 23 * editing/pasteboard/paste-text-with-style-2-expected.txt: Elements added for typing styles have been removed. 24 * editing/style/block-style-005-expected.txt: Ditto. 25 * editing/pasteboard/select-element-1-expected.txt: Editing delegate dump changed but the final result remains intact. 26 1 27 2012-03-28 Ojan Vafai <ojan@chromium.org> 2 28 -
trunk/LayoutTests/editing/deleting/delete-and-cleanup-expected.txt
r101629 r112444 5 5 PASS confirmedMarkup is '<div id="mydiv"><br></div>' 6 6 PASS confirmedMarkup is '<br>' 7 PASS confirmedMarkup is '<b>< i><br></i></b>'8 PASS confirmedMarkup is '<b><div style="border: solid red">< i><br></i></div></b>'7 PASS confirmedMarkup is '<b><br></b>' 8 PASS confirmedMarkup is '<b><div style="border: solid red"><br></div></b>' 9 9 PASS confirmedMarkup is '<br>' 10 10 PASS confirmedMarkup is '<br>' -
trunk/LayoutTests/editing/deleting/delete-and-cleanup.html
r101622 r112444 38 38 testDelete("div", "<div id=\"mydiv\">Hello</div>", "<div id=\"mydiv\"><br></div>"); 39 39 testDelete("div", "<div><div>Hello</div></div>", "<br>"); 40 testDelete("div", "<div><b><div><i>Hello</i></div></b></div>", "<b>< i><br></i></b>");41 testDelete("div", "<div><b><div style=\"border: solid red\"><i>Hello</i></div></b></div>", "<b><div style=\"border: solid red\">< i><br></i></div></b>");40 testDelete("div", "<div><b><div><i>Hello</i></div></b></div>", "<b><br></b>"); 41 testDelete("div", "<div><b><div style=\"border: solid red\"><i>Hello</i></div></b></div>", "<b><div style=\"border: solid red\"><br></div></b>"); 42 42 testDelete("div", "<div>Hello</div><div>world</div>", "<br>"); 43 43 testDelete("div", "<div>Hello</div><div>world</div>", "<br>"); -
trunk/LayoutTests/editing/deleting/delete-br-012-expected.txt
r93001 r112444 16 16 | id="test" 17 17 | style="border-style:solid; border-color:blue;" 18 | <font> 19 | size="5" 20 | <#selection-caret> 21 | <br> 18 | <#selection-caret> 19 | <br> 22 20 | " 23 21 " -
trunk/LayoutTests/editing/deleting/delete-select-all-001-expected.txt
r93001 r112444 1 1 2 execDeleteCommand: < font size="3"><br></font>2 execDeleteCommand: <br> -
trunk/LayoutTests/editing/execCommand/apply-style-text-decoration-crash-expected.txt
r67967 r112444 2 2 3 3 4 -
trunk/LayoutTests/editing/execCommand/delete-image-in-anchor-expected.txt
r93001 r112444 2 2 3 3 BEFORE: <a href="../resources/abe.png"><img style="display:block; margin:0px auto 10px; text-align:center;width: 60px; height: 60px;" src="../resources/abe.png" border="0"></a> <br> 4 AFTER: < div style="text-align: center;"><font color="#0000ee"><u><br></u></font></div> <br>4 AFTER: <a href="../resources/abe.png"><br></a> <br> -
trunk/LayoutTests/editing/execCommand/deleting-text-rests-typing-style-expected.txt
r112320 r112444 1 This tests deleting a Bold paragraph, then changing the selection and moving it back to the spot where that paragraph was deleted and typing more. The new text should be Bold, too. 2 <div id="one"><b>Bold</b></div><div id="two"><br></div> 1 This tests deleting a bold paragraph, then changing the selection and moving it back to the spot 2 where that paragraph was deleted and typing more. The new test should not be bolded. 3 | <div> 4 | id="one" 5 | "Not bold<#selection-caret>" 6 | <div> 7 | id="two" 8 | <br> -
trunk/LayoutTests/editing/execCommand/deleting-text-rests-typing-style.html
r112320 r112444 1 <div id="description1">This tests deleting a Bold paragraph, then changing the selection and moving it back to the spot where that paragraph was deleted and typing more. The new text should be Bold, too.</div> 1 <div id="description">This tests deleting a bold paragraph, then changing the selection and moving it back to the spot 2 where that paragraph was deleted and typing more. The new test should not be bolded.</div> 2 3 <div id="edit1" contentEditable="true"><div id="one"><b>Bold</b><br></div><div id="two"><br></div></div> 4 <script src="../../resources/dump-as-markup.js"></script> 5 <script> 6 Markup.description(document.getElementById('description').textContent); 3 7 4 <script>5 if (window.layoutTestController)6 window.layoutTestController.dumpAsText();7 8 one = document.getElementById("one"); 8 9 window.getSelection().setBaseAndExtent(one, 0, one, one.childNodes.length); … … 12 13 window.getSelection().modify("move", "backward", "character"); 13 14 14 document.execCommand("InsertText", false, " Bold");15 document.execCommand("InsertText", false, "Not bold"); 15 16 16 if (window.layoutTestController) 17 document.body.innerText = document.getElementById("description1").innerText + "\n" + edit1.innerHTML; 17 Markup.dump(document.getElementById('edit1')); 18 18 </script> -
trunk/LayoutTests/editing/inserting/5994480-2-expected.txt
r109397 r112444 1 <font face="Lucida Grande"><span style="font-size: 11px;"><br></span></font> 1 This tests to see if deleting an input element that starts at the start of a block adds an extra placeholder. 2 You should see a single placeholder in the block below. 3 | <br> -
trunk/LayoutTests/editing/inserting/5994480-2.html
r34799 r112444 1 <div id="description">This tests to see if deleting an input element that starts at the start of a block adds an extra placeholder. You should see a single placeholder in the block below.</div> 1 <div id="description">This tests to see if deleting an input element that starts at the start of a block adds an extra placeholder. 2 You should see a single placeholder in the block below.</div> 2 3 <div id="edit" contentEditable="true"><input type="text"><br></div> 4 <script src="../../resources/dump-as-markup.js"></script> 3 5 <script> 4 if (window.layoutTestController) 5 window.layoutTestController.dumpAsText(); 6 Markup.description(document.getElementById('description').textContent); 7 6 8 edit = document.getElementById("edit"); 7 9 edit.focus(); … … 9 11 document.execCommand("SelectAll"); 10 12 document.execCommand("Delete"); 11 if (window.layoutTestController) 12 document.body.innerText = edit.innerHTML;13 14 Markup.dump('edit'); 13 15 </script> -
trunk/LayoutTests/editing/pasteboard/paste-text-with-style-2-expected.txt
r93001 r112444 17 17 | color="red" 18 18 | "hello world<#selection-caret>" 19 | <font> 20 | color="#ff0000" 21 | <b> 22 | <i> 23 | <u> 24 | <br> 19 | <br> -
trunk/LayoutTests/editing/pasteboard/select-element-1-expected.txt
r96264 r112444 6 6 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 7 EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document 8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of SPAN > FONT > DIV > BODY > HTML > #document to 1 of SPAN > FONT >DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 9 9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 10 10 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/editing/style/block-style-005-expected.txt
r93001 r112444 7 7 execTypeCharacterCommand: <div id="test" class="editing">x</div><div id="test" class="editing"><br></div><div id="test" class="editing">x</div> 8 8 execFontSizeCommand: <div id="test" class="editing"><font size="7">x</font></div><div id="test" class="editing"><font size="7"><br></font></div><div id="test" class="editing"><font size="7">x</font></div> 9 execDeleteCommand: <div id="test" class="editing"><font size="7">x</font></div><div id="test" class="editing"><font size="7"><br></font></div><div id="test" class="editing">< font size="7"><br></font></div>9 execDeleteCommand: <div id="test" class="editing"><font size="7">x</font></div><div id="test" class="editing"><font size="7"><br></font></div><div id="test" class="editing"><br></div> -
trunk/Source/WebCore/ChangeLog
r112439 r112444 1 2012-03-27 Ryosuke Niwa <rniwa@webkit.org> 2 3 Deleting a paragraph of text should not add elements for typing style 4 https://bugs.webkit.org/show_bug.cgi?id=82401 5 6 Reviewed by Enrica Casucci. 7 8 This behavior was explicitly supported by DeleteSelectionCommand but it doesn't match TextEdit or Firefox. 9 We're changing our behavior to match TextEdit and Firefox in this patch. 10 11 The behavior is tested by an existing test, which was renamed to deleting-text-rests-typing-style.html in this patch. 12 13 Test: editing/execCommand/deleting-text-rests-typing-style.html 14 15 * editing/DeleteSelectionCommand.cpp: 16 (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): 17 1 18 2012-03-28 Michal Mocny <mmocny@google.com> 2 19 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r109818 r112444 689 689 if (m_typingStyle->isEmpty()) 690 690 m_typingStyle = 0; 691 VisiblePosition visibleEnd(m_endingPosition);692 if (m_typingStyle &&693 isStartOfParagraph(visibleEnd) &&694 isEndOfParagraph(visibleEnd) &&695 lineBreakExistsAtVisiblePosition(visibleEnd)) {696 // Apply style to the placeholder that is now holding open the empty paragraph.697 // This makes sure that the paragraph has the right height, and that the paragraph698 // takes on the right style and retains it even if you move the selection away and699 // then move it back (which will clear typing style).700 701 setEndingSelection(visibleEnd);702 applyStyle(m_typingStyle.get(), EditActionUnspecified);703 // applyStyle can destroy the placeholder that was at m_endingPosition if it needs to704 // move it, but it will set an endingSelection() at [movedPlaceholder, 0] if it does so.705 m_endingPosition = endingSelection().start();706 m_typingStyle = 0;707 }708 691 // This is where we've deleted all traces of a style but not a whole paragraph (that's handled above). 709 692 // In this case if we start typing, the new characters should have the same style as the just deleted ones,
Note: See TracChangeset
for help on using the changeset viewer.