Changeset 207578 in webkit
- Timestamp:
- Oct 19, 2016 4:49:43 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207575 r207578 1 2016-10-19 Joone Hur <joone.hur@intel.com> 2 3 Add a plain space instead of between text nodes 4 https://bugs.webkit.org/show_bug.cgi?id=123163 5 6 Reviewed by Ryosuke Niwa. 7 8 When we rebalance white spaces, can be added as space 9 under some conditions. This patch adds a condition that the next 10 sibling text node should not exist. 11 12 * accessibility/mac/find-and-replace-match-capitalization-expected.txt: 13 * accessibility/mac/find-and-replace-match-capitalization.html: 14 * accessibility/mac/select-text/select-text-135575-expected.txt: 15 * accessibility/mac/select-text/select-text-7-expected.txt: 16 * accessibility/mac/select-text/select-text-8-expected.txt: 17 * accessibility/mac/select-text/select-text-9-expected.txt: 18 * editing/mac/spelling/autocorrection-blockquote-crash-expected.txt: 19 * editing/pasteboard/paste-text-003-expected.txt: 20 * platform/gtk/editing/execCommand/paste-1-expected.txt: 21 * platform/gtk/editing/pasteboard/paste-2-expected.txt: 22 * platform/gtk/editing/pasteboard/unrendered-br-expected.txt: 23 * platform/mac/editing/execCommand/paste-1-expected.txt: 24 * platform/mac/editing/pasteboard/paste-2-expected.txt: 25 * platform/mac/editing/pasteboard/unrendered-br-expected.txt: 26 1 27 2016-10-19 Sam Weinig <sam@webkit.org> 2 28 -
trunk/LayoutTests/accessibility/mac/find-and-replace-match-capitalization-expected.txt
r187799 r207578 1 The Test testTEST.1 The Test test TEST. 2 2 3 3 This tests that find and replace will match the capitalization of the replaced word. … … 6 6 7 7 8 PASS document.getElementById('text').innerHTML is 'The Test jumped high.'9 PASS document.getElementById('text').innerHTML is 'The Test test high.'10 PASS document.getElementById('text').innerHTML is 'The Test test TEST.'8 PASS document.getElementById('text').innerHTML is 'The Test jumped high.' 9 PASS document.getElementById('text').innerHTML is 'The Test test high.' 10 PASS document.getElementById('text').innerHTML is 'The Test test TEST.' 11 11 PASS successfullyParsed is true 12 12 -
trunk/LayoutTests/accessibility/mac/find-and-replace-match-capitalization.html
r187799 r207578 21 21 // 'Man' is capitalized, so the replaced text should end up capitalized. 22 22 var result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "man", "test"); 23 shouldBe("document.getElementById('text').innerHTML", "'The Test jumped high.'");23 shouldBe("document.getElementById('text').innerHTML", "'The Test jumped high.'"); 24 24 25 25 // 'jumped' is not capitalized so the text should not be capitalized. 26 26 result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "jumped", "Test"); 27 shouldBe("document.getElementById('text').innerHTML", "'The Test test high.'");27 shouldBe("document.getElementById('text').innerHTML", "'The Test test high.'"); 28 28 29 29 // The replacement text was all caps, so don't change based on the existing text. 30 30 result = text.selectTextWithCriteria("AXSelectTextAmbiguityResolutionClosestToSelection", "high", "TEST"); 31 shouldBe("document.getElementById('text').innerHTML", "'The Test test TEST.'");31 shouldBe("document.getElementById('text').innerHTML", "'The Test test TEST.'"); 32 32 33 33 } -
trunk/LayoutTests/accessibility/mac/select-text/select-text-135575-expected.txt
r187799 r207578 1 1 The quick brown fox jumps over the lazy dog. 2 2 3 TEXT2: 3 TEXT2: THE quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. 4 4 5 5 This tests the ability to select and replace text with respect to selection. -
trunk/LayoutTests/accessibility/mac/select-text/select-text-7-expected.txt
r187799 r207578 1 The 1 The slow brown fox jumps over the lazy dog. 2 2 3 3 TEXT2: The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. -
trunk/LayoutTests/accessibility/mac/select-text/select-text-8-expected.txt
r187799 r207578 1 The quick brown 1 The quick brown cat jumps over the lazy dog. 2 2 3 3 TEXT2: The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. -
trunk/LayoutTests/accessibility/mac/select-text/select-text-9-expected.txt
r187799 r207578 1 The quick 1 The quick Brown fox jumps over the lazy dog. 2 2 3 3 TEXT2: The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. -
trunk/LayoutTests/editing/mac/spelling/autocorrection-blockquote-crash-expected.txt
r187932 r207578 9 9 10 10 would this 11 test 11 test notational 12 12 make a difference? 13 13 -
trunk/LayoutTests/editing/pasteboard/paste-text-003-expected.txt
r130411 r207578 107 107 This test copies and pastes "is a tide in the affairs of men,\nWhich taken at the flood leads on to fortune.\nOmitted" twice. 108 108 109 There 109 There is a tide in the affairs of men, 110 110 Which taken at the flood leads on to fortune. 111 111 Omittedis a tide in the affairs of men, … … 114 114 Is bound in shallows and in miseries. 115 115 execCopyCommand: <div id="test" class="editing">There is a tide in the affairs of men, <div class="editing">Which taken at the flood leads on to fortune. <div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div> 116 execPasteCommand: <div id="test" class="editing">There is a tide in the affairs of men,<div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing"><div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div>117 execPasteCommand: <div id="test" class="editing">There is a tide in the affairs of men,<div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing"><div class="editing">Omittedis a tide in the affairs of men,</div><div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div>116 execPasteCommand: <div id="test" class="editing">There is a tide in the affairs of men,<div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing"><div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div> 117 execPasteCommand: <div id="test" class="editing">There is a tide in the affairs of men,<div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing"><div class="editing">Omittedis a tide in the affairs of men,</div><div class="editing">Which taken at the flood leads on to fortune.</div><div class="editing">Omitted, all the voyage of their life, <div class="editing">Is bound in shallows and in miseries. </div> </div> </div> </div> -
trunk/LayoutTests/platform/gtk/editing/execCommand/paste-1-expected.txt
r159017 r207578 11 11 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 12 12 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted 13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 14 15 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 15 16 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/gtk/editing/pasteboard/paste-2-expected.txt
r159017 r207578 11 11 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 12 12 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted 13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 14 15 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 15 16 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/gtk/editing/pasteboard/unrendered-br-expected.txt
r148801 r207578 3 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document toDOMRange:range from 17 of #text > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 17 of #text > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 6 7 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 8 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/mac/editing/execCommand/paste-1-expected.txt
r177774 r207578 11 11 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 12 12 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted 13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 14 15 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 15 16 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/mac/editing/pasteboard/paste-2-expected.txt
r177774 r207578 11 11 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 12 12 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted 13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 14 15 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 15 16 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/mac/editing/pasteboard/unrendered-br-expected.txt
r177774 r207578 3 3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 4 4 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 5 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > BODY > HTML > #document to 6 of #text > DIV > BODY > HTML > #document toDOMRange:range from 17 of #text > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 6 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 17 of #text > DIV > DIV > BODY > HTML > #document to 17 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 6 7 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 7 8 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/Source/WebCore/ChangeLog
r207575 r207578 1 2016-10-19 Joone Hur <joone.hur@intel.com> 2 3 Add a plain space instead of between text nodes 4 https://bugs.webkit.org/show_bug.cgi?id=123163 5 6 Reviewed by Ryosuke Niwa. 7 8 When we rebalance white spaces, can be added as space 9 under some conditions. This patch adds a condition that the next 10 sibling text node should not exist. 11 12 No new tests, updated existing test. 13 14 * editing/CompositeEditCommand.cpp: 15 (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring): 16 * editing/htmlediting.cpp: 17 (WebCore::stringWithRebalancedWhitespace): 18 * editing/htmlediting.h: 19 1 20 2016-10-19 Sam Weinig <sam@webkit.org> 2 21 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r206979 r207578 895 895 VisiblePosition visibleUpstreamPos(Position(textNode, upstream)); 896 896 VisiblePosition visibleDownstreamPos(Position(textNode, downstream)); 897 897 898 Node* nextSibling = textNode->nextSibling(); 898 899 String string = text.substring(upstream, length); 899 900 String rebalancedString = stringWithRebalancedWhitespace(string, 900 901 // FIXME: Because of the problem mentioned at the top of this function, we must also use nbsps at the start/end of the string because 901 902 // this function doesn't get all surrounding whitespace, just the whitespace in the current text node. 902 isStartOfParagraph(visibleUpstreamPos) || upstream == 0, 903 isEndOfParagraph(visibleDownstreamPos) || (unsigned)downstream == text.length()); 903 isStartOfParagraph(visibleUpstreamPos) || !upstream, 904 (isEndOfParagraph(visibleDownstreamPos) || (unsigned)downstream == text.length()) 905 && !(nextSibling && nextSibling->isTextNode() && downcast<Text>(nextSibling)->data().at(0) != ' ')); 904 906 905 907 if (string != rebalancedString) -
trunk/Source/WebCore/editing/htmlediting.cpp
r203324 r207578 398 398 } 399 399 400 String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool endIsEndOfParagraph)400 String stringWithRebalancedWhitespace(const String& string, bool startIsStartOfParagraph, bool shouldEmitNonBreakingSpaceBeforeEnd) 401 401 { 402 402 StringBuilder rebalancedString; … … 411 411 } 412 412 LChar selectedWhitespaceCharacter; 413 if (previousCharacterWasSpace || (!i && startIsStartOfParagraph) || (i == length - 1 && endIsEndOfParagraph)) { 413 // We need to ensure there is no next sibling text node. See https://bugs.webkit.org/show_bug.cgi?id=123163 414 if (previousCharacterWasSpace || (!i && startIsStartOfParagraph) || (i == length - 1 && shouldEmitNonBreakingSpaceBeforeEnd)) { 414 415 selectedWhitespaceCharacter = noBreakSpace; 415 416 previousCharacterWasSpace = false; -
trunk/Source/WebCore/editing/htmlediting.h
r202454 r207578 193 193 bool isAmbiguousBoundaryCharacter(UChar); 194 194 195 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagraph, bool endIsEndOfParagraph);195 String stringWithRebalancedWhitespace(const String&, bool startIsStartOfParagraph, bool shouldEmitNonBreakingSpaceBeforeEnd); 196 196 const String& nonBreakingSpaceString(); 197 197
Note: See TracChangeset
for help on using the changeset viewer.