Changeset 64082 in webkit


Ignore:
Timestamp:
Jul 26, 2010 3:34:49 PM (14 years ago)
Author:
Martin Robinson
Message:

2010-07-26 Martin Robinson <mrobinson@igalia.com>

Reviewed by Gustavo Noronha Silva.

[GTK] The EventSender should support simulating drop events
https://bugs.webkit.org/show_bug.cgi?id=39844

Unskip tests that are now passing and add baselines for new tests. Re-organize
remaining failures so they can be unskipped more easily in the future.

  • platform/gtk/Skipped:
  • platform/gtk/editing/pasteboard/dataTransfer-setData-getData-expected.txt: Added.
  • platform/gtk/editing/pasteboard/drag-drop-dead-frame-expected.txt: Added.
  • platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt: Added.
  • platform/gtk/editing/pasteboard/drop-text-without-selection-expected.txt: Added.
  • platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt: Added.
  • platform/gtk/editing/selection/drag-select-1-expected.txt: Added.
  • platform/gtk/editing/selection/drag-text-delay-expected.txt: Added.
  • platform/gtk/fast/events/bogus-dropEffect-effectAllowed-expected.txt: Removed.
  • platform/gtk/fast/forms/input-text-drag-down-expected.txt: Added.
  • platform/gtk/fast/lists/drag-into-marker-expected.txt: Added.

2010-07-26 Martin Robinson <mrobinson@igalia.com>

Reviewed by Gustavo Noronha Silva.

[GTK] The EventSender should support simulating drop events
https://bugs.webkit.org/show_bug.cgi?id=39844

Add initial dropping support to the GTK+ EventSender.

  • DumpRenderTree/gtk/DumpRenderTree.cpp: (createWebView): Listen for some new drag-and-drop signals.
  • DumpRenderTree/gtk/EventSender.cpp: Add currentDragSourceContext. (dispatchEvent): Detect situations where a drag is either starting or ending and massage GTK+ into sending the appropriate signals to the WebView. (replaySavedEvents): Remove comment. (makeEventSender): Clear the currentDragSourceContext when creating a new EventSender. (dragBeginCallback): Capture the new currentDragSourceContext when a drag begins. (dragEndCallback): Clear the currentDragSourceContext when a drag ends. (dragFailedCallback): Disable the GTK+ drag failed animation.
  • DumpRenderTree/gtk/EventSender.h: Add declarations for new signal callbacks.
Location:
trunk
Files:
9 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64081 r64082  
     12010-07-26  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [GTK] The EventSender should support simulating drop events
     6        https://bugs.webkit.org/show_bug.cgi?id=39844
     7
     8        Unskip tests that are now passing and add baselines for new tests. Re-organize
     9        remaining failures so they can be unskipped more easily in the future.
     10
     11        * platform/gtk/Skipped:
     12        * platform/gtk/editing/pasteboard/dataTransfer-setData-getData-expected.txt: Added.
     13        * platform/gtk/editing/pasteboard/drag-drop-dead-frame-expected.txt: Added.
     14        * platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt: Added.
     15        * platform/gtk/editing/pasteboard/drop-text-without-selection-expected.txt: Added.
     16        * platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt: Added.
     17        * platform/gtk/editing/selection/drag-select-1-expected.txt: Added.
     18        * platform/gtk/editing/selection/drag-text-delay-expected.txt: Added.
     19        * platform/gtk/fast/events/bogus-dropEffect-effectAllowed-expected.txt: Removed.
     20        * platform/gtk/fast/forms/input-text-drag-down-expected.txt: Added.
     21        * platform/gtk/fast/lists/drag-into-marker-expected.txt: Added.
     22
    1232010-07-26  Victor Wang  <victorw@chromium.org>
    224
  • trunk/LayoutTests/platform/gtk/Skipped

    r64032 r64082  
    630630editing/pasteboard/5368833.html
    631631editing/pasteboard/5780697-2.html
    632 editing/pasteboard/drag-drop-input-textarea.html
    633 editing/pasteboard/drag-drop-url-text.html
    634632editing/pasteboard/copy-in-password-field.html
    635 editing/pasteboard/drag-image-in-about-blank-frame.html
    636 editing/pasteboard/file-drag-to-editable.html
    637633editing/pasteboard/file-input-files-access.html
    638 editing/pasteboard/get-data-text-plain-drop.html
    639634editing/pasteboard/paste-into-anchor-text.html
    640635editing/pasteboard/paste-plaintext-user-select-none.html
     
    649644editing/selection/click-in-padding-with-multiple-line-boxes.html
    650645editing/selection/doubleclick-whitespace.html
    651 editing/selection/drag-start-event-client-x-y.html
    652 editing/selection/drag-text-delay.html
    653646editing/selection/extend-selection-bidi.html
    654647editing/selection/getRangeAt.html
     
    856849editing/pasteboard/displaced-placeholder.html
    857850editing/pasteboard/display-block-on-spans.html
    858 editing/pasteboard/drag-drop-dead-frame.html
    859 editing/pasteboard/drag-drop-modifies-page.html
    860 editing/pasteboard/drag-image-to-contenteditable-in-iframe.html
    861 editing/pasteboard/drag-selected-image-to-contenteditable.html
    862 editing/pasteboard/drop-link.html
    863 editing/pasteboard/drop-text-without-selection.html
    864851editing/pasteboard/emacs-cntl-y-001.html
    865852editing/pasteboard/emacs-ctrl-a-k-y.html
     
    933920editing/pasteboard/smart-paste-008.html
    934921editing/pasteboard/styled-element-markup.html
    935 editing/pasteboard/subframe-dragndrop-1.html
    936922editing/pasteboard/testcase-9507.html
    937923editing/pasteboard/undoable-fragment-removes.html
     
    969955editing/selection/display-table-text.html
    970956editing/selection/doubleclick-crash.html
    971 editing/selection/drag-select-1.html
    972 editing/selection/drag-to-contenteditable-iframe.html
    973957editing/selection/editable-html-element.html
    974958editing/selection/editable-links.html
     
    11561140fast/events/autoscroll-with-non-scrollable-parent.html
    11571141fast/events/blur-focus-window-should-blur-focus-element.html
    1158 fast/events/content-changed-during-drop.html
    1159 fast/events/crash-on-mutate-during-drop.html
    1160 fast/events/drag-in-frames.html
    11611142fast/events/frame-tab-focus.html
    11621143fast/events/js-keyboard-event-creation.html
     
    11661147fast/events/onchange-searchfield.html
    11671148fast/events/onchange-textfield.html
    1168 fast/events/ondragenter.html
    11691149fast/events/onsearch-enter.html
    11701150fast/events/onunload-clears-onbeforeunload.html
     
    11811161fast/events/tabindex-focus-chain.html
    11821162fast/forms/button-state-restore.html
    1183 fast/forms/drag-into-textarea.html
    1184 fast/forms/drag-out-of-textarea.html
    11851163fast/forms/focus2.html
    11861164fast/forms/focus-control-to-page.html
     
    12881266# Possible bug in eventSender.zoomPageOut() ? https://bugs.webkit.org/show_bug.cgi?id=30575
    12891267fast/dom/elementFromPoint-relative-to-viewport.html
    1290 
    1291 # DnD failures https://bugs.webkit.org/show_bug.cgi?id=30576
    1292 editing/pasteboard/drop-inputtext-acquires-style.html
    1293 fast/events/drag-and-drop-dataTransfer-types-nocrash.html
    1294 fast/events/drag-and-drop-fire-drag-dragover.html
    1295 fast/events/drag-and-drop.html
    1296 fast/events/drag-parent-node.html
    1297 fast/dom/Window/window-postmessage-clone.html
    1298 http/tests/misc/bubble-drag-events.html
    12991268
    13001269#   Tests generating new results
     
    20352004fast/events/onloadFrameCrash.html
    20362005fast/events/reveal-link-when-focused.html
    2037 fast/events/standalone-image-drag-to-editable.html
    20382006fast/events/updateLayoutForHitTest.html
    20392007fast/flexbox/001.html
     
    21442112fast/forms/input-text-click-outside.html
    21452113fast/forms/input-text-double-click.html
    2146 fast/forms/input-text-drag-down.html
    21472114fast/forms/input-text-maxlength.html
    21482115fast/forms/input-text-option-delete.html
     
    23872354fast/lists/big-list-marker.html
    23882355fast/lists/decimal-leading-zero.html
    2389 fast/lists/drag-into-marker.html
    23902356fast/lists/dynamic-marker-crash.html
    23912357fast/lists/inlineBoxWrapperNullCheck.html
     
    31903156http/tests/loading/slow-parsing-subframe.html
    31913157http/tests/loading/text-content-type-with-binary-extension.html
    3192 http/tests/local/send-dragged-file.html
    3193 http/tests/local/send-sliced-dragged-file.html
    31943158http/tests/local/blob/send-hybrid-blob.html
    31953159http/tests/local/blob/send-sliced-data-blob.html
     
    32143178http/tests/security/credentials-in-referer.html
    32153179http/tests/security/cross-frame-access-put.html
    3216 http/tests/security/dataTransfer-set-data-file-url.html
    32173180http/tests/security/feed-urls-from-remote.html
    32183181http/tests/security/local-video-source-from-remote.html
     
    50685031# Tests that failed because we don't have an eventSender implementation
    50695032editing/input/scroll-viewport-page-up-down.html
    5070 editing/pasteboard/dataTransfer-setData-getData.html
    5071 editing/pasteboard/files-during-page-drags.html
    5072 fast/events/drag-to-navigate.html
    5073 fast/events/ondrop-text-html.html
    50745033fast/events/popup-when-select-change.html
    5075 fast/events/prevent-drag-to-navigate.html
    50765034fast/events/tab-focus-anchor.html
    5077 http/tests/local/drag-over-remote-content.html
    50785035http/tests/misc/slow-loading-mask.html
    50795036http/tests/plugins/plugin-document-has-focus.html
    5080 http/tests/security/drag-over-remote-content-iframe.html
    5081 http/tests/security/clipboard/clipboard-file-access.html
    50825037
    50835038# Tests that require editing callbacks (and possibly Glib DOM bindings)
     
    55025457
    55035458editing/deleting/non-smart-delete.html
    5504 editing/pasteboard/smart-drag-drop.html
    55055459fast/repaint/no-caret-repaint-in-non-content-editable-element.html
    55065460fast/runin/generated2.html
     
    58765830# different DOM to be created.
    58775831html5lib/runner.html
     5832
     5833#Tests failing because beginDragWithFiles is unimplemented
     5834editing/pasteboard/file-drag-to-editable.html
     5835http/tests/local/send-dragged-file.html
     5836http/tests/local/send-sliced-dragged-file.html
     5837editing/pasteboard/files-during-page-drags.html
     5838fast/events/drag-to-navigate.html
     5839fast/events/prevent-drag-to-navigate.html
     5840fast/dom/Window/window-postmessage-clone.html
     5841http/tests/security/clipboard/clipboard-file-access.html
     5842
     5843# Tests that fail because image dragging does not yet work
     5844editing/pasteboard/drag-image-in-about-blank-frame.html
     5845editing/pasteboard/drag-image-to-contenteditable-in-iframe.html
     5846editing/pasteboard/drag-selected-image-to-contenteditable.html
     5847editing/selection/drag-to-contenteditable-iframe.html
     5848fast/events/standalone-image-drag-to-editable.html
     5849editing/pasteboard/drag-drop-iframe-refresh-crash.html
     5850fast/css/user-drag-none.html
     5851
     5852# Tests that fail because they assume a certain number of mouse
     5853# movements during drags or fail only in Xvfb
     5854http/tests/local/drag-over-remote-content.html
     5855http/tests/security/drag-over-remote-content-iframe.html
     5856fast/events/drag-in-frames.html
     5857http/tests/misc/bubble-drag-events.html
     5858fast/events/content-changed-during-drop.html
     5859
     5860# Tests that seem to be Mac only, assume that smart drag-and-drop
     5861# is enabled or assume platform-dependent sizing.
     5862http/tests/security/dataTransfer-set-data-file-url.html
     5863fast/events/ondragenter.html
     5864editing/pasteboard/smart-drag-drop.html
     5865editing/selection/drag-start-event-client-x-y.html
     5866
     5867# Tests that require editing delegate dumps.
     5868editing/pasteboard/drop-link.html
     5869media
     5870http/tests/media
  • trunk/WebKitTools/ChangeLog

    r64072 r64082  
     12010-07-26  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Gustavo Noronha Silva.
     4
     5        [GTK] The EventSender should support simulating drop events
     6        https://bugs.webkit.org/show_bug.cgi?id=39844
     7
     8        Add initial dropping support to the GTK+ EventSender.
     9
     10        * DumpRenderTree/gtk/DumpRenderTree.cpp:
     11        (createWebView): Listen for some new drag-and-drop signals.
     12        * DumpRenderTree/gtk/EventSender.cpp: Add currentDragSourceContext.
     13        (dispatchEvent):
     14        Detect situations where a drag is either starting or ending and massage
     15        GTK+ into sending the appropriate signals to the WebView.
     16        (replaySavedEvents): Remove comment.
     17        (makeEventSender): Clear the currentDragSourceContext when creating a new EventSender.
     18        (dragBeginCallback): Capture the new currentDragSourceContext when a drag begins.
     19        (dragEndCallback): Clear the currentDragSourceContext when a drag ends.
     20        (dragFailedCallback): Disable the GTK+ drag failed animation.
     21        * DumpRenderTree/gtk/EventSender.h: Add declarations for new signal callbacks.
     22
    1232010-07-26  Daniel Bates  <dbates@rim.com>
    224
  • trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp

    r63536 r64082  
    887887                     "signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
    888888                     "signal::onload-event", webViewOnloadEvent, 0,
     889                     "signal::drag-begin", dragBeginCallback, 0,
     890                     "signal::drag-end", dragEndCallback, 0,
     891                     "signal::drag-failed", dragFailedCallback, 0,
     892
    889893                     NULL);
    890894
  • trunk/WebKitTools/DumpRenderTree/gtk/EventSender.cpp

    r62002 r64082  
    4646#include <string.h>
    4747
    48 // FIXME: Implement support for synthesizing drop events.
    49 
    5048extern "C" {
    5149    extern void webkit_web_frame_layout(WebKitWebFrame* frame);
     
    6361static int buttonCurrentlyDown;
    6462static int clickCount;
     63GdkDragContext* currentDragSourceContext;
    6564
    6665struct DelayedMessage {
     
    360359
    361360    gtk_main_do_event(&event);
     361
     362    if (!currentDragSourceContext)
     363        return;
     364
     365    if (event.type == GDK_MOTION_NOTIFY) {
     366        // WebKit has called gtk_drag_start(), but because the main loop isn't
     367        // running GDK internals don't know that the drag has started yet. Pump
     368        // the main loop a little bit so that GDK is in the correct state.
     369        while (gtk_events_pending())
     370            gtk_main_iteration();
     371
     372        // Simulate a drag motion on the top-level GDK window.
     373        GtkWidget* parentWidget = gtk_widget_get_parent(GTK_WIDGET(view));
     374        GdkWindow* parentWidgetWindow = parentWidget->window;
     375        gdk_drag_motion(currentDragSourceContext, parentWidgetWindow, GDK_DRAG_PROTO_XDND,
     376            event.motion.x_root, event.motion.y_root,
     377            currentDragSourceContext->action, currentDragSourceContext->actions, GDK_CURRENT_TIME);
     378
     379    } else if (currentDragSourceContext && event.type == GDK_BUTTON_RELEASE) {
     380        // We've released the mouse button, we should just be able to spin the
     381        // event loop here and have GTK+ send the appropriate notifications for
     382        // the end of the drag.
     383        while (gtk_events_pending())
     384            gtk_main_iteration();
     385    }
     386
    362387}
    363388
    364389void replaySavedEvents()
    365390{
    366     // FIXME: Eventually we may need to have more sophisticated logic to
    367     // track drag-and-drop operations.
    368 
    369391    // First send all the events that are ready to be sent
    370392    while (startOfQueue < endOfQueue) {
     
    632654        endOfQueue = 0;
    633655        startOfQueue = 0;
     656
     657        currentDragSourceContext = 0;
    634658    }
    635659
    636660    return JSObjectMake(context, getClass(context), 0);
    637661}
     662
     663void dragBeginCallback(GtkWidget*, GdkDragContext* context, gpointer)
     664{
     665    currentDragSourceContext = context;
     666}
     667
     668void dragEndCallback(GtkWidget*, GdkDragContext* context, gpointer)
     669{
     670    currentDragSourceContext = 0;
     671}
     672
     673gboolean dragFailedCallback(GtkWidget*, GdkDragContext* context, gpointer)
     674{
     675    // Return TRUE here to disable the stupid GTK+ drag failed animation,
     676    // which introduces asynchronous behavior into our drags.
     677    return TRUE;
     678}
  • trunk/WebKitTools/DumpRenderTree/gtk/EventSender.h

    r60478 r64082  
    3333typedef const struct OpaqueJSContext* JSContextRef;
    3434typedef struct OpaqueJSValue* JSObjectRef;
     35typedef struct _GtkWidget GtkWidget;
     36typedef struct _GdkDragContext GdkDragContext;
     37typedef void* gpointer;
     38typedef int gboolean;
    3539
    3640JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame);
    3741void replaySavedEvents();
     42void dragBeginCallback(GtkWidget*, GdkDragContext*, gpointer);
     43void dragEndCallback(GtkWidget*, GdkDragContext*, gpointer);
     44gboolean dragFailedCallback(GtkWidget*, GdkDragContext*, gpointer);
    3845
    3946#endif
Note: See TracChangeset for help on using the changeset viewer.