[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mrobinson at webkit.org mrobinson at webkit.org
Wed Dec 22 11:28:42 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c83bbfa6b10156aae3addbb62d9f0ddcb6d790fe
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 26 22:34:49 2010 +0000

    2010-07-26  Martin Robinson  <mrobinson at 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 at 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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64082 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e03db9d..e89dbc8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2010-07-26  Martin Robinson  <mrobinson at 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  Victor Wang  <victorw at chromium.org>
 
         Unreviewed. Update chromium test expectations for flaky test on linux:
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index b129314..3e4c079 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -629,13 +629,8 @@ editing/inserting/space-after-removeformat.html
 editing/pasteboard/4744008.html
 editing/pasteboard/5368833.html
 editing/pasteboard/5780697-2.html
-editing/pasteboard/drag-drop-input-textarea.html
-editing/pasteboard/drag-drop-url-text.html
 editing/pasteboard/copy-in-password-field.html
-editing/pasteboard/drag-image-in-about-blank-frame.html
-editing/pasteboard/file-drag-to-editable.html
 editing/pasteboard/file-input-files-access.html
-editing/pasteboard/get-data-text-plain-drop.html
 editing/pasteboard/paste-into-anchor-text.html
 editing/pasteboard/paste-plaintext-user-select-none.html
 editing/pasteboard/paste-table-002.html
@@ -648,8 +643,6 @@ editing/selection/click-before-and-after-table.html
 editing/selection/click-in-margins-inside-editable-div.html
 editing/selection/click-in-padding-with-multiple-line-boxes.html
 editing/selection/doubleclick-whitespace.html
-editing/selection/drag-start-event-client-x-y.html
-editing/selection/drag-text-delay.html
 editing/selection/extend-selection-bidi.html
 editing/selection/getRangeAt.html
 # home-end.html and extended-selection.html have some potential breakage, commenting for now: https://bugs.webkit.org/show_bug.cgi?id=30208
@@ -855,12 +848,6 @@ editing/pasteboard/copy-standalone-image.html
 editing/pasteboard/displaced-generic-placeholder.html
 editing/pasteboard/displaced-placeholder.html
 editing/pasteboard/display-block-on-spans.html
-editing/pasteboard/drag-drop-dead-frame.html
-editing/pasteboard/drag-drop-modifies-page.html
-editing/pasteboard/drag-image-to-contenteditable-in-iframe.html
-editing/pasteboard/drag-selected-image-to-contenteditable.html
-editing/pasteboard/drop-link.html
-editing/pasteboard/drop-text-without-selection.html
 editing/pasteboard/emacs-cntl-y-001.html
 editing/pasteboard/emacs-ctrl-a-k-y.html
 editing/pasteboard/emacs-ctrl-k-y-001.html
@@ -932,7 +919,6 @@ editing/pasteboard/smart-paste-006.html
 editing/pasteboard/smart-paste-007.html
 editing/pasteboard/smart-paste-008.html
 editing/pasteboard/styled-element-markup.html
-editing/pasteboard/subframe-dragndrop-1.html
 editing/pasteboard/testcase-9507.html
 editing/pasteboard/undoable-fragment-removes.html
 editing/pasteboard/unrendered-br.html
@@ -968,8 +954,6 @@ editing/selection/contenteditable-click-inside.html
 editing/selection/designmode-no-caret.html
 editing/selection/display-table-text.html
 editing/selection/doubleclick-crash.html
-editing/selection/drag-select-1.html
-editing/selection/drag-to-contenteditable-iframe.html
 editing/selection/editable-html-element.html
 editing/selection/editable-links.html
 editing/selection/editable-non-editable-crash.html
@@ -1155,9 +1139,6 @@ fast/events/autoscroll-in-textfield.html
 fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html
 fast/events/autoscroll-with-non-scrollable-parent.html
 fast/events/blur-focus-window-should-blur-focus-element.html
-fast/events/content-changed-during-drop.html
-fast/events/crash-on-mutate-during-drop.html
-fast/events/drag-in-frames.html
 fast/events/frame-tab-focus.html
 fast/events/js-keyboard-event-creation.html
 fast/events/mouseup-from-button2.html
@@ -1165,7 +1146,6 @@ fast/events/offsetX-offsetY.html
 fast/events/onchange-passwordfield.html
 fast/events/onchange-searchfield.html
 fast/events/onchange-textfield.html
-fast/events/ondragenter.html
 fast/events/onsearch-enter.html
 fast/events/onunload-clears-onbeforeunload.html
 fast/events/onunload-not-on-body.html
@@ -1180,8 +1160,6 @@ fast/events/stop-load-in-unload-handler-using-window-stop.html
 fast/events/tabindex-focus-blur-all.html
 fast/events/tabindex-focus-chain.html
 fast/forms/button-state-restore.html
-fast/forms/drag-into-textarea.html
-fast/forms/drag-out-of-textarea.html
 fast/forms/focus2.html
 fast/forms/focus-control-to-page.html
 fast/forms/focus-selection-input.html
@@ -1288,15 +1266,6 @@ svg/custom/getPresentationAttribute-modify.svg
 # Possible bug in eventSender.zoomPageOut() ? https://bugs.webkit.org/show_bug.cgi?id=30575
 fast/dom/elementFromPoint-relative-to-viewport.html
 
-# DnD failures https://bugs.webkit.org/show_bug.cgi?id=30576
-editing/pasteboard/drop-inputtext-acquires-style.html
-fast/events/drag-and-drop-dataTransfer-types-nocrash.html
-fast/events/drag-and-drop-fire-drag-dragover.html
-fast/events/drag-and-drop.html
-fast/events/drag-parent-node.html
-fast/dom/Window/window-postmessage-clone.html
-http/tests/misc/bubble-drag-events.html
-
 #   Tests generating new results
 fast/block/basic/001.html
 fast/block/basic/002.html
@@ -2034,7 +2003,6 @@ fast/events/label-focus.html
 fast/events/onload-re-entry.html
 fast/events/onloadFrameCrash.html
 fast/events/reveal-link-when-focused.html
-fast/events/standalone-image-drag-to-editable.html
 fast/events/updateLayoutForHitTest.html
 fast/flexbox/001.html
 fast/flexbox/002.html
@@ -2143,7 +2111,6 @@ fast/forms/input-table.html
 fast/forms/input-text-click-inside.html
 fast/forms/input-text-click-outside.html
 fast/forms/input-text-double-click.html
-fast/forms/input-text-drag-down.html
 fast/forms/input-text-maxlength.html
 fast/forms/input-text-option-delete.html
 fast/forms/input-text-paste-maxlength.html
@@ -2386,7 +2353,6 @@ fast/lists/alpha-list-wrap.html
 fast/lists/anonymous-items.html
 fast/lists/big-list-marker.html
 fast/lists/decimal-leading-zero.html
-fast/lists/drag-into-marker.html
 fast/lists/dynamic-marker-crash.html
 fast/lists/inlineBoxWrapperNullCheck.html
 fast/lists/item-not-in-list-line-wrapping.html
@@ -3189,8 +3155,6 @@ http/tests/loading/preload-img-test.html
 http/tests/loading/redirect-with-no-location-crash.html
 http/tests/loading/slow-parsing-subframe.html
 http/tests/loading/text-content-type-with-binary-extension.html
-http/tests/local/send-dragged-file.html
-http/tests/local/send-sliced-dragged-file.html
 http/tests/local/blob/send-hybrid-blob.html
 http/tests/local/blob/send-sliced-data-blob.html
 http/tests/local/formdata/send-form-data.html
@@ -3213,7 +3177,6 @@ http/tests/plugins/npapi-response-headers.html
 http/tests/plugins/post-url-file.html
 http/tests/security/credentials-in-referer.html
 http/tests/security/cross-frame-access-put.html
-http/tests/security/dataTransfer-set-data-file-url.html
 http/tests/security/feed-urls-from-remote.html
 http/tests/security/local-video-source-from-remote.html
 http/tests/security/mixedContent/about-blank-iframe-in-main-frame.html
@@ -5067,18 +5030,10 @@ webarchive/test-xml-stylesheet.xml
 
 # Tests that failed because we don't have an eventSender implementation
 editing/input/scroll-viewport-page-up-down.html
-editing/pasteboard/dataTransfer-setData-getData.html
-editing/pasteboard/files-during-page-drags.html
-fast/events/drag-to-navigate.html
-fast/events/ondrop-text-html.html
 fast/events/popup-when-select-change.html
-fast/events/prevent-drag-to-navigate.html
 fast/events/tab-focus-anchor.html
-http/tests/local/drag-over-remote-content.html
 http/tests/misc/slow-loading-mask.html
 http/tests/plugins/plugin-document-has-focus.html
-http/tests/security/drag-over-remote-content-iframe.html
-http/tests/security/clipboard/clipboard-file-access.html
 
 # Tests that require editing callbacks (and possibly Glib DOM bindings)
 editing/text-iterator/thai-cursor-movement.html
@@ -5501,7 +5456,6 @@ editing/selection/extend-after-mouse-selection.html
 fast/parser/xml-declaration-missing-ending-mark.html
 
 editing/deleting/non-smart-delete.html
-editing/pasteboard/smart-drag-drop.html
 fast/repaint/no-caret-repaint-in-non-content-editable-element.html
 fast/runin/generated2.html
 fast/runin/generated3.html
@@ -5875,3 +5829,42 @@ http/tests/xmlhttprequest/remember-bad-password.html
 # There's somethign strange going on with <keygen> that causes a
 # different DOM to be created.
 html5lib/runner.html
+
+#Tests failing because beginDragWithFiles is unimplemented
+editing/pasteboard/file-drag-to-editable.html
+http/tests/local/send-dragged-file.html
+http/tests/local/send-sliced-dragged-file.html
+editing/pasteboard/files-during-page-drags.html
+fast/events/drag-to-navigate.html
+fast/events/prevent-drag-to-navigate.html
+fast/dom/Window/window-postmessage-clone.html
+http/tests/security/clipboard/clipboard-file-access.html
+
+# Tests that fail because image dragging does not yet work
+editing/pasteboard/drag-image-in-about-blank-frame.html
+editing/pasteboard/drag-image-to-contenteditable-in-iframe.html
+editing/pasteboard/drag-selected-image-to-contenteditable.html
+editing/selection/drag-to-contenteditable-iframe.html
+fast/events/standalone-image-drag-to-editable.html
+editing/pasteboard/drag-drop-iframe-refresh-crash.html
+fast/css/user-drag-none.html
+
+# Tests that fail because they assume a certain number of mouse
+# movements during drags or fail only in Xvfb
+http/tests/local/drag-over-remote-content.html
+http/tests/security/drag-over-remote-content-iframe.html
+fast/events/drag-in-frames.html
+http/tests/misc/bubble-drag-events.html
+fast/events/content-changed-during-drop.html
+
+# Tests that seem to be Mac only, assume that smart drag-and-drop
+# is enabled or assume platform-dependent sizing.
+http/tests/security/dataTransfer-set-data-file-url.html
+fast/events/ondragenter.html
+editing/pasteboard/smart-drag-drop.html
+editing/selection/drag-start-event-client-x-y.html
+
+# Tests that require editing delegate dumps.
+editing/pasteboard/drop-link.html
+media
+http/tests/media
diff --git a/LayoutTests/platform/gtk/editing/pasteboard/dataTransfer-setData-getData-expected.txt b/LayoutTests/platform/gtk/editing/pasteboard/dataTransfer-setData-getData-expected.txt
new file mode 100644
index 0000000..9bd5cec
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/pasteboard/dataTransfer-setData-getData-expected.txt
@@ -0,0 +1,35 @@
+Tests correct behavior of event.dataTransfer.setData/getData for 'URL', 'text/uri-list' and 'text/plain'
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+--- Test set/get 'URL':
+PASS getDataResultType is "string"
+PASS getDataLines.length is 1
+PASS getDataLines[0].replace(/\/$/, '') is "http://test.com"
+--- Test set/get 'text/uri-list':
+PASS getDataResultType is "string"
+PASS getDataLines.length is 2
+PASS getDataLines[0].replace(/\/$/, '') is "http://test.com"
+PASS getDataLines[1].replace(/\/$/, '') is "http://check.com"
+--- Test set 'text/uri-list', get 'URL':
+PASS getDataResultType is "string"
+PASS getDataLines.length is 1
+PASS getDataLines[0].replace(/\/$/, '') is "http://test.com"
+--- Test set 'text/uri-list', get 'URL', using only '\n':
+PASS getDataResultType is "string"
+PASS getDataLines.length is 1
+PASS getDataLines[0].replace(/\/$/, '') is "http://test.com"
+--- Test set/get 'text/uri-list' with comments:
+PASS getDataResultType is "string"
+PASS getDataLines.length is 2
+PASS getDataLines[0].replace(/\/$/, '') is "http://test.com"
+PASS getDataLines[1].replace(/\/$/, '') is "http://check.com"
+--- Test set/get 'text/plain':
+PASS getDataResultType is "string"
+PASS getDataLines.length is 1
+PASS getDataLines[0].replace(/\/$/, '') is "Lorem ipsum dolor sit amet."
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-dead-frame-expected.txt b/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-dead-frame-expected.txt
new file mode 100644
index 0000000..6e86696
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-dead-frame-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x20
+        RenderText {#text} at (0,0) size 616x20
+          text run at (0,0) width 616: "Check you don't crash when your previous drag target frame is deleted <rdar://problem/5049842>"
+      RenderBlock {DIV} at (0,36) size 784x20
+        RenderInline {SPAN} at (0,0) size 31x20
+          RenderText {#text} at (0,0) size 31x20
+            text run at (0,0) width 31: "hello"
+      RenderBlock (anonymous) at (0,56) size 784x0
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+selection start: position 0 of child 0 {#text} of child 0 {SPAN} of child 3 {DIV} of body
+selection end:   position 5 of child 0 {#text} of child 0 {SPAN} of child 3 {DIV} of body
diff --git a/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt b/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt
new file mode 100644
index 0000000..0dea382
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/pasteboard/drag-drop-modifies-page-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x40
+        RenderText {#text} at (0,0) size 719x40
+          text run at (0,0) width 719: "This tests non-smartmove drag/drop. The space should be deleted on move, but not reinserted on drop, resulting in"
+          text run at (0,20) width 86: "\"worldhello\"."
+      RenderBlock {DIV} at (0,56) size 784x20
+        RenderText {#text} at (0,0) size 41x20
+          text run at (0,0) width 41: " world"
+        RenderText {#text} at (41,0) size 31x20
+          text run at (41,0) width 31: "hello"
+selection start: position 0 of child 1 {#text} of child 3 {DIV} of body
+selection end:   position 5 of child 1 {#text} of child 3 {DIV} of body
diff --git a/LayoutTests/platform/gtk/editing/pasteboard/drop-text-without-selection-expected.txt b/LayoutTests/platform/gtk/editing/pasteboard/drop-text-without-selection-expected.txt
new file mode 100644
index 0000000..4b2a31d
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/pasteboard/drop-text-without-selection-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x40
+        RenderText {#text} at (0,0) size 104x20
+          text run at (0,0) width 104: "This is a test for "
+        RenderInline {I} at (0,0) size 751x40
+          RenderInline {A} at (0,0) size 348x20 [color=#0000EE]
+            RenderText {#text} at (104,0) size 348x20
+              text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8394"
+          RenderText {#text} at (452,0) size 751x40
+            text run at (452,0) width 4: " "
+            text run at (456,0) width 295: "Editable region does not accept dropped text if"
+            text run at (0,20) width 125: "there is no selection"
+        RenderText {#text} at (125,20) size 4x20
+          text run at (125,20) width 4: "."
+      RenderBlock {P} at (0,56) size 784x20
+        RenderText {#text} at (0,0) size 653x20
+          text run at (0,0) width 478: "The text field should accept drag-and-dropped text, such as the link, even if "
+          text run at (478,0) width 175: "no text is currently selected."
+      RenderBlock {HR} at (0,92) size 784x2 [border: (1px inset #000000)]
+      RenderBlock (anonymous) at (0,102) size 784x30
+        RenderTextControl {INPUT} at (2,2) size 168x26 [bgcolor=#FFFFFF]
+        RenderText {#text} at (172,5) size 4x20
+          text run at (172,5) width 4: " "
+        RenderInline {A} at (0,0) size 162x20 [color=#0000EE]
+          RenderText {#text} at (176,5) size 162x20
+            text run at (176,5) width 162: "drop me into the text field"
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+layer at (13,115) size 162x20
+  RenderBlock {DIV} at (3,3) size 162x20
+    RenderText {#text} at (1,0) size 135x20
+      text run at (1,0) width 135: "http://www.ibm.com/"
+selection start: position 0 of child 0 {#text} of child 0 {DIV} of child 7 {INPUT} of body
+selection end:   position 19 of child 0 {#text} of child 0 {DIV} of child 7 {INPUT} of body
diff --git a/LayoutTests/platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt b/LayoutTests/platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt
new file mode 100644
index 0000000..9c3385e
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/pasteboard/subframe-dragndrop-1-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x584
+      RenderBlock (anonymous) at (0,0) size 800x304
+        RenderPartObject {IFRAME} at (0,0) size 304x304 [border: (2px inset #000000)]
+          layer at (0,0) size 300x300
+            RenderView at (0,0) size 300x300
+          layer at (0,0) size 300x300
+            RenderBlock {HTML} at (0,0) size 300x300
+              RenderBody {BODY} at (8,8) size 284x284 [bgcolor=#FFFFE0]
+                RenderText {#text} at (0,0) size 51x20
+                  text run at (0,0) width 51: "foo  baz"
+                RenderText {#text} at (51,0) size 20x20
+                  text run at (51,0) width 20: "bar"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,320) size 800x40
+        RenderText {#text} at (0,0) size 795x40
+          text run at (0,0) width 795: "This test uses the eventSender to do drag and drop. To run it manually, drag the word selected in the above subframe and drop"
+          text run at (0,20) width 80: "it after 'baz'. "
+          text run at (80,20) width 213: "The result should be 'foo baz bar'."
diff --git a/LayoutTests/platform/gtk/editing/selection/drag-select-1-expected.txt b/LayoutTests/platform/gtk/editing/selection/drag-select-1-expected.txt
new file mode 100644
index 0000000..40a01d5
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/selection/drag-select-1-expected.txt
@@ -0,0 +1,21 @@
+ALERT: 0.1724137931034483
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {P} at (0,0) size 784x20
+        RenderText {#text} at (0,0) size 216x20
+          text run at (0,0) width 216: "This tests for a drag select crasher."
+      RenderBlock {DIV} at (0,36) size 784x30
+        RenderInline {SPAN} at (0,0) size 64x20
+          RenderText {#text} at (0,5) size 64x20
+            text run at (0,5) width 64: "Start here."
+        RenderText {#text} at (64,5) size 4x20
+          text run at (64,5) width 4: " "
+        RenderTextControl {INPUT} at (70,2) size 168x26 [bgcolor=#FFFFFF]
+      RenderBlock {UL} at (0,82) size 784x0
+layer at (81,49) size 162x20
+  RenderBlock {DIV} at (3,3) size 162x20
+selection start: position 5 of child 0 {#text} of child 0 {SPAN} of child 2 {DIV} of body
+selection end:   position 1 of child 1 {#text} of child 2 {DIV} of body
diff --git a/LayoutTests/platform/gtk/editing/selection/drag-text-delay-expected.txt b/LayoutTests/platform/gtk/editing/selection/drag-text-delay-expected.txt
new file mode 100644
index 0000000..6085c4f
--- /dev/null
+++ b/LayoutTests/platform/gtk/editing/selection/drag-text-delay-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderTextControl {INPUT} at (2,2) size 168x26 [bgcolor=#FFFFFF]
+      RenderText {#text} at (0,0) size 0x0
+layer at (13,13) size 162x20
+  RenderBlock {DIV} at (3,3) size 162x20
+    RenderText {#text} at (1,0) size 72x20
+      text run at (1,0) width 72: " worldhello"
+selection start: position 6 of child 0 {#text} of child 0 {DIV} of child 1 {INPUT} of body
+selection end:   position 11 of child 0 {#text} of child 0 {DIV} of child 1 {INPUT} of body
diff --git a/LayoutTests/platform/gtk/fast/events/bogus-dropEffect-effectAllowed-expected.txt b/LayoutTests/platform/gtk/fast/events/bogus-dropEffect-effectAllowed-expected.txt
deleted file mode 100644
index 929073b..0000000
--- a/LayoutTests/platform/gtk/fast/events/bogus-dropEffect-effectAllowed-expected.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-This test checks that effectAllowed and dropEffect cannot be set to values that aren't defined in the spec
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS event.dataTransfer.effectAllowed is "all"
-PASS event.dataTransfer.effectAllowed is "copy"
-PASS event.dataTransfer.effectAllowed is "copy"
-PASS event.dataTransfer.effectAllowed is "copyLink"
-PASS event.dataTransfer.effectAllowed is "copyLink"
-PASS event.dataTransfer.effectAllowed is "copyMove"
-PASS event.dataTransfer.effectAllowed is "copyMove"
-PASS event.dataTransfer.effectAllowed is "link"
-PASS event.dataTransfer.effectAllowed is "linkMove"
-PASS event.dataTransfer.effectAllowed is "move"
-PASS event.dataTransfer.effectAllowed is "none"
-PASS event.dataTransfer.effectAllowed is "uninitialized"
-PASS event.dataTransfer.effectAllowed is "uninitialized"
-PASS event.dataTransfer.effectAllowed is "uninitialized"
-PASS event.dataTransfer.effectAllowed is "uninitialized"
-PASS event.dataTransfer.effectAllowed is "uninitialized"
-
-TEST COMPLETE
-
diff --git a/LayoutTests/platform/gtk/fast/forms/input-text-drag-down-expected.txt b/LayoutTests/platform/gtk/fast/forms/input-text-drag-down-expected.txt
new file mode 100644
index 0000000..3c60075
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/forms/input-text-drag-down-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock (anonymous) at (0,0) size 784x30
+        RenderTextControl {INPUT} at (2,2) size 168x26 [bgcolor=#FFFFFF]
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {P} at (0,46) size 784x20
+        RenderText {#text} at (0,0) size 732x20
+          text run at (0,0) width 732: "Tests drag-selecting down. If the test succeeds, the text from the center to the end of the text field should be selected."
+layer at (13,13) size 162x20
+  RenderBlock {DIV} at (3,3) size 162x20
+    RenderText {#text} at (1,0) size 144x20
+      text run at (1,0) width 144: "This is a bunch of text."
+selection start: position 5 of child 0 {#text} of child 0 {DIV} of child 0 {INPUT} of body
+selection end:   position 24 of child 0 {#text} of child 0 {DIV} of child 0 {INPUT} of body
diff --git a/LayoutTests/platform/gtk/fast/lists/drag-into-marker-expected.txt b/LayoutTests/platform/gtk/fast/lists/drag-into-marker-expected.txt
new file mode 100644
index 0000000..34c21e1
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/lists/drag-into-marker-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,16) size 784x568
+      RenderBlock {UL} at (16,0) size 752x61 [border: (1px solid #000000)]
+        RenderListItem {LI} at (41,1) size 710x59
+          RenderListMarker at (-38,0) size 17x59: black square
+          RenderText {#text} at (0,0) size 112x59
+            text run at (0,0) width 112: "world"
+          RenderText {#text} at (112,0) size 107x59
+            text run at (112,0) width 95: "hello"
+            text run at (207,0) width 12: " "
+      RenderBlock {P} at (0,77) size 784x80
+        RenderText {#text} at (0,0) size 768x80
+          text run at (0,0) width 562: "This is an automated test for elementAtPoint for points over position:outside list markers. "
+          text run at (562,0) width 168: "The dictionary returned by"
+          text run at (730,0) width 4: " "
+          text run at (0,20) width 743: "elementAtPoint should contain the list item as the DOMNode, not the list, for points over position:outside list markers."
+          text run at (0,40) width 743: "elementAtPoint is used to determine the drag operation that will occur when something is dropped over a given point. "
+          text run at (743,40) width 21: "So,"
+          text run at (764,40) width 4: " "
+          text run at (0,60) width 371: "this test drags a bit of text over the list marker and drops it. "
+          text run at (371,60) width 386: "It should be pasted into the list item, which is contenteditable."
+selection start: position 0 of child 0 {#text} of child 0 {LI} of child 1 {UL} of body
+selection end:   position 5 of child 0 {#text} of child 0 {LI} of child 1 {UL} of body
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 4142f3b..2c06677 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,25 @@
+2010-07-26  Martin Robinson  <mrobinson at 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.
+
 2010-07-26  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index 2812224..bd9c0c9 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -886,6 +886,10 @@ static WebKitWebView* createWebView()
                      "signal::document-load-finished", webViewDocumentLoadFinished, 0,
                      "signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
                      "signal::onload-event", webViewOnloadEvent, 0,
+                     "signal::drag-begin", dragBeginCallback, 0,
+                     "signal::drag-end", dragEndCallback, 0,
+                     "signal::drag-failed", dragFailedCallback, 0,
+
                      NULL);
 
     g_signal_connect(view,
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index 4936fe5..b95fec2 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -45,8 +45,6 @@
 #include <gdk/gdkkeysyms.h>
 #include <string.h>
 
-// FIXME: Implement support for synthesizing drop events.
-
 extern "C" {
     extern void webkit_web_frame_layout(WebKitWebFrame* frame);
 }
@@ -62,6 +60,7 @@ static int lastClickTimeOffset;
 static int lastClickButton;
 static int buttonCurrentlyDown;
 static int clickCount;
+GdkDragContext* currentDragSourceContext;
 
 struct DelayedMessage {
     GdkEvent event;
@@ -359,13 +358,36 @@ static void dispatchEvent(GdkEvent event)
         return;
 
     gtk_main_do_event(&event);
+
+    if (!currentDragSourceContext)
+        return;
+
+    if (event.type == GDK_MOTION_NOTIFY) {
+        // WebKit has called gtk_drag_start(), but because the main loop isn't
+        // running GDK internals don't know that the drag has started yet. Pump
+        // the main loop a little bit so that GDK is in the correct state.
+        while (gtk_events_pending())
+            gtk_main_iteration();
+
+        // Simulate a drag motion on the top-level GDK window.
+        GtkWidget* parentWidget = gtk_widget_get_parent(GTK_WIDGET(view));
+        GdkWindow* parentWidgetWindow = parentWidget->window;
+        gdk_drag_motion(currentDragSourceContext, parentWidgetWindow, GDK_DRAG_PROTO_XDND,
+            event.motion.x_root, event.motion.y_root,
+            currentDragSourceContext->action, currentDragSourceContext->actions, GDK_CURRENT_TIME);
+
+    } else if (currentDragSourceContext && event.type == GDK_BUTTON_RELEASE) {
+        // We've released the mouse button, we should just be able to spin the
+        // event loop here and have GTK+ send the appropriate notifications for
+        // the end of the drag.
+        while (gtk_events_pending())
+            gtk_main_iteration();
+    }
+
 }
 
 void replaySavedEvents()
 {
-    // FIXME: Eventually we may need to have more sophisticated logic to
-    // track drag-and-drop operations.
-
     // First send all the events that are ready to be sent
     while (startOfQueue < endOfQueue) {
         if (msgQueue[startOfQueue].delay) {
@@ -631,7 +653,26 @@ JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame)
 
         endOfQueue = 0;
         startOfQueue = 0;
+
+        currentDragSourceContext = 0;
     }
 
     return JSObjectMake(context, getClass(context), 0);
 }
+
+void dragBeginCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+    currentDragSourceContext = context;
+}
+
+void dragEndCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+    currentDragSourceContext = 0;
+}
+
+gboolean dragFailedCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+    // Return TRUE here to disable the stupid GTK+ drag failed animation,
+    // which introduces asynchronous behavior into our drags.
+    return TRUE;
+}
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.h b/WebKitTools/DumpRenderTree/gtk/EventSender.h
index ce33ccc..e9b758d 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.h
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.h
@@ -32,8 +32,15 @@
 
 typedef const struct OpaqueJSContext* JSContextRef;
 typedef struct OpaqueJSValue* JSObjectRef;
+typedef struct _GtkWidget GtkWidget;
+typedef struct _GdkDragContext GdkDragContext;
+typedef void* gpointer;
+typedef int gboolean;
 
 JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame);
 void replaySavedEvents();
+void dragBeginCallback(GtkWidget*, GdkDragContext*, gpointer);
+void dragEndCallback(GtkWidget*, GdkDragContext*, gpointer);
+gboolean dragFailedCallback(GtkWidget*, GdkDragContext*, gpointer);
 
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list