Changeset 78104 in webkit


Ignore:
Timestamp:
Feb 9, 2011 12:08:45 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-02-09 Jia Pu <jpu@apple.com>

Reviewed by Darin Adler.

VisibleSelection::setWithoutValidation() should allow caret selection.
https://bugs.webkit.org/show_bug.cgi?id=53943

Fixed the new test introduced in the previous patch for the same bug. Previous test isn't platform independent, and fails on all platforms other than Mac OS X with WebKit 1.

  • editing/undo/undo-paste-when-caret-is-not-in-range-expected.txt:
  • editing/undo/undo-paste-when-caret-is-not-in-range.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r78097 r78104  
     12011-02-09  Jia Pu  <jpu@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        VisibleSelection::setWithoutValidation() should allow caret selection.
     6        https://bugs.webkit.org/show_bug.cgi?id=53943
     7
     8        Fixed the new test introduced in the previous patch for the same bug. Previous test isn't platform independent, and fails on all platforms other than Mac OS X with WebKit 1.
     9
     10        * editing/undo/undo-paste-when-caret-is-not-in-range-expected.txt:
     11        * editing/undo/undo-paste-when-caret-is-not-in-range.html:
     12
    1132011-02-09  Martin Robinson  <mrobinson@igalia.com>
    214
  • trunk/LayoutTests/editing/undo/undo-paste-when-caret-is-not-in-range-expected.txt

    r77995 r78104  
    1 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
    2 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
    3 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    4 EDITING 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
    5 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    6 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    7 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    8 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 4 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    9 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    10 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    11 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    12 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
    13 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    14 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    15 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    16 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    17 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 4 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
    18 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    19 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    20 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 4 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
    21 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    22 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    23 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    24 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    25 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    26 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
    27 layer at (0,0) size 800x600
    28   RenderView at (0,0) size 800x600
    29 layer at (0,0) size 800x600
    30   RenderBlock {HTML} at (0,0) size 800x600
    31     RenderBody {BODY} at (8,8) size 784x584
    32       RenderBlock (anonymous) at (0,0) size 784x18
    33         RenderText {#text} at (0,0) size 650x18
    34           text run at (0,0) width 650: "This tests the situation of undoing a paste operation when the caret is outside of the range to be undone."
    35       RenderBlock {DIV} at (0,18) size 784x18
    36 caret: position 0 of child 1 {DIV} of body
     1This tests an assertion failure when undoing a paste operation when the caret is outside of the range to be undone. This test should not crash with debug build.
  • trunk/LayoutTests/editing/undo/undo-paste-when-caret-is-not-in-range.html

    r77995 r78104  
    1 <html>
    2 <head>
    3 
    4 <style>
    5 .editing {
    6     border: 2px solid red;
    7     padding: 12px;
    8     font-size: 24px;
    9 }
    10 </style>
    11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
    12 
    13 <script language="javascript" type="text/javascript">
    14 
    15 function editingTest() {
    16     var s = window.getSelection();
    17     var test = document.getElementById("test");
    18     test.focus();
    19     s.setPosition(test, 0);
    20     document.execCommand("InsertText", false, "abc ");
    21     s.setBaseAndExtent(test.firstChild, 0, test.firstChild, 3);
    22     execCopyCommand();
    23     document.execCommand("InsertText", false, "def");
    24     s.setBaseAndExtent(test.firstChild, 0, test.firstChild, 3);
    25     execPasteCommand();
    26     moveSelectionForwardByLineCommand();
    27     undoCommand();
    28 }
     1<div id="edit" contentEditable="true">abc </div>
     2<script>
     3if (window.layoutTestController)
     4    window.layoutTestController.dumpAsText();
     5edit = document.getElementById("edit");
     6var s = window.getSelection();
     7s.setPosition(edit, 3);
     8document.execCommand("InsertText", false, " ");
     9s.setBaseAndExtent(edit.firstChild, 0, edit.firstChild, 3);
     10document.execCommand("Copy");
     11document.execCommand("InsertText", false, "def");
     12s.setBaseAndExtent(edit.firstChild, 0, edit.firstChild, 3);
     13document.execCommand("Paste");
     14s.setPosition(edit, 4);
     15document.execCommand("Undo");
     16document.body.innerHTML = "<div>This tests an assertion failure when undoing a paste operation when the caret is outside of the range to be undone. This test should not crash with debug build.</div>";
    2917</script>
    30 
    31 <title>Undo After Paste Test</title>
    32 </head>
    33 <body>
    34 This tests the situation of undoing a paste operation when the caret is outside of the range to be undone.
    35 <div id="test" contenteditable="true"></div>
    36 
    37 <script language="javascript" type="text/javascript">
    38 runEditingTest();
    39 </script>
    40 
    41 </body>
    42 </html>
    43 
Note: See TracChangeset for help on using the changeset viewer.