Changeset 88066 in webkit


Ignore:
Timestamp:
Jun 3, 2011 2:55:11 PM (13 years ago)
Author:
Martin Robinson
Message:

2011-05-31 Martin Robinson <mrobinson@igalia.com>

Reviewed by Ryosuke Niwa.

[GTK] Support smart replace for the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=61734

Unskip tests which are now passing and update results for other tests
which vary depending on smart replace support.

  • platform/gtk/Skipped: Unskip tests which are now passing.
  • platform/gtk/editing/deleting/smart-delete-003-expected.txt:
  • platform/gtk/editing/deleting/smart-delete-004-expected.txt:
  • platform/gtk/editing/pasteboard/4944770-2-expected.txt:
  • platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt:
  • platform/gtk/editing/pasteboard/smart-paste-007-expected.txt:
  • platform/gtk/editing/pasteboard/smart-paste-008-expected.txt:
  • platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt:
  • platform/gtk/fast/lists/drag-into-marker-expected.txt:

2011-05-31 Martin Robinson <mrobinson@igalia.com>

Reviewed by Ryosuke Niwa.

[GTK] Support smart replace for the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=61734

Add smart replace support to WebCore and add hooks for it in WebKit
via DumpRenderTreeSupportGtk. When a platform supports smart replace,
WebCore will remove extra spaces that appear when pasting text. Eventually
WebKitGTK+ may want to expose this in the public API.

  • platform/gtk/PasteboardGtk.cpp: (WebCore::Pasteboard::writeSelection): Now pass whether or not to use smart replace when calling writeSelection. (WebCore::Pasteboard::canSmartReplace): Added an implementation that checks the clipboard for whether or not it supports smart paste.
  • platform/gtk/PasteboardHelper.cpp: (WebCore::initGdkAtoms): Added initialization for smart replace atom. (WebCore::PasteboardHelper::fillSelectionData): Added no-op handler for smart replace atom. (WebCore::PasteboardHelper::targetListForDataObject): Properly handle new smart replace parameter. (WebCore::PasteboardHelper::writeClipboardContents): Properly handle new smart replace parameter. (WebCore::PasteboardHelper::clipboardContentSupportsSmartReplace): Added helper for Pasteboard.
  • platform/gtk/PasteboardHelper.h: Add new method definition.

2011-05-31 Martin Robinson <mrobinson@igalia.com>

Reviewed by Ryosuke Niwa.

[GTK] Support smart replace for the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=61734

Add the EditorClient and DumpRenderTreeSupportGtk hooks for enabling
smart replace in the tests.

  • WebCoreSupport/DragClientGtk.cpp: (WebKit::DragClient::startDrag): targeListForDataObject now takes another parameter determining whether or not to add smart paste support. Add it here.
  • WebCoreSupport/DumpRenderTreeSupportGtk.cpp: (DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled): Added.
  • WebCoreSupport/DumpRenderTreeSupportGtk.h: Add new method definition.
  • WebCoreSupport/EditorClientGtk.cpp: (WebKit::EditorClient::toggleSmartInsertDelete): Added implementation. (WebKit::EditorClient::smartInsertDeleteEnabled): Added. (WebKit::EditorClient::EditorClient):
  • WebCoreSupport/EditorClientGtk.h: Add new method definition.

2011-05-31 Martin Robinson <mrobinson@igalia.com>

Reviewed by Ryosuke Niwa.

[GTK] Support smart replace for the pasteboard
https://bugs.webkit.org/show_bug.cgi?id=61734

Call into the DumpRenderTreeSupportGtk hooks to toggle smart replace.
This is required to produce consistent test results.

  • DumpRenderTree/gtk/DumpRenderTree.cpp: (resetDefaultsToConsistentValues): Set the smart replace setting to on by default.
  • DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::setSmartInsertDeleteEnabled): Added an implementation of this methods which calls into DumpRenderTreeSupportGtk.
Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r88064 r88066  
     12011-05-31  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        [GTK] Support smart replace for the pasteboard
     6        https://bugs.webkit.org/show_bug.cgi?id=61734
     7
     8        Unskip tests which are now passing and update results for other tests
     9        which vary depending on smart replace support.
     10
     11        * platform/gtk/Skipped: Unskip tests which are now passing.
     12        * platform/gtk/editing/deleting/smart-delete-003-expected.txt:
     13        * platform/gtk/editing/deleting/smart-delete-004-expected.txt:
     14        * platform/gtk/editing/pasteboard/4944770-2-expected.txt:
     15        * platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt:
     16        * platform/gtk/editing/pasteboard/smart-paste-007-expected.txt:
     17        * platform/gtk/editing/pasteboard/smart-paste-008-expected.txt:
     18        * platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt:
     19        * platform/gtk/fast/lists/drag-into-marker-expected.txt:
     20
    1212011-06-03  Martin Robinson  <mrobinson@igalia.com>
    222
  • trunk/LayoutTests/platform/gtk/Skipped

    r88062 r88066  
    403403# https://bugs.webkit.org/show_bug.cgi?id=61661
    404404editing/pasteboard/smart-drag-drop.html
    405 editing/pasteboard/smart-paste-001.html
    406 editing/pasteboard/smart-paste-002.html
    407 editing/pasteboard/smart-paste-003.html
    408 editing/pasteboard/smart-paste-004.html
    409 editing/pasteboard/smart-paste-005.html
    410405editing/pasteboard/drag-drop-list.html
    411406
  • trunk/LayoutTests/platform/gtk/editing/deleting/smart-delete-003-expected.txt

    r80127 r88066  
    77EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    910EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1011EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2122          text run at (0,19) width 127: "should see 'foo baz'."
    2223      RenderBlock {DIV} at (0,54) size 784x19
    23         RenderText {#text} at (0,0) size 25x19
    24           text run at (0,0) width 25: "foo "
    25         RenderText {#text} at (25,0) size 26x19
    26           text run at (25,0) width 26: " baz"
    27 caret: position 4 of child 0 {#text} of child 2 {DIV} of body
     24        RenderText {#text} at (0,0) size 21x19
     25          text run at (0,0) width 21: "foo"
     26        RenderText {#text} at (21,0) size 26x19
     27          text run at (21,0) width 26: " baz"
     28caret: position 3 of child 0 {#text} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/deleting/smart-delete-004-expected.txt

    r80127 r88066  
    77EDITING DELEGATE: shouldDeleteDOMRange:range from 4 of #text > DIV > BODY > HTML > #document to 1 of #text > DIV > BODY > HTML > #document
    88EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
     9EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > DIV > BODY > HTML > #document to 3 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    910EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1011EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2122          text run at (45,19) width 159: "You should see 'foo baz'."
    2223      RenderBlock {DIV} at (0,54) size 784x19
    23         RenderText {#text} at (0,0) size 25x19
    24           text run at (0,0) width 25: "foo "
    25         RenderText {#text} at (25,0) size 26x19
    26           text run at (25,0) width 26: " baz"
    27 caret: position 4 of child 0 {#text} of child 2 {DIV} of body
     24        RenderText {#text} at (0,0) size 21x19
     25          text run at (0,0) width 21: "foo"
     26        RenderText {#text} at (21,0) size 26x19
     27          text run at (21,0) width 26: " baz"
     28caret: position 3 of child 0 {#text} of child 2 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/pasteboard/4944770-2-expected.txt

    r82033 r88066  
    1717        RenderText {#text} at (0,6) size 8x19
    1818          text run at (0,6) width 8: "x"
    19         RenderMenuList {SELECT} at (10,2) size 37x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     19        RenderText {#text} at (8,6) size 4x19
     20          text run at (8,6) width 4: " "
     21        RenderMenuList {SELECT} at (14,2) size 37x27 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    2022          RenderBlock (anonymous) at (1,1) size 35x25
    2123            RenderText at (3,3) size 9x19
    2224              text run at (3,3) width 9: "1"
    23         RenderText {#text} at (49,6) size 8x19
    24           text run at (49,6) width 8: "x"
    25 caret: position 3 of child 1 {SELECT} of child 4 {DIV} of body
     25        RenderText {#text} at (53,6) size 4x19
     26          text run at (53,6) width 4: " "
     27        RenderText {#text} at (57,6) size 8x19
     28          text run at (57,6) width 8: "x"
     29caret: position 1 of child 3 {#text} of child 4 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt

    r72675 r88066  
    1818          text run at (0,19) width 86: "\"worldhello\"."
    1919      RenderBlock {DIV} at (0,54) size 784x19
    20         RenderText {#text} at (0,0) size 41x19
    21           text run at (0,0) width 41: " world"
    22         RenderText {#text} at (41,0) size 31x19
    23           text run at (41,0) width 31: "hello"
     20        RenderText {#text} at (0,0) size 37x19
     21          text run at (0,0) width 37: "world"
     22        RenderText {#text} at (37,0) size 31x19
     23          text run at (37,0) width 31: "hello"
    2424selection start: position 0 of child 1 {#text} of child 3 {DIV} of body
    2525selection end:   position 5 of child 1 {#text} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/pasteboard/smart-paste-007-expected.txt

    r81109 r88066  
    2121EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2222EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    23 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     23EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    2424EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    2525EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    5050          RenderText {#text} at (2,2) size 6x28
    5151            text run at (2,2) width 6: "."
    52           RenderText {#text} at (8,2) size 34x28
    53             text run at (8,2) width 34: "test"
    54           RenderText {#text} at (42,2) size 6x28
    55             text run at (42,2) width 6: "."
     52          RenderText {#text} at (8,2) size 40x28
     53            text run at (8,2) width 40: " test"
     54          RenderText {#text} at (48,2) size 6x28
     55            text run at (48,2) width 6: "."
    5656        RenderBlock (anonymous) at (0,32) size 784x0
    57 caret: position 4 of child 1 {#text} of child 1 {DIV} of child 3 {DIV} of body
     57caret: position 5 of child 1 {#text} of child 1 {DIV} of child 3 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/pasteboard/smart-paste-008-expected.txt

    r81109 r88066  
    1010EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1111EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    12 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     12EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1313EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1414EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    3232          RenderText {#text} at (0,0) size 5x19
    3333            text run at (0,0) width 5: "f"
    34           RenderText {#text} at (5,0) size 21x19
    35             text run at (5,0) width 21: "foo"
    36           RenderText {#text} at (26,0) size 24x19
    37             text run at (26,0) width 24: " bar"
     34          RenderText {#text} at (5,0) size 25x19
     35            text run at (5,0) width 25: " foo"
     36          RenderText {#text} at (30,0) size 24x19
     37            text run at (30,0) width 24: " bar"
    3838        RenderBlock (anonymous) at (0,19) size 784x0
    39 caret: position 3 of child 1 {#text} of child 0 {DIV} of child 4 {DIV} of body
     39caret: position 4 of child 1 {#text} of child 0 {DIV} of child 4 {DIV} of body
  • trunk/LayoutTests/platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt

    r80127 r88066  
    1111EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 11 of #text > BODY > HTML > #document to 11 of #text > BODY > HTML > #document givenAction:WebViewInsertActionDropped
    1212EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    13 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    14 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 4 of #text > BODY > HTML > #document to 5 of #text > BODY > HTML > #document toDOMRange:range from 0 of #text > BODY > HTML > #document to 3 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
     13EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > BODY > HTML > #document to 3 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
    1514EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
    1615EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
     
    2726            RenderBlock {HTML} at (0,0) size 300x300
    2827              RenderBody {BODY} at (8,8) size 284x284 [bgcolor=#FFFFE0]
    29                 RenderText {#text} at (0,0) size 51x19
    30                   text run at (0,0) width 51: "foo baz"
    31                 RenderText {#text} at (51,0) size 20x19
    32                   text run at (51,0) width 20: "bar"
     28                RenderText {#text} at (0,0) size 47x19
     29                  text run at (0,0) width 47: "foo baz"
     30                RenderText {#text} at (47,0) size 20x19
     31                  text run at (47,0) width 20: "bar"
    3332        RenderText {#text} at (0,0) size 0x0
    3433      RenderBlock {P} at (0,320) size 800x38
  • trunk/LayoutTests/platform/gtk/fast/lists/drag-into-marker-expected.txt

    r71405 r88066  
    99          RenderText {#text} at (0,0) size 112x54
    1010            text run at (0,0) width 112: "world"
    11           RenderText {#text} at (112,0) size 107x54
     11          RenderText {#text} at (112,0) size 95x54
    1212            text run at (112,0) width 95: "hello"
    13             text run at (207,0) width 12: " "
    1413      RenderBlock {P} at (0,73) size 784x76
    1514        RenderText {#text} at (0,0) size 768x76
  • trunk/Source/WebCore/ChangeLog

    r88063 r88066  
     12011-05-31  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        [GTK] Support smart replace for the pasteboard
     6        https://bugs.webkit.org/show_bug.cgi?id=61734
     7
     8        Add smart replace support to WebCore and add hooks for it in WebKit
     9        via DumpRenderTreeSupportGtk. When a platform supports smart replace,
     10        WebCore will remove extra spaces that appear when pasting text. Eventually
     11        WebKitGTK+ may want to expose this in the public API.
     12
     13        * platform/gtk/PasteboardGtk.cpp:
     14        (WebCore::Pasteboard::writeSelection): Now pass whether or not to use smart replace
     15        when calling writeSelection.
     16        (WebCore::Pasteboard::canSmartReplace): Added an implementation that checks the clipboard
     17        for whether or not it supports smart paste.
     18        * platform/gtk/PasteboardHelper.cpp:
     19        (WebCore::initGdkAtoms): Added initialization for smart replace atom.
     20        (WebCore::PasteboardHelper::fillSelectionData): Added no-op handler for smart replace atom.
     21        (WebCore::PasteboardHelper::targetListForDataObject): Properly handle new smart replace parameter.
     22        (WebCore::PasteboardHelper::writeClipboardContents): Properly handle new smart replace parameter.
     23        (WebCore::PasteboardHelper::clipboardContentSupportsSmartReplace): Added helper for Pasteboard.
     24        * platform/gtk/PasteboardHelper.h: Add new method definition.
     25
    1262011-06-03  Levi Weintraub  <leviw@chromium.org>
    227
  • trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp

    r87978 r88066  
    6262    dataObject->setText(frame->editor()->selectedText());
    6363    dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs));
    64     helper->writeClipboardContents(clipboard);
     64    helper->writeClipboardContents(clipboard, canSmartCopyOrDelete ? PasteboardHelper::IncludeSmartPaste : PasteboardHelper::DoNotIncludeSmartPaste);
    6565}
    6666
     
    143143bool Pasteboard::canSmartReplace()
    144144{
    145     notImplemented();
    146     return false;
     145    return PasteboardHelper::defaultPasteboardHelper()->clipboardContentSupportsSmartReplace(
     146        gtk_clipboard_get_for_display(gdk_display_get_default(), GDK_SELECTION_CLIPBOARD));
    147147}
    148148
  • trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp

    r87978 r88066  
    3939static GdkAtom netscapeURLAtom;
    4040static GdkAtom uriListAtom;
     41static GdkAtom smartPasteAtom;
    4142static String gMarkupPrefix;
    4243
     
    6263    netscapeURLAtom = gdk_atom_intern("_NETSCAPE_URL", FALSE);
    6364    uriListAtom = gdk_atom_intern("text/uri-list", FALSE);
     65    smartPasteAtom = gdk_atom_intern("application/vnd.webkitgtk.smartpaste", FALSE);
    6466    gMarkupPrefix = "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
    6567}
     
    191193    } else if (info == TargetTypeImage)
    192194        gtk_selection_data_set_pixbuf(selectionData, dataObject->image());
    193 }
    194 
    195 GtkTargetList* PasteboardHelper::targetListForDataObject(DataObjectGtk* dataObject)
     195
     196    else if (info == TargetTypeSmartPaste)
     197        gtk_selection_data_set_text(selectionData, "", -1);
     198}
     199
     200GtkTargetList* PasteboardHelper::targetListForDataObject(DataObjectGtk* dataObject, SmartPasteInclusion shouldInludeSmartPaste)
    196201{
    197202    GtkTargetList* list = gtk_target_list_new(0, 0);
     
    210215    if (dataObject->hasImage())
    211216        gtk_target_list_add_image_targets(list, TargetTypeImage, TRUE);
     217
     218    if (shouldInludeSmartPaste == IncludeSmartPaste)
     219        gtk_target_list_add(list, smartPasteAtom, 0, TargetTypeSmartPaste);
    212220
    213221    return list;
     
    290298}
    291299
    292 void PasteboardHelper::writeClipboardContents(GtkClipboard* clipboard, GClosure* callback)
     300void PasteboardHelper::writeClipboardContents(GtkClipboard* clipboard, SmartPasteInclusion includeSmartPaste, GClosure* callback)
    293301{
    294302    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
    295     GtkTargetList* list = targetListForDataObject(dataObject);
     303    GtkTargetList* list = targetListForDataObject(dataObject, includeSmartPaste);
    296304
    297305    int numberOfTargets;
     
    315323}
    316324
    317 }
    318 
     325bool PasteboardHelper::clipboardContentSupportsSmartReplace(GtkClipboard* clipboard)
     326{
     327    return gtk_clipboard_wait_is_target_available(clipboard, smartPasteAtom);
     328}
     329
     330}
     331
  • trunk/Source/WebCore/platform/gtk/PasteboardHelper.h

    r87978 r88066  
    4141    bool usePrimarySelectionClipboard() { return m_usePrimarySelectionClipboard; }
    4242
     43    enum SmartPasteInclusion { IncludeSmartPaste, DoNotIncludeSmartPaste };
     44
    4345    GtkClipboard* getCurrentClipboard(Frame*);
    4446    GtkClipboard* getClipboard(Frame*) const;
    4547    GtkClipboard* getPrimarySelectionClipboard(Frame*) const;
    4648    GtkTargetList* targetList() const;
    47     GtkTargetList* targetListForDataObject(DataObjectGtk*);
     49    GtkTargetList* targetListForDataObject(DataObjectGtk*, SmartPasteInclusion = DoNotIncludeSmartPaste);
    4850    void fillSelectionData(GtkSelectionData*, guint, DataObjectGtk*);
    4951    void fillDataObjectFromDropData(GtkSelectionData*, guint, DataObjectGtk*);
    5052    Vector<GdkAtom> dropAtomsForContext(GtkWidget*, GdkDragContext*);
    51     void writeClipboardContents(GtkClipboard*, GClosure* closure = 0);
     53    void writeClipboardContents(GtkClipboard*, SmartPasteInclusion = DoNotIncludeSmartPaste, GClosure* = 0);
    5254    void getClipboardContents(GtkClipboard*);
    5355
    54     enum PasteboardTargetType { TargetTypeMarkup, TargetTypeText, TargetTypeImage, TargetTypeURIList, TargetTypeNetscapeURL, TargetTypeUnknown };
     56    enum PasteboardTargetType { TargetTypeMarkup, TargetTypeText, TargetTypeImage, TargetTypeURIList, TargetTypeNetscapeURL, TargetTypeSmartPaste, TargetTypeUnknown };
     57    bool clipboardContentSupportsSmartReplace(GtkClipboard*);
    5558
    5659private:
  • trunk/Source/WebKit/gtk/ChangeLog

    r87999 r88066  
     12011-05-31  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        [GTK] Support smart replace for the pasteboard
     6        https://bugs.webkit.org/show_bug.cgi?id=61734
     7
     8        Add the EditorClient and DumpRenderTreeSupportGtk hooks for enabling
     9        smart replace in the tests.
     10
     11        * WebCoreSupport/DragClientGtk.cpp:
     12        (WebKit::DragClient::startDrag): targeListForDataObject now takes another
     13        parameter determining whether or not to add smart paste support. Add it here.
     14        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     15        (DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled): Added.
     16        * WebCoreSupport/DumpRenderTreeSupportGtk.h: Add new method definition.
     17        * WebCoreSupport/EditorClientGtk.cpp:
     18        (WebKit::EditorClient::toggleSmartInsertDelete): Added implementation.
     19        (WebKit::EditorClient::smartInsertDeleteEnabled): Added.
     20        (WebKit::EditorClient::EditorClient):
     21        * WebCoreSupport/EditorClientGtk.h: Add new method definition.
     22
    1232011-06-03  Sergio Villar Senin  <svillar@igalia.com>
    224
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r87049 r88066  
    2929#include "DOMWrapperWorld.h"
    3030#include "Document.h"
     31#include "EditorClientGtk.h"
    3132#include "Element.h"
    3233#include "FocusController.h"
     
    608609}
    609610
     611void DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(WebKitWebView* webView, bool enabled)
     612{
     613    g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
     614    g_return_if_fail(webView);
     615
     616    WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient());
     617    client->setSmartInsertDeleteEnabled(enabled);
     618}
     619
    610620void DumpRenderTreeSupportGtk::whiteListAccessFromOrigin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains)
    611621{
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h

    r85925 r88066  
    106106    static void rectangleForSelection(WebKitWebFrame*, GdkRectangle*);
    107107    static void scalePageBy(WebKitWebView*, float, float, float);
     108    static void setSmartInsertDeleteEnabled(WebKitWebView*, bool);
    108109
    109110    // Accessibility
  • trunk/Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp

    r87978 r88066  
    296296    GClosure* callback = g_cclosure_new_object(G_CALLBACK(collapseSelection), G_OBJECT(webView));
    297297    g_closure_set_marshal(callback, g_cclosure_marshal_VOID__VOID);
    298     PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard, callback);
     298    PasteboardHelper::defaultPasteboardHelper()->writeClipboardContents(clipboard, PasteboardHelper::DoNotIncludeSmartPaste, callback);
    299299    viewSettingClipboard = 0;
    300300}
     
    424424}
    425425
     426void EditorClient::setSmartInsertDeleteEnabled(bool enabled)
     427{
     428    m_smartInsertDeleteEnabled = enabled;
     429}
     430
    426431bool EditorClient::smartInsertDeleteEnabled()
    427432{
    428     notImplemented();
    429     return false;
     433    return m_smartInsertDeleteEnabled;
    430434}
    431435
     
    627631    , m_preventNextCompositionCommit(false)
    628632    , m_treatContextCommitAsKeyEvent(false)
     633    , m_smartInsertDeleteEnabled(false)
    629634{
    630635    WebKitWebViewPrivate* priv = m_webView->priv;
  • trunk/Source/WebKit/gtk/WebCoreSupport/EditorClientGtk.h

    r86436 r88066  
    8181        virtual bool shouldShowDeleteInterface(WebCore::HTMLElement*);
    8282        virtual bool smartInsertDeleteEnabled();
     83        void setSmartInsertDeleteEnabled(bool);
    8384        virtual bool isSelectTrailingWhitespaceEnabled();
    8485        virtual bool isContinuousSpellCheckingEnabled();
     
    150151        WebCore::KeyBindingTranslator m_keyBindingTranslator;
    151152        Vector<WTF::String> m_pendingEditorCommands;
     153
     154        bool m_smartInsertDeleteEnabled;
    152155    };
    153156}
  • trunk/Tools/ChangeLog

    r88062 r88066  
     12011-05-31  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        [GTK] Support smart replace for the pasteboard
     6        https://bugs.webkit.org/show_bug.cgi?id=61734
     7
     8        Call into the DumpRenderTreeSupportGtk hooks to toggle smart replace.
     9        This is required to produce consistent test results.
     10
     11        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     12        (resetDefaultsToConsistentValues): Set the smart replace setting to on by default.
     13        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
     14        (LayoutTestController::setSmartInsertDeleteEnabled): Added an implementation of this
     15        methods which calls into DumpRenderTreeSupportGtk.
     16
    1172011-06-03  Martin Robinson  <mrobinson@igalia.com>
    218
  • trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r88062 r88066  
    468468    webkit_icon_database_set_path(webkit_get_icon_database(), 0);
    469469    DumpRenderTreeSupportGtk::setSelectTrailingWhitespaceEnabled(false);
     470    DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(webView, true);
    470471
    471472    if (axController)
  • trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp

    r87770 r88066  
    366366void LayoutTestController::setSmartInsertDeleteEnabled(bool flag)
    367367{
    368     // FIXME: implement
     368    DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(webkit_web_frame_get_web_view(mainFrame), flag);
    369369}
    370370
Note: See TracChangeset for help on using the changeset viewer.