Changeset 241719 in webkit


Ignore:
Timestamp:
Feb 18, 2019 8:53:32 AM (5 years ago)
Author:
Megan Gardner
Message:

Turn On Smart Delete
https://bugs.webkit.org/show_bug.cgi?id=194320

Reviewed by Ryosuke Niwa.

Source/WebCore:

Updated the following tests to work with iOS:

  • editing/deleting/smart-delete-001.html:
  • editing/deleting/smart-delete-002.html:
  • editing/deleting/smart-delete-003.html:
  • editing/deleting/smart-delete-004.html:
  • editing/deleting/smart-delete-across-editable-boundaries-2.html:
  • editing/selection/delete-word-granularity-text-control.html:

Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other
platforms to turn on smart delete when desired.

  • editing/Editor.cpp:

(WebCore::Editor::shouldSmartDelete):
Allow platfroms to determine if smart delete should be on.
On mac, this is via word granularity, on iOS this is just on all the time.
(WebCore::Editor::canSmartCopyOrDelete):
(WebCore::Editor::performCutOrCopy):

  • editing/Editor.h:
  • editing/EditorCommand.cpp:

(WebCore::executeDelete):

  • editing/ios/EditorIOS.mm:

(WebCore::Editor::shouldSmartDelete):

  • editing/mac/EditorMac.mm:

(WebCore::Editor::shouldSmartDelete):

LayoutTests:

Update smart-delete-* tests, and rebase many other tests to work with the new smart delete setting.

  • editing/deleting/smart-delete-001-expected.txt: Added.
  • editing/deleting/smart-delete-001.html:
  • editing/deleting/smart-delete-002-expected.txt:
  • editing/deleting/smart-delete-002.html:
  • editing/deleting/smart-delete-003-expected.txt: Copied from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
  • editing/deleting/smart-delete-003.html:
  • editing/deleting/smart-delete-004-expected.txt: Renamed from LayoutTests/platform/mac/editing/deleting/smart-delete-004-expected.txt.
  • editing/deleting/smart-delete-004.html:
  • editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt:
  • editing/deleting/smart-delete-across-editable-boundaries-2.html:
  • editing/selection/delete-word-granularity-text-control.html:
  • platform/ios-wk1/editing/deleting/smart-delete-003-expected.txt: Removed.
  • platform/ios-wk1/editing/deleting/smart-delete-004-expected.txt: Removed.
  • platform/ios-wk2/editing/deleting/smart-delete-003-expected.txt: Removed.
  • platform/ios-wk2/editing/pasteboard/cut-text-001-expected.png: Removed.
  • platform/ios/TestExpectations:
  • platform/ios/editing/deleting/5206311-1-expected.txt:
  • platform/ios/editing/deleting/delete-across-editable-content-boundaries-2-expected.txt: Added.
  • platform/ios/editing/deleting/delete-across-editable-content-boundaries-3-expected.txt: Added.
  • platform/ios/editing/deleting/delete-and-undo-expected.txt:
  • platform/ios/editing/deleting/delete-block-merge-contents-012-expected.txt:
  • platform/ios/editing/deleting/delete-block-merge-contents-017-expected.txt:
  • platform/ios/editing/deleting/delete-contiguous-ws-001-expected.txt:
  • platform/ios/editing/deleting/delete-image-003-expected.txt:
  • platform/ios/editing/deleting/delete-leading-ws-001-expected.txt:
  • platform/ios/editing/deleting/delete-selection-001-expected.txt:
  • platform/ios/editing/deleting/delete-trailing-ws-001-expected.txt:
  • platform/ios/editing/deleting/delete-ws-fixup-002-expected.txt:
  • platform/ios/editing/deleting/delete-ws-fixup-003-expected.txt:
  • platform/ios/editing/deleting/delete-ws-fixup-004-expected.txt:
  • platform/ios/editing/deleting/smart-delete-001-expected.txt:
  • platform/ios/editing/deleting/smart-delete-002-expected.txt: Added.
  • platform/ios/editing/deleting/smart-delete-003-expected.txt: Copied from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
  • platform/ios/editing/deleting/smart-delete-004-expected.txt: Renamed from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
  • platform/ios/editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt: Added.
  • platform/ios/editing/deleting/table-cells-expected.txt:
  • platform/ios/editing/execCommand/delete-line-and-insert-text-in-font-inside-blockquote-expected.txt: Added.
  • platform/ios/editing/pasteboard/cut-text-001-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/cut-text-001-expected.txt.
  • platform/ios/editing/pasteboard/paste-2-expected.txt:
  • platform/mac/editing/deleting/smart-delete-001-expected.png: Removed.
  • platform/mac/editing/deleting/smart-delete-001-expected.txt: Removed.
  • platform/mac/editing/deleting/smart-delete-002-expected.png: Removed.
  • platform/mac/editing/deleting/smart-delete-003-expected.png: Removed.
  • platform/mac/editing/deleting/smart-delete-004-expected.png: Removed.
  • resources/ui-helper.js:

(window.UIHelper.async.doubleActivateAt):
(window.UIHelper.async.doubleActivateAtSelectionStart):
(window.UIHelper.async.selectWordByDoubleTapOrClick):

Location:
trunk
Files:
6 added
11 deleted
35 edited
2 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r241656 r241719  
     12019-02-18  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Turn On Smart Delete
     4        https://bugs.webkit.org/show_bug.cgi?id=194320
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Update smart-delete-* tests, and rebase many other tests to work with the new smart delete setting.
     9
     10        * editing/deleting/smart-delete-001-expected.txt: Added.
     11        * editing/deleting/smart-delete-001.html:
     12        * editing/deleting/smart-delete-002-expected.txt:
     13        * editing/deleting/smart-delete-002.html:
     14        * editing/deleting/smart-delete-003-expected.txt: Copied from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
     15        * editing/deleting/smart-delete-003.html:
     16        * editing/deleting/smart-delete-004-expected.txt: Renamed from LayoutTests/platform/mac/editing/deleting/smart-delete-004-expected.txt.
     17        * editing/deleting/smart-delete-004.html:
     18        * editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt:
     19        * editing/deleting/smart-delete-across-editable-boundaries-2.html:
     20        * editing/selection/delete-word-granularity-text-control.html:
     21        * platform/ios-wk1/editing/deleting/smart-delete-003-expected.txt: Removed.
     22        * platform/ios-wk1/editing/deleting/smart-delete-004-expected.txt: Removed.
     23        * platform/ios-wk2/editing/deleting/smart-delete-003-expected.txt: Removed.
     24        * platform/ios-wk2/editing/pasteboard/cut-text-001-expected.png: Removed.
     25        * platform/ios/TestExpectations:
     26        * platform/ios/editing/deleting/5206311-1-expected.txt:
     27        * platform/ios/editing/deleting/delete-across-editable-content-boundaries-2-expected.txt: Added.
     28        * platform/ios/editing/deleting/delete-across-editable-content-boundaries-3-expected.txt: Added.
     29        * platform/ios/editing/deleting/delete-and-undo-expected.txt:
     30        * platform/ios/editing/deleting/delete-block-merge-contents-012-expected.txt:
     31        * platform/ios/editing/deleting/delete-block-merge-contents-017-expected.txt:
     32        * platform/ios/editing/deleting/delete-contiguous-ws-001-expected.txt:
     33        * platform/ios/editing/deleting/delete-image-003-expected.txt:
     34        * platform/ios/editing/deleting/delete-leading-ws-001-expected.txt:
     35        * platform/ios/editing/deleting/delete-selection-001-expected.txt:
     36        * platform/ios/editing/deleting/delete-trailing-ws-001-expected.txt:
     37        * platform/ios/editing/deleting/delete-ws-fixup-002-expected.txt:
     38        * platform/ios/editing/deleting/delete-ws-fixup-003-expected.txt:
     39        * platform/ios/editing/deleting/delete-ws-fixup-004-expected.txt:
     40        * platform/ios/editing/deleting/smart-delete-001-expected.txt:
     41        * platform/ios/editing/deleting/smart-delete-002-expected.txt: Added.
     42        * platform/ios/editing/deleting/smart-delete-003-expected.txt: Copied from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
     43        * platform/ios/editing/deleting/smart-delete-004-expected.txt: Renamed from LayoutTests/platform/mac/editing/deleting/smart-delete-003-expected.txt.
     44        * platform/ios/editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt: Added.
     45        * platform/ios/editing/deleting/table-cells-expected.txt:
     46        * platform/ios/editing/execCommand/delete-line-and-insert-text-in-font-inside-blockquote-expected.txt: Added.
     47        * platform/ios/editing/pasteboard/cut-text-001-expected.txt: Renamed from LayoutTests/platform/ios-wk2/editing/pasteboard/cut-text-001-expected.txt.
     48        * platform/ios/editing/pasteboard/paste-2-expected.txt:
     49        * platform/mac/editing/deleting/smart-delete-001-expected.png: Removed.
     50        * platform/mac/editing/deleting/smart-delete-001-expected.txt: Removed.
     51        * platform/mac/editing/deleting/smart-delete-002-expected.png: Removed.
     52        * platform/mac/editing/deleting/smart-delete-003-expected.png: Removed.
     53        * platform/mac/editing/deleting/smart-delete-004-expected.png: Removed.
     54        * resources/ui-helper.js:
     55        (window.UIHelper.async.doubleActivateAt):
     56        (window.UIHelper.async.doubleActivateAtSelectionStart):
     57        (window.UIHelper.async.selectWordByDoubleTapOrClick):
     58
    1592019-02-17  Fujii Hironori  <Hironori.Fujii@sony.com>
    260
  • trunk/LayoutTests/editing/deleting/smart-delete-001.html

    r55913 r241719  
     1<!DOCTYPE html>
    12<html>
    23<head>
     
    1718.expected-results:first-line { font-weight: bold }
    1819</style>
    19 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
     20<script src="../editing.js"></script>
     21<script src="../../resources/ui-helper.js"></script>
    2022
    2123<script>
    2224
    23 function editingTest() {
    24     doubleClickAtSelectionStart();
     25async function editingTest() {
     26    await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test'));
    2527    deleteCommand();
    2628}
     
    5456
    5557<script>
    56 runEditingTest();
     58runDumpAsTextEditingTest(true);
    5759</script>
    5860
  • trunk/LayoutTests/editing/deleting/smart-delete-002-expected.txt

    r177774 r241719  
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    12 layer at (0,0) size 800x600
    13   RenderView at (0,0) size 800x600
    14 layer at (0,0) size 800x600
    15   RenderBlock {HTML} at (0,0) size 800x600
    16     RenderBody {BODY} at (8,8) size 784x584
    17       RenderBlock {DIV} at (0,0) size 784x212 [border: (2px solid #0000FF)]
    18         RenderBlock {DIV} at (14,14) size 756x56
    19           RenderText {#text} at (0,0) size 66x28
    20             text run at (0,0) width 66: "Tests: "
    21           RenderBR {BR} at (0,0) size 0x0
    22           RenderText {#text} at (0,28) size 516x28
    23             text run at (0,28) width 516: "Smart delete when deleting the second word of a line."
    24         RenderBlock {DIV} at (14,86) size 756x112
    25           RenderText {#text} at (0,0) size 190x28
    26             text run at (0,0) width 190: "Expected Results: "
    27           RenderBR {BR} at (189,22) size 1x0
    28           RenderText {#text} at (0,28) size 732x56
    29             text run at (0,28) width 732: "The second word and the space before the second word should be deleted. It"
    30             text run at (0,56) width 201: "should like this this: "
    31           RenderBR {BR} at (200,78) size 1x0
    32           RenderText {#text} at (0,84) size 72x28
    33             text run at (0,84) width 72: "foo baz"
    34       RenderBlock {DIV} at (0,236) size 784x32
    35         RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
    36           RenderText {#text} at (2,2) size 72x28
    37             text run at (2,2) width 72: "foo baz"
    38 caret: position 4 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
     12Tests:
     13Smart delete when deleting the second word of a line.
     14Expected Results:
     15The second word and the space before the second word should be deleted. It should like this this:
     16foo baz
     17foo baz
     18execDeleteCommand: <div id="test" class="editing"> foo baz </div>
  • trunk/LayoutTests/editing/deleting/smart-delete-002.html

    r147036 r241719  
     1<!DOCTYPE html>
    12<html>
    23<head>
     
    1718.expected-results:first-line { font-weight: bold }
    1819</style>
    19 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
    20 
     20<script src="../editing.js"></script>
     21<script src="../../resources/ui-helper.js"></script>
    2122<script>
    2223
    23 function editingTest() {
    24     if (window.internals)
    25         internals.settings.setEditingBehavior('mac');
     24async function editingTest() {
    2625    moveSelectionForwardByWordCommand();
    2726    moveSelectionForwardByCharacterCommand();
    28     doubleClickAtSelectionStart();
     27    await UIHelper.doubleActivateAtSelectionStart();
    2928    deleteCommand();
    3029}
     
    5857
    5958<script>
    60 runEditingTest();
     59runDumpAsTextEditingTest(true);
    6160</script>
    6261
  • trunk/LayoutTests/editing/deleting/smart-delete-003-expected.txt

    r241662 r241719  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    45EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    56EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     
    1112EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1213EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    13 layer at (0,0) size 800x600
    14   RenderView at (0,0) size 800x600
    15 layer at (0,0) size 800x600
    16   RenderBlock {HTML} at (0,0) size 800x600
    17     RenderBody {BODY} at (8,8) size 784x584
    18       RenderBlock {P} at (0,0) size 784x36
    19         RenderText {#text} at (0,0) size 779x36
    20           text run at (0,0) width 401: "This tests deleting a selection created with a word granularity. "
    21           text run at (400,0) width 353: "To run it manually, double click on 'bar' and hit delete. "
    22           text run at (752,0) width 27: "You"
    23           text run at (0,18) width 129: "should see 'foo baz'."
    24       RenderBlock {DIV} at (0,52) size 784x18
    25         RenderText {#text} at (0,0) size 22x18
    26           text run at (0,0) width 22: "foo"
    27         RenderText {#text} at (21,0) size 27x18
    28           text run at (21,0) width 27: " baz"
    29 caret: position 3 of child 0 {#text} of child 2 {DIV} of body
     14This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit delete. You should see 'foo baz'.
     15
     16Expected Results:
     17The second word and the space before the second word should be deleted. It should like this this:
     18foo baz
     19foo baz
     20
  • trunk/LayoutTests/editing/deleting/smart-delete-003.html

    r120173 r241719  
    1 <script>
    2 if (window.testRunner)
    3      testRunner.dumpEditingCallbacks();
    4 </script>
    5 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
     1<!DOCTYPE html>
     2<html>
     3<head>
     4
     5<style>
     6.editing {
     7    border: 2px solid red;
     8    font-size: 24px;
     9}
     10.explanation {
     11    border: 2px solid blue;
     12    padding: 12px;
     13    font-size: 24px;
     14    margin-bottom: 24px;
     15}
     16.scenario { margin-bottom: 16px;}
     17.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
     18.expected-results:first-line { font-weight: bold }
     19</style>
     20<script src="../editing.js"></script>
     21<script src="../../resources/ui-helper.js"></script>
     22<div class="scenario">
    623<p>This tests deleting a selection created with a word granularity.  To run it manually, double click on 'bar' and hit delete.  You should see 'foo baz'.</p>
    7 <div id="div" contenteditable="true">foo b<span id="target">a</span>r baz</div>
     24</div>
     25<div class="expected-results">
     26Expected Results:
     27<br>
     28The second word and the space before the second word should be deleted. It should like this this:
     29<BR>
     30foo baz
     31</div>
     32<div id="test" class="editing" contenteditable="true">foo b<span id="target">a</span>r baz</div>
    833
    934<script>
    10 if (window.testRunner) {
     35async function editingTest() {
    1136    var target = document.getElementById("target");
    12     doubleClick(target.offsetLeft, target.offsetTop);
     37    await UIHelper.selectWordByDoubleTapOrClick(target);
    1338    testRunner.execCommand("DeleteBackward");
    1439}
     40
     41runDumpAsTextEditingTest(true);
     42
    1543</script>
  • trunk/LayoutTests/editing/deleting/smart-delete-004-expected.txt

    r241662 r241719  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    45EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    56EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     
    1112EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1213EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    13 layer at (0,0) size 800x600
    14   RenderView at (0,0) size 800x600
    15 layer at (0,0) size 800x600
    16   RenderBlock {HTML} at (0,0) size 800x600
    17     RenderBody {BODY} at (8,8) size 784x584
    18       RenderBlock {P} at (0,0) size 784x36
    19         RenderText {#text} at (0,0) size 758x36
    20           text run at (0,0) width 401: "This tests deleting a selection created with a word granularity. "
    21           text run at (400,0) width 358: "To run it manually, double click on 'bar' and hit forward"
    22           text run at (0,18) width 47: "delete. "
    23           text run at (46,18) width 159: "You should see 'foo baz'."
    24       RenderBlock {DIV} at (0,52) size 784x18
    25         RenderText {#text} at (0,0) size 22x18
    26           text run at (0,0) width 22: "foo"
    27         RenderText {#text} at (21,0) size 27x18
    28           text run at (21,0) width 27: " baz"
    29 caret: position 3 of child 0 {#text} of child 2 {DIV} of body
     14This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit forward delete. You should see 'foo baz'.
     15
     16Expected Results:
     17The second word and the space before the second word should be deleted. It should like this this:
     18foo baz
     19foo baz
     20
  • trunk/LayoutTests/editing/deleting/smart-delete-004.html

    r120173 r241719  
    1 <script>
    2 if (window.testRunner)
    3      testRunner.dumpEditingCallbacks();
    4 </script>
    5 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
     1<!DOCTYPE html>
     2<html>
     3<head>
     4
     5<style>
     6.editing {
     7    border: 2px solid red;
     8    font-size: 24px;
     9}
     10.explanation {
     11    border: 2px solid blue;
     12    padding: 12px;
     13    font-size: 24px;
     14    margin-bottom: 24px;
     15}
     16.scenario { margin-bottom: 16px;}
     17.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
     18.expected-results:first-line { font-weight: bold }
     19</style>
     20<script src="../editing.js" ></script>
     21<script src="../../resources/ui-helper.js"></script>
     22<div class="scenario">
    623<p>This tests deleting a selection created with a word granularity.  To run it manually, double click on 'bar' and hit forward delete.  You should see 'foo baz'.</p>
    7 <div id="div" contenteditable="true">foo b<span id="target">a</span>r baz</div>
     24</div>
     25<div class="expected-results">
     26Expected Results:
     27<br>
     28The second word and the space before the second word should be deleted. It should like this this:
     29<BR>
     30foo baz
     31</div>
     32<div id="test" class="editing" contenteditable="true">foo b<span id="target">a</span>r baz</div>
    833
    934<script>
    10 if (window.testRunner) {
     35async function editingTest() {
    1136    var target = document.getElementById("target");
    12     doubleClick(target.offsetLeft, target.offsetTop + target.offsetHeight / 2);
     37    await UIHelper.selectWordByDoubleTapOrClick(target);
    1338    testRunner.execCommand("DeleteForward");
    1439}
     40
     41runDumpAsTextEditingTest(true);
     42
    1543</script>
  • trunk/LayoutTests/editing/deleting/smart-delete-across-editable-boundaries-2-expected.txt

    r231630 r241719  
     1EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document
     2EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
     3EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     5EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     6EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     7EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     8EDITING DELEGATE: shouldDeleteDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document
     9EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     10EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     11EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    112This tests for a bug where expansion for smart delete would not consider editable boundaries. Only 'foo' should be deleted. You should see ' bar'. <radr://problem/5390681>
    2 | <#selection-caret>
    3 | <span>
    4 |   contenteditable="false"
    5 |   " bar"
     13
     14bar
     15
  • trunk/LayoutTests/editing/deleting/smart-delete-across-editable-boundaries-2.html

    r95003 r241719  
    33<body>
    44<p id="description">This tests for a bug where expansion for smart delete would not consider editable boundaries. Only 'foo' should be deleted. You should see ' bar'. &lt;radr://problem/5390681&gt;</p>
    5 <div contenteditable="true" id="div">foo
     5<div contenteditable="true" id="test">foo
    66<span contenteditable="false"> bar</span></div>
    77
    8 <script src="../../resources/dump-as-markup.js"></script>
     8<script src="../editing.js"></script>
     9<script src="../../resources/ui-helper.js"></script>
    910<script>
    10 var div = document.getElementById("div");
    11 var x = div.offsetLeft;
    12 var y = div.offsetTop;
    13 eventSender.mouseMoveTo(x, y);
    14 eventSender.mouseDown();
    15 eventSender.mouseUp();
    16 eventSender.mouseDown();
    17 eventSender.mouseUp();
    18 document.execCommand("Delete");
    19 Markup.description(description.textContent);
    20 Markup.dump(div);
     11
     12async function editingTest() {
     13        await UIHelper.selectWordByDoubleTapOrClick(document.getElementById('test'));
     14        document.execCommand("Delete");
     15}
     16
     17runDumpAsTextEditingTest(true);
    2118</script>
    2219</body>
  • trunk/LayoutTests/editing/selection/delete-word-granularity-text-control.html

    r217390 r241719  
    44<script src="../../resources/js-test-pre.js"></script>
    55<script src="resources/js-test-selection-shared.js"></script>
     6<script src="../../resources/ui-helper.js"></script>
    67</head>
    78<body>
     
    910<div id="console"></div>
    1011<script>
     12if (window.internals)
     13    internals.settings.setEditingBehavior('mac');
     14
    1115description("Test that setSelectedRange resets the selection granularity to CharacterGranularity.");
    1216
  • trunk/LayoutTests/platform/ios/TestExpectations

    r241284 r241719  
    13411341editing/deleting/delete-all-text-in-text-field-assertion.html [ Failure ]
    13421342editing/deleting/delete-cell-contents.html [ Failure ]
    1343 editing/deleting/smart-delete-002.html [ Failure ]
    13441343editing/deleting/smart-delete-across-editable-boundaries.html [ Failure ]
    13451344editing/deleting/smart-editing-disabled-mac.html [ Failure ]
  • trunk/LayoutTests/platform/ios/editing/deleting/5206311-1-expected.txt

    r230797 r241719  
    6464      RenderBlock {DIV} at (0,298) size 784x76
    6565        RenderBlock {DIV} at (0,0) size 784x20
    66           RenderText {#text} at (0,0) size 40x19
     66          RenderText {#text} at (0,0) size 36x19
    6767            text run at (0,0) width 36: "Hello"
    68             text run at (35,0) width 5: " "
    6968        RenderTable {TABLE} at (0,20) size 46x56 [border: (1px outset #808080)]
    7069          RenderTableSection {TBODY} at (1,1) size 44x54
     
    8584                RenderText {#text} at (2,2) size 8x19
    8685                  text run at (2,2) width 8: "9"
    87 caret: position 6 of child 0 {#text} of child 1 {DIV} of child 14 {DIV} of body
     86caret: position 5 of child 0 {#text} of child 1 {DIV} of child 14 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-and-undo-expected.txt

    r184560 r241719  
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1313EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document
    14 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    15 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    16 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    17 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    18 EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document
    1914EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2015EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-block-merge-contents-012-expected.txt

    r184560 r241719  
    3131EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3232EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    33 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     33EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    3434EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3535EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4242        RenderBlock {DIV} at (14,14) size 756x30
    4343          RenderBlock {DIV} at (0,0) size 756x30
    44             RenderText {#text} at (0,1) size 176x28
    45               text run at (0,1) width 176: "This is some text."
    46 caret: position 8 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
     44            RenderText {#text} at (0,1) size 170x28
     45              text run at (0,1) width 170: "This is some text."
     46caret: position 7 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-block-merge-contents-017-expected.txt

    r184560 r241719  
    3131EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3232EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    33 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    34 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     33EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 2 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    3534EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3635EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4342        RenderBlock {DIV} at (14,14) size 756x30
    4443          RenderBlock {DIV} at (0,0) size 756x30
    45             RenderText {#text} at (0,1) size 176x28
    46               text run at (0,1) width 176: "This is some text."
    47 caret: position 8 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
     44            RenderText {#text} at (0,1) size 170x28
     45              text run at (0,1) width 170: "This is some text."
     46caret: position 7 of child 0 {#text} of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-contiguous-ws-001-expected.txt

    r184560 r241719  
    1111EDITING DELEGATE: shouldDeleteDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 10 of #text > SPAN > DIV > BODY > HTML > #document
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     13EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1414EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1515EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2020    RenderBody {BODY} at (8,8) size 784x584
    2121      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    22         RenderInline {SPAN} at (0,0) size 78x28
    23           RenderText {#text} at (14,15) size 78x28
    24             text run at (14,15) width 78: "foo baz"
     22        RenderInline {SPAN} at (0,0) size 72x28
     23          RenderText {#text} at (14,15) size 72x28
     24            text run at (14,15) width 72: "foo baz"
    2525        RenderText {#text} at (0,0) size 0x0
    26 caret: position 4 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
     26caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-image-003-expected.txt

    r184560 r241719  
    66EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    77EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of SPAN > DIV > BODY > HTML > #document to 3 of SPAN > DIV > BODY > HTML > #document
    8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 8 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     8EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    99EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1010EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1515    RenderBody {BODY} at (8,8) size 784x584
    1616      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    17         RenderInline {SPAN} at (0,0) size 84x28
     17        RenderInline {SPAN} at (0,0) size 78x28
    1818          RenderText {#text} at (14,15) size 11x28
    1919            text run at (14,15) width 11: "a"
    20           RenderText {#text} at (24,15) size 74x28
    21             text run at (24,15) width 74: " lincoln"
     20          RenderText {#text} at (24,15) size 68x28
     21            text run at (24,15) width 68: "lincoln"
    2222        RenderText {#text} at (0,0) size 0x0
    2323caret: position 1 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-leading-ws-001-expected.txt

    r224659 r241719  
    99EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    12 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > SPAN > DIV > BODY > HTML > #document to 2 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     11EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1312EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1413EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    1918    RenderBody {BODY} at (8,8) size 784x584
    2019      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    21         RenderInline {SPAN} at (0,0) size 14x28
    22           RenderText {#text} at (14,15) size 14x28
     20        RenderInline {SPAN} at (0,0) size 8x28
     21          RenderText {#text} at (14,15) size 8x28
    2322            text run at (14,15) width 8: "f"
    24             text run at (21,15) width 7: " "
    25 caret: position 2 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
     23caret: position 1 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-selection-001-expected.txt

    r184560 r241719  
    1616    RenderBody {BODY} at (8,8) size 784x584
    1717      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    18         RenderInline {SPAN} at (0,0) size 76x28
    19           RenderText {#text} at (14,15) size 76x28
    20             text run at (14,15) width 43: " bar "
    21             text run at (56,15) width 34: "baz"
     18        RenderInline {SPAN} at (0,0) size 70x28
     19          RenderText {#text} at (14,15) size 70x28
     20            text run at (14,15) width 37: "bar "
     21            text run at (50,15) width 34: "baz"
    2222        RenderText {#text} at (0,0) size 0x0
    2323caret: position 0 of child 0 {#text} of child 0 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-trailing-ws-001-expected.txt

    r184560 r241719  
    1616    RenderBody {BODY} at (8,8) size 784x584
    1717      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    18         RenderInline {SPAN} at (0,0) size 76x28
    19           RenderText {#text} at (14,15) size 76x28
    20             text run at (14,15) width 43: " bar "
    21             text run at (56,15) width 34: "baz"
     18        RenderInline {SPAN} at (0,0) size 70x28
     19          RenderText {#text} at (14,15) size 70x28
     20            text run at (14,15) width 37: "bar "
     21            text run at (50,15) width 34: "baz"
    2222        RenderText {#text} at (0,0) size 0x0
    2323caret: position 0 of child 0 {#text} of child 0 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-ws-fixup-002-expected.txt

    r184560 r241719  
    3434EDITING DELEGATE: shouldDeleteDOMRange:range from 2 of #text > B > SPAN > DIV > BODY > HTML > #document to 4 of #text > B > SPAN > DIV > BODY > HTML > #document
    3535EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    36 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 0 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     36EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     37EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > SPAN > DIV > BODY > HTML > #document to 0 of #text > B > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > SPAN > DIV > BODY > HTML > #document to 6 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    3738EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    3839EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    4950          text run at (0,20) width 543: "produces a tree that should result in two spaces, but for some reason it isn't rendered."
    5051      RenderBlock {DIV} at (0,56) size 784x88 [border: (2px solid #FF0000)]
    51         RenderInline {SPAN} at (0,0) size 734x58
     52        RenderInline {SPAN} at (0,0) size 728x58
    5253          RenderText {#text} at (14,15) size 96x28
    5354            text run at (14,15) width 96: "in Liberty"
     
    5657              text run at (109,15) width 21: "F "
    5758              text run at (129,15) width 97: "and seven"
    58           RenderText {#text} at (225,15) size 63x28
    59             text run at (225,15) width 63: " years "
     59          RenderText {#text} at (225,15) size 57x28
     60            text run at (225,15) width 57: " years"
    6061          RenderInline {B} at (0,0) size 7x28
    61             RenderText {#text} at (287,15) size 7x28
    62               text run at (287,15) width 7: " "
    63           RenderText {#text} at (293,15) size 734x58
    64             text run at (293,15) width 111: "our fathers "
    65             text run at (403,15) width 339: "f upon this continent, a new nation,"
    66             text run at (741,15) width 7: " "
     62            RenderText {#text} at (281,15) size 7x28
     63              text run at (281,15) width 7: " "
     64          RenderText {#text} at (287,15) size 728x58
     65            text run at (287,15) width 111: "our fathers "
     66            text run at (397,15) width 339: "f upon this continent, a new nation,"
     67            text run at (735,15) width 7: " "
    6768            text run at (14,45) width 228: "conceived    in Liberty, "
    6869            text run at (241,45) width 380: "and dedicated to the proposition that all"
    6970        RenderText {#text} at (0,0) size 0x0
    70 caret: position 7 of child 2 {#text} of child 1 {SPAN} of child 3 {DIV} of body
     71caret: position 6 of child 2 {#text} of child 1 {SPAN} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-ws-fixup-003-expected.txt

    r184560 r241719  
    1111EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     13EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1414EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1515EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2020    RenderBody {BODY} at (8,8) size 784x584
    2121      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    22         RenderInline {SPAN} at (0,0) size 75x28
    23           RenderText {#text} at (14,15) size 37x28
    24             text run at (14,15) width 37: "bar "
     22        RenderInline {SPAN} at (0,0) size 69x28
     23          RenderText {#text} at (14,15) size 31x28
     24            text run at (14,15) width 31: "bar"
    2525          RenderInline {SPAN} at (0,0) size 7x28
    26             RenderText {#text} at (50,15) size 7x28
    27               text run at (50,15) width 7: " "
    28           RenderText {#text} at (56,15) size 33x28
    29             text run at (56,15) width 33: "foo"
     26            RenderText {#text} at (44,15) size 7x28
     27              text run at (44,15) width 7: " "
     28          RenderText {#text} at (50,15) size 33x28
     29            text run at (50,15) width 33: "foo"
    3030        RenderText {#text} at (0,0) size 0x0
    31 caret: position 4 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
     31caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/delete-ws-fixup-004-expected.txt

    r184560 r241719  
    1111EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     13EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1414EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1515EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2020    RenderBody {BODY} at (8,8) size 784x584
    2121      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    22         RenderInline {SPAN} at (0,0) size 87x28
    23           RenderText {#text} at (14,15) size 37x28
    24             text run at (14,15) width 37: "bar "
     22        RenderInline {SPAN} at (0,0) size 81x28
     23          RenderText {#text} at (14,15) size 31x28
     24            text run at (14,15) width 31: "bar"
    2525          RenderInline {SPAN} at (0,0) size 19x28
    26             RenderText {#text} at (50,15) size 19x28
    27               text run at (50,15) width 19: "   "
    28           RenderText {#text} at (68,15) size 33x28
    29             text run at (68,15) width 33: "foo"
     26            RenderText {#text} at (44,15) size 19x28
     27              text run at (44,15) width 19: "   "
     28          RenderText {#text} at (62,15) size 33x28
     29            text run at (62,15) width 33: "foo"
    3030        RenderText {#text} at (0,0) size 0x0
    31 caret: position 4 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
     31caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/deleting/smart-delete-001-expected.txt

    r184560 r241719  
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    33EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    4 layer at (0,0) size 800x600
    5   RenderView at (0,0) size 800x600
    6 layer at (0,0) size 800x600
    7   RenderBlock {HTML} at (0,0) size 800x600
    8     RenderBody {BODY} at (8,8) size 784x584
    9       RenderBlock {DIV} at (0,0) size 784x224 [border: (2px solid #0000FF)]
    10         RenderBlock {DIV} at (14,14) size 756x60
    11           RenderText {#text} at (0,1) size 66x28
    12             text run at (0,1) width 66: "Tests: "
    13           RenderBR {BR} at (0,0) size 0x0
    14           RenderText {#text} at (0,31) size 492x28
    15             text run at (0,31) width 492: "Smart delete when deleting the first word on a line."
    16         RenderBlock {DIV} at (14,90) size 756x120
    17           RenderText {#text} at (0,1) size 190x28
    18             text run at (0,1) width 190: "Expected Results: "
    19           RenderBR {BR} at (189,23) size 1x0
    20           RenderText {#text} at (0,31) size 708x58
    21             text run at (0,31) width 708: "The first word and the space following the first word should be deleted. It"
    22             text run at (0,61) width 201: "should like this this: "
    23           RenderBR {BR} at (200,83) size 1x0
    24           RenderText {#text} at (0,91) size 70x28
    25             text run at (0,91) width 70: "bar baz"
    26       RenderBlock {DIV} at (0,248) size 784x34
    27         RenderBlock {DIV} at (0,0) size 784x34 [border: (2px solid #FF0000)]
    28           RenderText {#text} at (2,3) size 108x28
    29             text run at (2,3) width 108: "foo bar baz"
    30 caret: position 1 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     5EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     6EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     7EDITING DELEGATE: shouldDeleteDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document
     8EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     9EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     10EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     11Tests:
     12Smart delete when deleting the first word on a line.
     13Expected Results:
     14The first word and the space following the first word should be deleted. It should like this this:
     15bar baz
     16bar baz
     17execDeleteCommand: <div id="test" class="editing">bar baz </div>
  • trunk/LayoutTests/platform/ios/editing/deleting/smart-delete-003-expected.txt

    r241662 r241719  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    43EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    5 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     5EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     6EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    67EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    78EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document
     
    1112EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1213EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    13 layer at (0,0) size 800x600
    14   RenderView at (0,0) size 800x600
    15 layer at (0,0) size 800x600
    16   RenderBlock {HTML} at (0,0) size 800x600
    17     RenderBody {BODY} at (8,8) size 784x584
    18       RenderBlock {P} at (0,0) size 784x36
    19         RenderText {#text} at (0,0) size 768x36
    20           text run at (0,0) width 392: "This tests deleting a selection created with a word granularity. "
    21           text run at (392,0) width 348: "To run it manually, double click on 'bar' and hit delete. "
    22           text run at (740,0) width 28: "You"
    23           text run at (0,18) width 127: "should see 'foo baz'."
    24       RenderBlock {DIV} at (0,52) size 784x18
    25         RenderText {#text} at (0,0) size 21x18
    26           text run at (0,0) width 21: "foo"
    27         RenderText {#text} at (21,0) size 26x18
    28           text run at (21,0) width 26: " baz"
    29 caret: position 3 of child 0 {#text} of child 2 {DIV} of body
     14This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit delete. You should see 'foo baz'.
     15
     16Expected Results:
     17The second word and the space before the second word should be deleted. It should like this this:
     18foo baz
     19foo baz
     20
  • trunk/LayoutTests/platform/ios/editing/deleting/smart-delete-004-expected.txt

    r241662 r241719  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    43EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    5 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     5EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     6EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    67EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    78EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document
     
    1112EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1213EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    13 layer at (0,0) size 800x600
    14   RenderView at (0,0) size 800x600
    15 layer at (0,0) size 800x600
    16   RenderBlock {HTML} at (0,0) size 800x600
    17     RenderBody {BODY} at (8,8) size 784x584
    18       RenderBlock {P} at (0,0) size 784x36
    19         RenderText {#text} at (0,0) size 779x36
    20           text run at (0,0) width 401: "This tests deleting a selection created with a word granularity. "
    21           text run at (400,0) width 353: "To run it manually, double click on 'bar' and hit delete. "
    22           text run at (752,0) width 27: "You"
    23           text run at (0,18) width 129: "should see 'foo baz'."
    24       RenderBlock {DIV} at (0,52) size 784x18
    25         RenderText {#text} at (0,0) size 22x18
    26           text run at (0,0) width 22: "foo"
    27         RenderText {#text} at (21,0) size 27x18
    28           text run at (21,0) width 27: " baz"
    29 caret: position 3 of child 0 {#text} of child 2 {DIV} of body
     14This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit forward delete. You should see 'foo baz'.
     15
     16Expected Results:
     17The second word and the space before the second word should be deleted. It should like this this:
     18foo baz
     19foo baz
     20
  • trunk/LayoutTests/platform/ios/editing/deleting/table-cells-expected.txt

    r224659 r241719  
    1616          text run at (371,0) width 366: "Just table content should be removed, not table structure."
    1717      RenderBlock {DIV} at (0,36) size 784x30
    18         RenderTable {TABLE} at (0,0) size 350x30 [border: (1px outset #808080)]
    19           RenderTableSection {TBODY} at (1,1) size 348x28
    20             RenderTableRow {TR} at (0,2) size 348x24
     18        RenderTable {TABLE} at (0,0) size 346x30 [border: (1px outset #808080)]
     19          RenderTableSection {TBODY} at (1,1) size 344x28
     20            RenderTableRow {TR} at (0,2) size 344x24
    2121              RenderTableCell {TD} at (2,2) size 160x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
    2222                RenderBlock {DIV} at (2,2) size 156x20
    2323                  RenderText {#text} at (0,0) size 156x19
    2424                    text run at (0,0) width 156: "These two pieces of text"
    25               RenderTableCell {TD} at (163,2) size 183x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
    26                 RenderBlock {DIV} at (2,2) size 179x20
    27                   RenderText {#text} at (0,0) size 179x19
    28                     text run at (0,0) width 179: " should be in different cells."
     25              RenderTableCell {TD} at (163,2) size 179x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
     26                RenderBlock {DIV} at (2,2) size 175x20
     27                  RenderText {#text} at (0,0) size 175x19
     28                    text run at (0,0) width 175: "should be in different cells."
    2929caret: position 24 of child 0 {#text} of child 0 {DIV} of child 0 {TD} of child 0 {TR} of child 0 {TBODY} of child 0 {TABLE} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/pasteboard/cut-text-001-expected.txt

    r241662 r241719  
    1111EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 7 of #text > SPAN > DIV > BODY > HTML > #document
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > SPAN > DIV > BODY > HTML > #document to 4 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     13EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > SPAN > DIV > BODY > HTML > #document to 3 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1414EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1515EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2020    RenderBody {BODY} at (8,8) size 784x584
    2121      RenderBlock {DIV} at (0,0) size 784x58 [border: (2px solid #FF0000)]
    22         RenderInline {SPAN} at (0,0) size 78x28
    23           RenderText {#text} at (14,15) size 78x28
    24             text run at (14,15) width 78: "foo baz"
     22        RenderInline {SPAN} at (0,0) size 72x28
     23          RenderText {#text} at (14,15) size 72x28
     24            text run at (14,15) width 72: "foo baz"
    2525        RenderText {#text} at (0,0) size 0x0
    26 caret: position 4 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
     26caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/ios/editing/pasteboard/paste-2-expected.txt

    r240307 r241719  
    66EDITING DELEGATE: shouldDeleteDOMRange:range from 8 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document
    77EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    8 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    9 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 8 of #text > BODY > HTML > #document to 8 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     8EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document toDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    109EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1110EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    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
     11EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 7 of #text > BODY > HTML > #document to 7 of #text > BODY > HTML > #document givenAction:WebViewInsertActionPasted
     12EDITING 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
    1413EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1514EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
  • trunk/LayoutTests/platform/win/editing/deleting/smart-delete-001-expected.txt

    r180176 r241719  
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    99EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    10 layer at (0,0) size 800x600
    11   RenderView at (0,0) size 800x600
    12 layer at (0,0) size 800x600
    13   RenderBlock {HTML} at (0,0) size 800x600
    14     RenderBody {BODY} at (8,8) size 784x584
    15       RenderBlock {DIV} at (0,0) size 784x212 [border: (2px solid #0000FF)]
    16         RenderBlock {DIV} at (14,14) size 756x56
    17           RenderText {#text} at (0,0) size 67x28
    18             text run at (0,0) width 67: "Tests: "
    19           RenderBR {BR} at (0,0) size 0x0
    20           RenderText {#text} at (0,28) size 498x28
    21             text run at (0,28) width 498: "Smart delete when deleting the first word on a line."
    22         RenderBlock {DIV} at (14,86) size 756x112
    23           RenderText {#text} at (0,0) size 189x28
    24             text run at (0,0) width 189: "Expected Results: "
    25           RenderBR {BR} at (189,22) size 0x0
    26           RenderText {#text} at (0,28) size 714x56
    27             text run at (0,28) width 714: "The first word and the space following the first word should be deleted. It"
    28             text run at (0,56) width 202: "should like this this: "
    29           RenderBR {BR} at (202,78) size 0x0
    30           RenderText {#text} at (0,84) size 71x28
    31             text run at (0,84) width 71: "bar baz"
    32       RenderBlock {DIV} at (0,236) size 784x32
    33         RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
    34           RenderText {#text} at (2,2) size 71x28
    35             text run at (2,2) width 71: "bar baz"
    36 caret: position 0 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
     10Tests:
     11Smart delete when deleting the first word on a line.
     12Expected Results:
     13The first word and the space following the first word should be deleted. It should like this this:
     14bar baz
     15bar baz
     16execDeleteCommand: <div id="test" class="editing">bar baz </div>
  • trunk/LayoutTests/platform/win/editing/deleting/smart-delete-002-expected.txt

    r180176 r241719  
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    12 layer at (0,0) size 800x600
    13   RenderView at (0,0) size 800x600
    14 layer at (0,0) size 800x600
    15   RenderBlock {HTML} at (0,0) size 800x600
    16     RenderBody {BODY} at (8,8) size 784x584
    17       RenderBlock {DIV} at (0,0) size 784x212 [border: (2px solid #0000FF)]
    18         RenderBlock {DIV} at (14,14) size 756x56
    19           RenderText {#text} at (0,0) size 67x28
    20             text run at (0,0) width 67: "Tests: "
    21           RenderBR {BR} at (0,0) size 0x0
    22           RenderText {#text} at (0,28) size 522x28
    23             text run at (0,28) width 522: "Smart delete when deleting the second word of a line."
    24         RenderBlock {DIV} at (14,86) size 756x112
    25           RenderText {#text} at (0,0) size 189x28
    26             text run at (0,0) width 189: "Expected Results: "
    27           RenderBR {BR} at (189,22) size 0x0
    28           RenderText {#text} at (0,28) size 738x56
    29             text run at (0,28) width 738: "The second word and the space before the second word should be deleted. It"
    30             text run at (0,56) width 202: "should like this this: "
    31           RenderBR {BR} at (202,78) size 0x0
    32           RenderText {#text} at (0,84) size 72x28
    33             text run at (0,84) width 72: "foo baz"
    34       RenderBlock {DIV} at (0,236) size 784x32
    35         RenderBlock {DIV} at (0,0) size 784x32 [border: (2px solid #FF0000)]
    36           RenderText {#text} at (2,2) size 72x28
    37             text run at (2,2) width 72: "foo baz"
    38 caret: position 4 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
     12Tests:
     13Smart delete when deleting the second word of a line.
     14Expected Results:
     15The second word and the space before the second word should be deleted. It should like this this:
     16foo baz
     17foo baz
     18execDeleteCommand: <div id="test" class="editing"> foo baz </div>
  • trunk/LayoutTests/platform/win/editing/deleting/smart-delete-003-expected.txt

    r180176 r241719  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    45EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    56EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     
    1112EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1213EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    13 layer at (0,0) size 800x600
    14   RenderView at (0,0) size 800x600
    15 layer at (0,0) size 800x600
    16   RenderBlock {HTML} at (0,0) size 800x600
    17     RenderBody {BODY} at (8,8) size 784x584
    18       RenderBlock {P} at (0,0) size 784x36
    19         RenderText {#text} at (0,0) size 768x36
    20           text run at (0,0) width 392: "This tests deleting a selection created with a word granularity. "
    21           text run at (392,0) width 348: "To run it manually, double click on 'bar' and hit delete. "
    22           text run at (740,0) width 28: "You"
    23           text run at (0,18) width 127: "should see 'foo baz'."
    24       RenderBlock {DIV} at (0,52) size 784x18
    25         RenderText {#text} at (0,0) size 21x18
    26           text run at (0,0) width 21: "foo"
    27         RenderText {#text} at (21,0) size 26x18
    28           text run at (21,0) width 26: " baz"
    29 caret: position 3 of child 0 {#text} of child 2 {DIV} of body
     14This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit delete. You should see 'foo baz'.
     15
     16Expected Results:
     17The second word and the space before the second word should be deleted. It should like this this:
     18foo baz
     19foo baz
     20
  • trunk/LayoutTests/platform/win/editing/deleting/smart-delete-004-expected.txt

    r180176 r241719  
    11EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
    22EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     3EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     4EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    45EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    56EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > BODY > HTML > #document to 5 of #text > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     
    1112EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1213EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    13 layer at (0,0) size 800x600
    14   RenderView at (0,0) size 800x600
    15 layer at (0,0) size 800x600
    16   RenderBlock {HTML} at (0,0) size 800x600
    17     RenderBody {BODY} at (8,8) size 784x584
    18       RenderBlock {P} at (0,0) size 784x36
    19         RenderText {#text} at (0,0) size 745x36
    20           text run at (0,0) width 392: "This tests deleting a selection created with a word granularity. "
    21           text run at (392,0) width 353: "To run it manually, double click on 'bar' and hit forward"
    22           text run at (0,18) width 45: "delete. "
    23           text run at (45,18) width 159: "You should see 'foo baz'."
    24       RenderBlock {DIV} at (0,52) size 784x18
    25         RenderText {#text} at (0,0) size 21x18
    26           text run at (0,0) width 21: "foo"
    27         RenderText {#text} at (21,0) size 26x18
    28           text run at (21,0) width 26: " baz"
    29 caret: position 3 of child 0 {#text} of child 2 {DIV} of body
     14This tests deleting a selection created with a word granularity. To run it manually, double click on 'bar' and hit forward delete. You should see 'foo baz'.
     15
     16Expected Results:
     17The second word and the space before the second word should be deleted. It should like this this:
     18foo baz
     19foo baz
     20
  • trunk/LayoutTests/resources/ui-helper.js

    r241282 r241719  
    125125    }
    126126
     127    static async doubleActivateAt(x, y)
     128    {
     129        if (this.isIOS())
     130            await UIHelper.doubleTapAt(x, y);
     131        else
     132            await UIHelper.doubleClickAt(x, y);
     133    }
     134
     135    static async doubleActivateAtSelectionStart()
     136    {
     137        const rects = window.getSelection().getRangeAt(0).getClientRects();
     138        const x = rects[0].left;
     139        const y = rects[0].top;
     140        if (this.isIOS()) {
     141            await UIHelper.activateAndWaitForInputSessionAt(x, y);
     142            await UIHelper.doubleTapAt(x, y);
     143            // This is only here to deal with async/sync copy/paste calls, so
     144            // once <rdar://problem/16207002> is resolved, should be able to remove for faster tests.
     145            await new Promise(resolve => testRunner.runUIScript("uiController.uiScriptComplete()", resolve));
     146        } else
     147            await UIHelper.doubleClickAt(x, y);
     148    }
     149
    127150    static async selectWordByDoubleTapOrClick(element, relativeX = 5, relativeY = 5)
    128151    {
     
    131154        const y = boundingRect.y + relativeY;
    132155        if (this.isIOS()) {
    133             await UIHelper.tapAt(x, y);
     156            await UIHelper.activateAndWaitForInputSessionAt(x, y);
    134157            await UIHelper.doubleTapAt(x, y);
    135158            // This is only here to deal with async/sync copy/paste calls, so
  • trunk/Source/WebCore/ChangeLog

    r241654 r241719  
     12019-02-18  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Turn On Smart Delete
     4        https://bugs.webkit.org/show_bug.cgi?id=194320
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Updated the following tests to work with iOS:
     9        * editing/deleting/smart-delete-001.html:
     10        * editing/deleting/smart-delete-002.html:
     11        * editing/deleting/smart-delete-003.html:
     12        * editing/deleting/smart-delete-004.html:
     13        * editing/deleting/smart-delete-across-editable-boundaries-2.html:
     14        * editing/selection/delete-word-granularity-text-control.html:
     15
     16        Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other
     17        platforms to turn on smart delete when desired.
     18
     19        * editing/Editor.cpp:
     20        (WebCore::Editor::shouldSmartDelete):
     21        Allow platfroms to determine if smart delete should be on.
     22        On mac, this is via word granularity, on iOS this is just on all the time.
     23        (WebCore::Editor::canSmartCopyOrDelete):
     24        (WebCore::Editor::performCutOrCopy):
     25        * editing/Editor.h:
     26        * editing/EditorCommand.cpp:
     27        (WebCore::executeDelete):
     28        * editing/ios/EditorIOS.mm:
     29        (WebCore::Editor::shouldSmartDelete):
     30        * editing/mac/EditorMac.mm:
     31        (WebCore::Editor::shouldSmartDelete):
     32
    1332019-02-17  David Kilzer  <ddkilzer@apple.com>
    234
  • trunk/Source/WebCore/editing/EditingBehavior.h

    r240926 r241719  
    9696    // On iOS, we don't want to select all the text when focusing a field. Instead, match platform behavior by going to the end of the line.
    9797    bool shouldMoveSelectionToEndWhenFocusingTextInput() const { return m_type == EditingIOSBehavior; }
     98   
     99    // On iOS, when smart delete is on, it is always on, and should do not additional checks (i.e. WordGranularity).
     100    bool shouldAlwaysSmartDelete() const { return m_type == EditingIOSBehavior; }
    98101
    99102private:
  • trunk/Source/WebCore/editing/Editor.cpp

    r240641 r241719  
    513513}
    514514
     515bool Editor::shouldSmartDelete()
     516{
     517    if (behavior().shouldAlwaysSmartDelete())
     518        return true;
     519    return m_frame.selection().granularity() == WordGranularity;
     520}
     521
    515522bool Editor::smartInsertDeleteEnabled()
    516523{   
     
    520527bool Editor::canSmartCopyOrDelete()
    521528{
    522     return client() && client()->smartInsertDeleteEnabled() && m_frame.selection().granularity() == WordGranularity;
     529    return client() && client()->smartInsertDeleteEnabled() && shouldSmartDelete();
    523530}
    524531
  • trunk/Source/WebCore/editing/Editor.h

    r240476 r241719  
    166166    WEBCORE_EXPORT bool canPaste() const;
    167167    WEBCORE_EXPORT bool canDelete() const;
    168     bool canSmartCopyOrDelete();
     168    WEBCORE_EXPORT bool canSmartCopyOrDelete();
     169    bool shouldSmartDelete();
    169170
    170171    WEBCORE_EXPORT void cut();
  • trunk/Source/WebCore/editing/EditorCommand.cpp

    r241320 r241719  
    298298        // If the current selection is a caret, delete the preceding character. IE performs forwardDelete, but we currently side with Firefox.
    299299        // Doesn't scroll to make the selection visible, or modify the kill ring (this time, siding with IE, not Firefox).
    300         TypingCommand::deleteKeyPressed(*frame.document(), frame.selection().granularity() == WordGranularity ? TypingCommand::SmartDelete : 0);
     300        TypingCommand::deleteKeyPressed(*frame.document(), frame.editor().shouldSmartDelete() ? TypingCommand::SmartDelete : 0);
    301301        return true;
    302302    }
Note: See TracChangeset for help on using the changeset viewer.