2011-03-31 Darin Adler <darin@apple.com>
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Mar 2011 22:09:32 +0000 (22:09 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Mar 2011 22:09:32 +0000 (22:09 +0000)
        Reviewed by Sam Weinig.

        Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=57573

        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
        (WKBundlePageSimulateMouseDown): Added.
        (WKBundlePageSimulateMouseUp): Added.
        (WKBundlePageSimulateMouseMotion): Added.
        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Added above functions.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::simulateMouseDown): Added.
        (WebKit::WebPage::simulateMouseUp): Added.
        (WebKit::WebPage::simulateMouseMotion): Added.
        * WebProcess/WebPage/WebPage.h: Added above functions.
2011-03-31  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=57573

        * platform/mac-wk2/Skipped: Removed now-passing tests. Resorted
        the section under eventSender, and expanded directories to list
        the individual tests in that section.
2011-03-31  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=57573

        * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
        Added real definitions for mouseDown, mouseUp, mouseMoveTo and leapForward.
        Removed fake definitions of keyDown and contextClick.

        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
        (WTR::operator==): Added. So we can compare two WKPoint structs.
        (WTR::parseModifier): Added.
        (WTR::parseModifierArray): Added.
        (WTR::EventSendingController::EventSendingController): Initialize the
        new data members.
        (WTR::EventSendingController::mouseDown): Added. Calls
        WKBundlePageSimulateMouseDown.
        (WTR::EventSendingController::mouseUp): Added. Calls
        WKBundlePageSimulateMouseUp.
        (WTR::EventSendingController::mouseMoveTo): Added. Calls
        WKBundlePageSimulateMouseMotion.
        (WTR::EventSendingController::leapForward): Added.
        (WTR::EventSendingController::updateClickCount): Added. Used by the
        mouseDown/Up functions to create a click count.

        * WebKitTestRunner/InjectedBundle/EventSendingController.h: Updated
        for the changes above.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82625 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h

index 9f0e2d45724bc54ce7a5739de13c5fc5287c4d8a..5d96822b4b6ba21d2b1f2a18b267bac9651d4e2a 100644 (file)
@@ -1,3 +1,14 @@
+2011-03-31  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=57573
+
+        * platform/mac-wk2/Skipped: Removed now-passing tests. Resorted
+        the section under eventSender, and expanded directories to list
+        the individual tests in that section.
+
 2011-03-31  Adam Barth  <abarth@webkit.org>
 
         Update Chromium expected results for Hyatt's change.  I haven't
index 9320c3cf4702b7cea242d586be9f46131c995c51..ba8ad4023ce0b8e701e31db47fe6b8e08a7bb589 100644 (file)
@@ -52,64 +52,12 @@ compositing/iframes/iframe-src-change.html
 
 # WebKitTestRunner needs an implementation of eventSender
 # <https://bugs.webkit.org/show_bug.cgi?id=42194>
-editing/pasteboard/drop-file-svg.html
-editing/selection/drag-select-rapidly.html
-fast/forms/select-listbox-multiple-no-focusring.html
-fast/forms/textinput-not-fired-on-enter-in-input.html
-svg/animations/animate-color-fill-currentColor.html
-svg/dynamic-updates/SVGFESpecularLightingElement-dom-in-attr.html
-svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularConstant-attr.html
-svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularExponent-attr.html
-svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html
-svg/dynamic-updates/SVGFESpecularLightingElement-remove-lightSource.html
-svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-in-prop.html
-svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularConstant-prop.html
-svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularExponent-prop.html
-svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html
-fast/forms/file-input-hit-test.html
-fast/repaint/slider-thumb-drag-release.html
-fast/repaint/slider-thumb-float.html
-editing/pasteboard/emacs-ctrl-k-y-001.html
-editing/pasteboard/drag-drop-dead-frame.html
-editing/pasteboard/drag-drop-modifies-page.html
-editing/pasteboard/drag-selected-image-to-contenteditable.html
-editing/pasteboard/drop-link.html
-editing/pasteboard/drop-text-events-sideeffect.html
-editing/pasteboard/drop-text-events.html
-editing/pasteboard/drop-text-without-selection.html
-editing/pasteboard/emacs-ctrl-a-k-y.html
-editing/pasteboard/smart-drag-drop.html
-editing/pasteboard/smart-paste-001.html
-editing/pasteboard/smart-paste-002.html
-editing/pasteboard/smart-paste-003.html
-editing/pasteboard/smart-paste-004.html
-editing/pasteboard/smart-paste-005.html
-editing/pasteboard/smart-paste-007.html
-editing/pasteboard/smart-paste-008.html
-editing/pasteboard/subframe-dragndrop-1.html
-inspector/timeline/timeline-event-dispatch.html
-fast/text/offsetForPosition-complex-fallback.html
-svg/animations/animate-path-to-animation.html
-fast/forms/input-number-change-type-on-focus.html
-fast/forms/search-hide-cancel-on-cancel.html
-fast/dom/search-shadow-host-crash.html
-http/tests/security/isolatedWorld/events.html
-http/tests/security/isolatedWorld/userGestureEvents.html
-http/tests/misc/isindex-with-no-form-base-href.html
-plugins/clicking-missing-plugin-fires-delegate.html
+editing/deleting/5729680.html
 editing/deleting/delete-by-word-001.html
 editing/deleting/delete-by-word-002.html
 editing/deleting/delete-ligature-001.html
 editing/deleting/delete-ligature-002.html
 editing/deleting/delete-ligature-003.html
-editing/input/emacs-ctrl-o.html
-editing/selection/contenteditable-click-inside.html
-fast/forms/focus-change-on-keypress.html
-fast/forms/select-live-pseudo-selectors.html
-editing/selection/caret-bidi-first-and-last-letters.html
-compositing/iframes/layout-on-compositing-change.html
-editing/deleting/5390681-2.html
-editing/deleting/5729680.html
 editing/deleting/forward-delete-key.html
 editing/deleting/skip-virama-001.html
 editing/deleting/smart-delete-001.html
@@ -117,81 +65,68 @@ editing/deleting/smart-delete-002.html
 editing/deleting/smart-delete-003.html
 editing/deleting/smart-delete-004.html
 editing/execCommand/findString-2.html
+editing/input/emacs-ctrl-o.html
 editing/input/option-page-up-down.html
 editing/input/page-up-down-scrolls.html
 editing/input/scroll-viewport-page-up-down.html
-editing/inserting/insert-paste-bidi-control.html
 editing/inserting/return-key-in-hidden-field.html
 editing/inserting/typing-tab-designmode-forms.html
 editing/inserting/typing-tab-designmode.html
 editing/pasteboard/4861080.html
 editing/pasteboard/4944770-2.html
 editing/pasteboard/4947130.html
-editing/pasteboard/copy-crash.html
-editing/pasteboard/drag-drop-iframe-refresh-crash.html
+editing/pasteboard/drag-drop-dead-frame.html
 editing/pasteboard/drag-drop-input-textarea.html
+editing/pasteboard/drag-drop-modifies-page.html
 editing/pasteboard/drag-drop-url-text.html
 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/pasteboard/drop-file-svg.html
 editing/pasteboard/drop-inputtext-acquires-style.html
+editing/pasteboard/drop-link.html
+editing/pasteboard/drop-text-events.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
 editing/pasteboard/file-input-files-access.html
 editing/pasteboard/files-during-page-drags.html
 editing/pasteboard/get-data-text-plain-drop.html
+editing/pasteboard/smart-drag-drop.html
+editing/pasteboard/smart-paste-001.html
+editing/pasteboard/smart-paste-002.html
+editing/pasteboard/smart-paste-003.html
+editing/pasteboard/smart-paste-004.html
+editing/pasteboard/smart-paste-005.html
+editing/pasteboard/smart-paste-007.html
+editing/pasteboard/smart-paste-008.html
+editing/pasteboard/subframe-dragndrop-1.html
 editing/selection/14971.html
 editing/selection/4895428-1.html
-editing/selection/4895428-2.html
-editing/selection/4895428-3.html
 editing/selection/4895428-4.html
-editing/selection/5057506-2.html
 editing/selection/5057506.html
-editing/selection/5131716-1.html
-editing/selection/5131716-2.html
-editing/selection/5131716-3.html
-editing/selection/5131716-4.html
-editing/selection/5209984.html
-editing/selection/5213963.html
 editing/selection/5232159.html
-editing/selection/5240265.html
 editing/selection/5333725.html
 editing/selection/5354455-1.html
 editing/selection/5354455-2.html
-editing/selection/6476.html
-editing/selection/after-line-break.html
-editing/selection/anchor-focus1.html
 editing/selection/anchor-focus2.html
 editing/selection/anchor-focus3.html
 editing/selection/button-right-click.html
-editing/selection/caret-ltr-2-left.html
-editing/selection/caret-ltr-2.html
-editing/selection/caret-ltr-right.html
-editing/selection/caret-ltr.html
-editing/selection/caret-rtl-2-left.html
-editing/selection/caret-rtl-2.html
-editing/selection/caret-rtl-right.html
-editing/selection/caret-rtl.html
-editing/selection/click-after-nested-block.html
-editing/selection/click-before-and-after-table.html
 editing/selection/click-below-rtl-text.html
 editing/selection/click-in-focusable-link-should-not-clear-selection.html
 editing/selection/click-in-margins-inside-editable-div.html
 editing/selection/click-in-padding-with-multiple-line-boxes.html
-editing/selection/click-left-of-rtl-wrapping-text.html
-editing/selection/click-outside-editable-div.html
-editing/selection/click-start-of-line.html
 editing/selection/contains-boundaries.html
 editing/selection/context-menu-on-text.html
-editing/selection/crash-on-drag-with-mutation-events.html
-editing/selection/delete-word-granularity-text-control.html
 editing/selection/doubleclick-beside-cr-span.html
 editing/selection/doubleclick-crash.html
 editing/selection/doubleclick-whitespace-crash.html
 editing/selection/doubleclick-whitespace-img-crash.html
 editing/selection/doubleclick-whitespace.html
-editing/selection/drag-in-iframe.html
 editing/selection/drag-select-1.html
+editing/selection/drag-select-rapidly.html
 editing/selection/drag-start-event-client-x-y.html
-editing/selection/drag-text-delay.html
 editing/selection/drag-to-contenteditable-iframe.html
 editing/selection/editable-links.html
 editing/selection/empty-cell-right-click.html
@@ -201,21 +136,15 @@ editing/selection/extend-after-mouse-selection.html
 editing/selection/extend-selection-after-double-click.html
 editing/selection/fake-doubleclick.html
 editing/selection/fake-drag.html
-editing/selection/focus-and-display-none.html
-editing/selection/focus-crash.html
-editing/selection/hit-test-anonymous.html
 editing/selection/inline-closest-leaf-child.html
 editing/selection/last-empty-inline.html
-editing/selection/mixed-editability-1.html
 editing/selection/mixed-editability-10.html
 editing/selection/move-begin-end.html
 editing/selection/paragraph-granularity.html
-editing/selection/select-all-iframe.html
 editing/selection/select-from-textfield-outwards.html
 editing/selection/selection-actions.html
 editing/selection/shift-click.html
 editing/selection/shrink-selection-after-shift-pagedown.html
-editing/selection/triple-click-in-pre.html
 editing/selection/user-drag-element-and-user-select-none.html
 editing/selection/word-granularity.html
 editing/spelling/context-menu-suggestions.html
@@ -223,47 +152,21 @@ editing/spelling/spellcheck-paste.html
 editing/undo/undo-deleteWord.html
 editing/undo/undo-smart-delete-reversed-selection.html
 editing/undo/undo-smart-delete-word.html
-fast/block/float/float-in-float-hit-testing.html
-fast/block/float/relative-painted-twice.html
 fast/blockflow/horizontal-bt-replaced-selection.html
 fast/blockflow/japanese-lr-selection.html
 fast/blockflow/japanese-rl-selection.html
 fast/blockflow/vertical-lr-replaced-selection.html
 fast/blockflow/vertical-rl-replaced-selection.html
-fast/css-generated-content/drag-state.html
-fast/css-generated-content/hover-style-change.html
-fast/css-generated-content/positioned-background-hit-test-crash.html
-fast/css-generated-content/spellingToolTip-assert.html
-fast/css/affected-by-hover-after-style-change.html
-fast/css/first-letter-first-line-hover.html
-fast/css/first-letter-hover.html
-fast/css/hover-affects-child.html
-fast/css/hover-subselector.html
-fast/css/layerZOrderCrash.html
-fast/css/list-item-pseudo-nocrash.html
-fast/css/nested-layers-with-hover.html
-fast/css/resize-corner-tracking-transformed.html
-fast/css/resize-corner-tracking.html
-fast/css/resize-single-axis.html
-fast/css/universal-hover-quirk.html
 fast/css/user-drag-none.html
-fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll.html 
-fast/dom/horizontal-scrollbar-in-rtl.html
 fast/dom/HTMLSelectElement/click-size-zero-no-crash.html
-fast/dom/HTMLTableColElement/resize-table-using-col-width.html
-fast/dom/Node/mutation-blur.html
-fast/dom/replaced-image-map.html
-fast/dom/vertical-scrollbar-in-rtl.html
 fast/dom/Window/window-postmessage-clone-frames.html
 fast/dom/Window/window-postmessage-clone.html
-fast/dom/Window/window-xy-properties.html
-fast/dynamic/hover-style-recalc-crash.html
-fast/dynamic/hovered-detach.html
+fast/dom/horizontal-scrollbar-in-rtl.html
+fast/dom/vertical-scrollbar-in-rtl.html
 fast/dynamic/layer-hit-test-crash.html
 fast/events/5056619.html
 fast/events/access-key-self-destruct.html
 fast/events/anchor-empty-focus.html
-fast/events/anchor-image-scrolled-x-y.html
 fast/events/arrow-keys-on-body.html
 fast/events/arrow-navigation.html
 fast/events/attempt-select-all-with-wrong-modifier.html
@@ -272,13 +175,9 @@ fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html
 fast/events/autoscroll-with-non-scrollable-parent.html
 fast/events/autoscroll.html
 fast/events/bogus-dropEffect-effectAllowed.html
-fast/events/capture-on-target.html
 fast/events/check-defocus-event-order-when-triggered-by-mouse-click.html
 fast/events/check-defocus-event-order-when-triggered-by-tab.html
 fast/events/click-count.html
-fast/events/click-focus-anchor.html
-fast/events/click-focus-control.html
-fast/events/clientXY-in-zoom-and-scroll.html
 fast/events/content-changed-during-drop.html
 fast/events/context-no-deselect.html
 fast/events/context-onmousedown-event.html
@@ -291,20 +190,13 @@ fast/events/drag-and-drop-fire-drag-dragover.html
 fast/events/drag-and-drop.html
 fast/events/drag-file-crash.html
 fast/events/drag-in-frames.html
-fast/events/drag-outside-window.html
 fast/events/drag-parent-node.html
 fast/events/drag-to-navigate.html
-fast/events/dragging-mouse-moves.html
 fast/events/event-input-contentEditable.html
-fast/events/event-sender-mouse-moved.html
-fast/events/event-view-toString.html
 fast/events/focus-change-crash.html
 fast/events/focus-change-crash2.html
 fast/events/focusingUnloadedFrame.html
-fast/events/frame-click-focus.html
-fast/events/frame-detached-in-mousedown.html
 fast/events/imagemap-norender-crash.html
-fast/events/input-image-scrolled-x-y.html
 fast/events/input-tab-focus-no-duplicate-events.html
 fast/events/inputText-never-fired-on-keydown-cancel.html
 fast/events/js-keyboard-event-creation.html
@@ -320,54 +212,30 @@ fast/events/keypress-focus-change.html
 fast/events/keypress-removed-node.html
 fast/events/menu-keydown-on-hidden-element.html
 fast/events/mouse-click-events.html
-fast/events/mouse-drag-from-frame-to-other-frame.html
-fast/events/mouse-drag-from-frame.html
-fast/events/mouse-focus-imagemap.html
-fast/events/mouse-relative-position.html
-fast/events/mouseclick-target-and-positioning.html
-fast/events/mousedown-in-subframe-scrollbar.html
-fast/events/mousedown_in_scrollbar.html
-fast/events/mousemove-after-drag-over-scrollbar.html
-fast/events/mouseout-dead-node.html
-fast/events/mouseout-dead-subframe.html
-fast/events/mouseout-on-window.html
-fast/events/mouseover-mouseout.html
-fast/events/mouseover-mouseout2.html
 fast/events/mouseup-from-button2.html
-fast/events/mouseup-outside-button.html
-fast/events/mouseup-outside-document.html
 fast/events/multiline-link-arrow-navigation.html
 fast/events/node-event-anchor-lock.html
-fast/events/onchange-click-hang.html
 fast/events/onchange-passwordfield.html
 fast/events/onchange-searchfield.html
 fast/events/onchange-select-popup.html
 fast/events/onchange-text-form-field.html
 fast/events/onchange-textfield.html
-fast/events/onclick-list-marker.html
 fast/events/ondragenter.html
 fast/events/ondrop-text-html.html
 fast/events/onsearch-enter.html
 fast/events/open-window-from-another-frame.html
-fast/events/overflow-scroll-fake-mouse-move.html
 fast/events/platform-wheelevent-in-scrolling-div.html
-fast/events/pointer-events-2.html
-fast/events/pointer-events.html
 fast/events/popup-blocking-click-in-iframe.html
 fast/events/popup-when-select-change.html
 fast/events/prevent-drag-to-navigate.html
 fast/events/recorded-keydown-event.html
-fast/events/related-target.html
 fast/events/remove-child-onscroll.html
-fast/events/remove-shadow-host-crash.html
 fast/events/right-click-focus.html
 fast/events/scroll-after-click-on-tab-index.html
-fast/events/scroll-to-anchor-in-overflow-hidden.html
 fast/events/scrollbar-double-click.html
 fast/events/select-onchange-crash.html
 fast/events/selectionchange-user-initiated.html
 fast/events/selectstart-during-autoscroll.html
-fast/events/shadow-boundary-crossing.html
 fast/events/space-scroll-event.html
 fast/events/special-key-events-in-input-text.html
 fast/events/standalone-image-drag-to-editable.html
@@ -375,15 +243,15 @@ fast/events/tab-focus-hidden.html
 fast/events/tab-imagemap.html
 fast/events/tab-is-focusable-assert.html
 fast/events/tabindex-focus-chain.html
-fast/events/updateLayoutForHitTest.html
 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html
 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html
-fast/events/window-events-bubble.html
-fast/events/window-events-bubble2.html
-fast/events/window-events-capture.html
 fast/events/zoom-dblclick.html
-fast/files
-fast/forms/25153.html
+fast/files/apply-blob-url-to-img.html
+fast/files/apply-blob-url-to-xhr.html
+fast/files/domurl-script-execution-context-crash.html
+fast/files/file-reader-abort.html
+fast/files/read-blob-async.html
+fast/files/read-file-async.html
 fast/forms/access-key.html
 fast/forms/button-enter-click.html
 fast/forms/button-spacebar-click.html
@@ -393,32 +261,23 @@ fast/forms/drag-into-textarea.html
 fast/forms/drag-out-of-textarea.html
 fast/forms/empty-textarea-toggle-disabled.html
 fast/forms/enter-clicks-buttons.html
+fast/forms/focus-change-on-keypress.html
 fast/forms/focus-control-to-page.html
 fast/forms/focus-selection-input.html
 fast/forms/focus-selection-textarea.html
 fast/forms/get-file-upload.html
 fast/forms/implicit-submission.html
-fast/forms/input-appearance-preventDefault.html
-fast/forms/input-file-not-open-without-gesture.html
 fast/forms/input-file-re-render.html
 fast/forms/input-live-pseudo-selectors.html
-fast/forms/input-number-crash.html
-fast/forms/input-number-events.html
 fast/forms/input-number-keyoperation.html
 fast/forms/input-radio-checked-tab.html
 fast/forms/input-readonly-autoscroll.html
-fast/forms/input-select-on-click.html
-fast/forms/input-spinbutton-capturing.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-enter.html
 fast/forms/input-text-option-delete.html
 fast/forms/input-text-scroll-left-on-blur.html
-fast/forms/input-text-self-emptying-click.html
 fast/forms/input-type-change-in-onfocus-keyboard.html
-fast/forms/input-type-change-in-onfocus-mouse.html
 fast/forms/legend-access-key.html
 fast/forms/listbox-deselect-scroll.html
 fast/forms/listbox-onchange.html
@@ -431,27 +290,17 @@ fast/forms/onchange-enter-submit.html
 fast/forms/onselect-textarea.html
 fast/forms/onselect-textfield.html
 fast/forms/option-mouseevents.html
-fast/forms/password-doubleclick-selection.html
-fast/forms/radio-check-click-and-drag.html
-fast/forms/radio-nested-labels.html
 fast/forms/radio_checked_name.html
 fast/forms/render-text-crash.html
 fast/forms/restore-selection-after-layout.html
-fast/forms/search-abs-pos-cancel-button.html
-fast/forms/search-cancel-button-events.html
-fast/forms/search-cancel-button-mouseup.html
-fast/forms/search-click-in-placeholder.html
-fast/forms/search-delete-while-cancel-button-clicked.html
 fast/forms/search-event-delay.html
-fast/forms/search-hidden-cancel-button.html
-fast/forms/search-rtl.html
-fast/forms/search-transformed.html
-fast/forms/search-zoomed.html
 fast/forms/select-accesskey.html
 fast/forms/select-cache-desynchronization.html
 fast/forms/select-double-onchange.html
 fast/forms/select-empty-list.html
 fast/forms/select-listbox-focus-displaynone.html
+fast/forms/select-listbox-multiple-no-focusring.html
+fast/forms/select-live-pseudo-selectors.html
 fast/forms/select-option-accesskey-crash.html
 fast/forms/select-popup-pagekeys.html
 fast/forms/select-script-onchange.html
@@ -473,97 +322,41 @@ fast/forms/textfield-inside-anchor.html
 fast/forms/textfield-onchange-deletion.html
 fast/forms/textfield-outline.html
 fast/forms/textfield-to-password-on-focus.html
-fast/frames/frame-dead-region.html
-fast/frames/frame-deep-nested-resize.html
-fast/frames/hover-timer-crash.html
+fast/forms/textinput-not-fired-on-enter-in-input.html
 fast/frames/iframe-window-focus.html
 fast/frames/take-focus-from-iframe.html
 fast/history/history_reload.html
 fast/history/window-open.html
-fast/html/details-add-summary-1-and-click.html
-fast/html/details-add-summary-2-and-click.html
-fast/html/details-add-summary-3-and-click.html
-fast/html/details-add-summary-4-and-click.html
-fast/html/details-add-summary-5-and-click.html
-fast/html/details-add-summary-6-and-click.html
-fast/html/details-add-summary-7-and-click.html
-fast/html/details-add-summary-8-and-click.html
-fast/html/details-add-summary-9-and-click.html
-fast/html/details-add-summary-10-and-click.html
-fast/html/details-mouse-click.html
-fast/html/details-remove-summary-1-and-click.html
-fast/html/details-remove-summary-2-and-click.html
-fast/html/details-remove-summary-3-and-click.html
-fast/html/details-remove-summary-4-and-click.html
-fast/html/details-remove-summary-5-and-click.html
-fast/html/details-remove-summary-6-and-click.html
-fast/images/drag-pdf-as-image.html
-fast/images/drag-svg-as-image.html
-fast/images/image-map-multiple-xhtml.xhtml
-fast/images/image-map-multiple.html
-fast/images/image-map-zoom.html
-fast/images/imagemap-case.html
-fast/inline-block/14498-positionForCoordinates.html
-fast/inline/dirtyLinesForInline.html
-fast/inline/relative-positioned-overflow.html
-fast/layers/resize-layer-deletion-crash.html
 fast/lists/drag-into-marker.html
-fast/loader/document-with-fragment-url-1.html
-fast/loader/document-with-fragment-url-2.html
-fast/loader/document-with-fragment-url-3.html
-fast/loader/document-with-fragment-url-4.html
-fast/loader/early-load-cancel.html
-fast/loader/fragment-after-redirect-gets-back-entry.html
 fast/loader/policy-delegate-action-hit-test-zoomed.html
-fast/loader/repeat-same-document-navigation.html
-fast/overflow/hit-test-overflow-controls.html
-fast/overflow/overflow-text-hit-testing.html
-fast/parser/tabindex-parsing.html
 fast/repaint/fixed-move-after-keyboard-scroll.html
-fast/repaint/japanese-rl-selection-clear.html
 fast/repaint/japanese-rl-selection-repaint.html
 fast/repaint/repaint-across-writing-mode-boundary.html
 fast/repaint/selection-rl.html
-fast/replaced/image-map-2.html 
-fast/replaced/image-map-bug16782.html
-fast/replaced/image-map.html
-fast/selectors/unqualified-hover-quirks.html
-fast/selectors/unqualified-hover-strict.html
-fast/table/click-near-anonymous-table.html
-fast/text/atsui-pointtooffset-calls-cg.html
 fast/text/atsui-rtl-override-selection.html
-fast/text/in-rendered-text-rtl.html
 fast/text/international/khmer-selection.html
-fast/text/international/thai-offsetForPosition-inside-character.html
-fast/text/offsetForPosition-cluster-at-zero.html
+fast/text/offsetForPosition-complex-fallback.html
 fast/text/reset-drag-on-mouse-down.html
-fast/text/textIteratorNilRenderer.html
-http/tests/fileapi
-http/tests/local/blob/send-data-blob.html
 http/tests/local/blob/send-hybrid-blob.html
-http/tests/local/blob/send-sliced-data-blob.html
 http/tests/local/drag-over-remote-content.html
-http/tests/local/fileapi
-http/tests/local/formdata
+http/tests/local/fileapi/file-last-modified.html
+http/tests/local/fileapi/send-dragged-file.html
+http/tests/local/fileapi/send-sliced-dragged-file.html
+http/tests/local/formdata/form-data-with-unknown-file-extension.html
+http/tests/local/formdata/send-form-data-constructed-from-form.html
+http/tests/local/formdata/send-form-data-with-sliced-file.html
+http/tests/local/formdata/send-form-data.html
+http/tests/local/formdata/upload-events.html
 http/tests/misc/bubble-drag-events.html
-http/tests/misc/drag-over-iframe-invalid-source-crash.html
+http/tests/misc/isindex-with-no-form-base-href.html
 http/tests/misc/isindex-with-no-form.html
-http/tests/navigation/document-location-click-timeout.html
-http/tests/navigation/document-location-click.html
-http/tests/navigation/document-location-mouseover.html
 http/tests/navigation/no-referrer-reset.html
-http/tests/navigation/no-referrer-same-window.html
-http/tests/navigation/no-referrer-subframe.html
 http/tests/navigation/no-referrer-target-blank.html
-http/tests/navigation/redirect-preserves-referrer.html
 http/tests/security/clipboard/clipboard-file-access.html
 http/tests/security/dataTransfer-set-data-file-url.html
-http/tests/security/drag-drop-different-origin.html
 http/tests/security/drag-drop-same-unique-origin.html
 http/tests/security/drag-over-remote-content-iframe.html
-http/tests/security/listener/xss-window-onclick-addEventListener.html
-http/tests/security/listener/xss-window-onclick-shortcut.html
-media/audio-delete-while-slider-thumb-clicked.html
+http/tests/security/isolatedWorld/userGestureEvents.html
 media/controls-drag-timebar.html
 media/controls-right-click-on-timebar.html
 media/media-fullscreen-inline.html
@@ -572,22 +365,14 @@ platform/mac/editing/deleting/backward-delete.html
 platform/mac/editing/pasteboard/dataTransfer-set-data-file-url.html
 platform/mac/editing/selection/doubleclick-should-not-expand-across-lines.html
 platform/mac/editing/selection/word-thai.html
-platform/mac/fast/forms/input-appearance-spinbutton-up.html
-platform/mac/fast/forms/input-number-click.html
 platform/mac/fast/forms/listbox-scrollbar-hit-test.html
 platform/mac/fast/overflow/overflow-scrollbar-hit-test.html
-plugins/change-widget-and-click-crash.html
+plugins/clicking-missing-plugin-fires-delegate.html
 plugins/mouse-events.html
-plugins/mouse-move-over-plugin-in-frame.html
-plugins/resize-from-plugin.html
-scrollbars/overflow-custom-scrollbar-crash.html
-scrollbars/scrollbar-click-does-not-blur-content.html
 scrollbars/scrollbar-iframe-click-does-not-blur-content.html
-scrollbars/scrollbar-middleclick-nopaste.html
 scrollbars/scrollbar-miss-mousemove-disabled.html
-scrollbars/scrollbar-miss-mousemove.html
 scrollbars/scrollevent-iframe-no-scrolling-wheel.html
-storage/multiple-transactions-on-different-handles.html
+
 svg/animations/animVal-basics.html
 svg/animations/animate-calcMode-spline-by.html
 svg/animations/animate-calcMode-spline-from-by.html
@@ -595,6 +380,7 @@ svg/animations/animate-calcMode-spline-from-to.html
 svg/animations/animate-calcMode-spline-to.html
 svg/animations/animate-calcMode-spline-values.html
 svg/animations/animate-color-calcMode-discrete.html
+svg/animations/animate-color-fill-currentColor.html
 svg/animations/animate-color-rgba-calcMode-discrete.html
 svg/animations/animate-color-transparent.html
 svg/animations/animate-currentColor.html
@@ -610,6 +396,7 @@ svg/animations/animate-path-animation-cC-sS-inverse.html
 svg/animations/animate-path-animation-lL-vV-hH-inverse.html
 svg/animations/animate-path-animation-qQ-tT-inverse.html
 svg/animations/animate-path-nested-transforms.html
+svg/animations/animate-path-to-animation.html
 svg/animations/animate-points.html
 svg/animations/animate-text-nested-transforms.html
 svg/custom/absolute-sized-content-with-resources.xhtml
@@ -812,6 +599,15 @@ svg/dynamic-updates/SVGFEPointLightElement-dom-z-attr.html
 svg/dynamic-updates/SVGFEPointLightElement-svgdom-x-prop.html
 svg/dynamic-updates/SVGFEPointLightElement-svgdom-y-prop.html
 svg/dynamic-updates/SVGFEPointLightElement-svgdom-z-prop.html
+svg/dynamic-updates/SVGFESpecularLightingElement-dom-in-attr.html
+svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularConstant-attr.html
+svg/dynamic-updates/SVGFESpecularLightingElement-dom-specularExponent-attr.html
+svg/dynamic-updates/SVGFESpecularLightingElement-dom-suraceScale-attr.html
+svg/dynamic-updates/SVGFESpecularLightingElement-remove-lightSource.html
+svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-in-prop.html
+svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularConstant-prop.html
+svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-specularExponent-prop.html
+svg/dynamic-updates/SVGFESpecularLightingElement-svgdom-suraceScale-prop.html
 svg/dynamic-updates/SVGFESpotLightElement-dom-limitingConeAngle-attr.html
 svg/dynamic-updates/SVGFESpotLightElement-dom-pointsAtX-attr.html
 svg/dynamic-updates/SVGFESpotLightElement-dom-pointsAtY-attr.html
@@ -890,6 +686,16 @@ svg/dynamic-updates/SVGImageElement-svgdom-requiredFeatures.html
 svg/dynamic-updates/SVGImageElement-svgdom-width-prop.html
 svg/dynamic-updates/SVGImageElement-svgdom-x-prop.html
 svg/dynamic-updates/SVGImageElement-svgdom-y-prop.html
+svg/dynamic-updates/SVGLineElement-dom-requiredFeatures.html
+svg/dynamic-updates/SVGLineElement-dom-x1-attr.html
+svg/dynamic-updates/SVGLineElement-dom-x2-attr.html
+svg/dynamic-updates/SVGLineElement-dom-y1-attr.html
+svg/dynamic-updates/SVGLineElement-dom-y2-attr.html
+svg/dynamic-updates/SVGLineElement-svgdom-requiredFeatures.html
+svg/dynamic-updates/SVGLineElement-svgdom-x1-prop.html
+svg/dynamic-updates/SVGLineElement-svgdom-x2-prop.html
+svg/dynamic-updates/SVGLineElement-svgdom-y1-prop.html
+svg/dynamic-updates/SVGLineElement-svgdom-y2-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-dom-gradientTransform-attr.html
 svg/dynamic-updates/SVGLinearGradientElement-dom-gradientUnits-attr.html
 svg/dynamic-updates/SVGLinearGradientElement-dom-x1-attr.html
@@ -902,16 +708,6 @@ svg/dynamic-updates/SVGLinearGradientElement-svgdom-x1-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-svgdom-x2-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-svgdom-y1-prop.html
 svg/dynamic-updates/SVGLinearGradientElement-svgdom-y2-prop.html
-svg/dynamic-updates/SVGLineElement-dom-requiredFeatures.html
-svg/dynamic-updates/SVGLineElement-dom-x1-attr.html
-svg/dynamic-updates/SVGLineElement-dom-x2-attr.html
-svg/dynamic-updates/SVGLineElement-dom-y1-attr.html
-svg/dynamic-updates/SVGLineElement-dom-y2-attr.html
-svg/dynamic-updates/SVGLineElement-svgdom-requiredFeatures.html
-svg/dynamic-updates/SVGLineElement-svgdom-x1-prop.html
-svg/dynamic-updates/SVGLineElement-svgdom-x2-prop.html
-svg/dynamic-updates/SVGLineElement-svgdom-y1-prop.html
-svg/dynamic-updates/SVGLineElement-svgdom-y2-prop.html
 svg/dynamic-updates/SVGMarkerElement-dom-markerHeight-attr.html
 svg/dynamic-updates/SVGMarkerElement-dom-markerUnits-attr.html
 svg/dynamic-updates/SVGMarkerElement-dom-markerWidth-attr.html
@@ -985,12 +781,12 @@ svg/dynamic-updates/SVGRectElement-svgdom-x-prop.html
 svg/dynamic-updates/SVGRectElement-svgdom-y-prop.html
 svg/dynamic-updates/SVGSVGElement-dom-requiredFeatures.html
 svg/dynamic-updates/SVGSVGElement-svgdom-requiredFeatures.html
+svg/dynamic-updates/SVGTRefElement-dom-href-attr.html
 svg/dynamic-updates/SVGTextElement-dom-requiredFeatures.html
 svg/dynamic-updates/SVGTextElement-dom-transform-attr.html
 svg/dynamic-updates/SVGTextElement-svgdom-requiredFeatures.html
 svg/dynamic-updates/SVGTextElement-svgdom-rotate-prop.html
 svg/dynamic-updates/SVGTextElement-svgdom-transform-prop.html
-svg/dynamic-updates/SVGTRefElement-dom-href-attr.html
 svg/dynamic-updates/SVGUseElement-dom-requiredFeatures.html
 svg/dynamic-updates/SVGUseElement-svgdom-requiredFeatures.html
 svg/filters/filter-width-update.svg
index 4cbafb748efdace4d290efd80f6b1a384bf72309..19229451016fa71ed162be5f291b3d375faa776c 100644 (file)
@@ -1,3 +1,21 @@
+2011-03-31  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=57573
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageSimulateMouseDown): Added.
+        (WKBundlePageSimulateMouseUp): Added.
+        (WKBundlePageSimulateMouseMotion): Added.
+        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Added above functions.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::simulateMouseDown): Added.
+        (WebKit::WebPage::simulateMouseUp): Added.
+        (WebKit::WebPage::simulateMouseMotion): Added.
+        * WebProcess/WebPage/WebPage.h: Added above functions.
+
 2011-03-31  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Anders Carlsson.
index 58052c5d369d5b21059dac58cf1b6a2824463b24..1a9c132cb0f2ab2f57bf634e8931e213b56f376c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -217,3 +217,18 @@ void WKBundlePageForceRepaint(WKBundlePageRef page)
 {
     toImpl(page)->forceRepaintWithoutCallback();
 }
+
+void WKBundlePageSimulateMouseDown(WKBundlePageRef page, int button, WKPoint position, int clickCount, WKEventModifiers modifiers, double time)
+{
+    toImpl(page)->simulateMouseDown(button, toIntPoint(position), clickCount, modifiers, time);
+}
+
+void WKBundlePageSimulateMouseUp(WKBundlePageRef page, int button, WKPoint position, int clickCount, WKEventModifiers modifiers, double time)
+{
+    toImpl(page)->simulateMouseUp(button, toIntPoint(position), clickCount, modifiers, time);
+}
+
+void WKBundlePageSimulateMouseMotion(WKBundlePageRef page, WKPoint position, double time)
+{
+    toImpl(page)->simulateMouseMotion(toIntPoint(position), time);
+}
index b9dce68b3f214092958cb655fcd068a6de6ed7e3..87203f157a8c297070d8149fff2c8ae67eb405e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,6 +47,10 @@ WK_EXPORT void WKBundlePageSetPageZoomFactor(WKBundlePageRef page, double zoomFa
 
 WK_EXPORT void WKBundlePageForceRepaint(WKBundlePageRef page);
 
+WK_EXPORT void WKBundlePageSimulateMouseDown(WKBundlePageRef page, int button, WKPoint position, int clickCount, WKEventModifiers modifiers, double time);
+WK_EXPORT void WKBundlePageSimulateMouseUp(WKBundlePageRef page, int button, WKPoint position, int clickCount, WKEventModifiers modifiers, double time);
+WK_EXPORT void WKBundlePageSimulateMouseMotion(WKBundlePageRef page, WKPoint position, double time);
+
 #ifdef __cplusplus
 }
 #endif
index 119582837736452cd5e03608c643ac8c493b1130..2ba8af5ee6b40c991967d16df9f322d8dcbd334a 100644 (file)
@@ -2158,4 +2158,19 @@ void WebPage::handleCorrectionPanelResult(const String& result)
 }
 #endif
 
+void WebPage::simulateMouseDown(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
+{
+    mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time));
+}
+
+void WebPage::simulateMouseUp(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
+{
+    mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time));
+}
+
+void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time)
+{
+    mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time));
+}
+
 } // namespace WebKit
index 8e4e71c05bd7c2bf8a28e4fee2047d457ab20823..64f4d32818e02211db70839469ecdaa0f1ea397e 100644 (file)
@@ -373,6 +373,10 @@ public:
     void handleCorrectionPanelResult(const String&);
 #endif
 
+    void simulateMouseDown(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
+    void simulateMouseUp(int button, WebCore::IntPoint, int clickCount, WKEventModifiers, double time);
+    void simulateMouseMotion(WebCore::IntPoint, double time);
+
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
index cef9a06dac9c5f3cc8986b33561b621bc08a0ca2..de3c3ffb593f50a0614523d5c36ede3972ebf8a1 100644 (file)
@@ -1,3 +1,33 @@
+2011-03-31  Darin Adler  <darin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Implement mouseDown, mouseUp, and mouseMoveTo in WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=57573
+
+        * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
+        Added real definitions for mouseDown, mouseUp, mouseMoveTo and leapForward.
+        Removed fake definitions of keyDown and contextClick.
+
+        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+        (WTR::operator==): Added. So we can compare two WKPoint structs.
+        (WTR::parseModifier): Added.
+        (WTR::parseModifierArray): Added.
+        (WTR::EventSendingController::EventSendingController): Initialize the
+        new data members.
+        (WTR::EventSendingController::mouseDown): Added. Calls
+        WKBundlePageSimulateMouseDown.
+        (WTR::EventSendingController::mouseUp): Added. Calls
+        WKBundlePageSimulateMouseUp.
+        (WTR::EventSendingController::mouseMoveTo): Added. Calls
+        WKBundlePageSimulateMouseMotion.
+        (WTR::EventSendingController::leapForward): Added.
+        (WTR::EventSendingController::updateClickCount): Added. Used by the
+        mouseDown/Up functions to create a click count.
+
+        * WebKitTestRunner/InjectedBundle/EventSendingController.h: Updated
+        for the changes above.
+
 2011-03-31  Sergio Villar Senin  <svillar@igalia.com>
 
         Reviewed by Martin Robinson.
index 1e477720d20d1b72dede3635b3d6556976f0f022..6ffbd59180463f41fa9b18e3ab3062ee71d2ba1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 20111 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 module WTR {
 
     interface EventSendingController {
-        [CustomArgumentHandling] void mouseDown();
-        [CustomArgumentHandling] void mouseUp();
-        [CustomArgumentHandling] void mouseMoveTo();
-        [CustomArgumentHandling] void keyDown();
-        [CustomArgumentHandling] void contextClick(); // CustomArgumentHandling only to throw exception while not implemented.
-        [CustomArgumentHandling] void leapForward(/*in unsigned long delay*/); // CustomArgumentHandling only to throw exception while not implemented.
+        void mouseDown(in long buttonNumber, in object modifierArray);
+        void mouseUp(in long buttonNumber, in object modifierArray);
+        void mouseMoveTo(in long x, in long y);
+        void leapForward(in long milliseconds);
 
         // Zoom functions.
         void textZoomIn();
index cc1720e980dfe98f7bca29e20c928c45d760eeb5..6885528c7f95ec8811a932d7cd3bdcaaea41a2b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,7 +29,7 @@
 #include "InjectedBundle.h"
 #include "InjectedBundlePage.h"
 #include "JSEventSendingController.h"
-#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundleFrame.h>
 #include <WebKit2/WKBundlePagePrivate.h>
 #include <WebKit2/WKBundlePrivate.h>
 
@@ -37,12 +37,67 @@ namespace WTR {
 
 static const float ZoomMultiplierRatio = 1.2f;
 
+static bool operator==(const WKPoint& a, const WKPoint& b)
+{
+    return a.x == b.x && a.y == b.y;
+}
+
+static WKEventModifiers parseModifier(JSStringRef modifier)
+{
+    if (JSStringIsEqualToUTF8CString(modifier, "ctrlKey"))
+        return kWKEventModifiersControlKey;
+    if (JSStringIsEqualToUTF8CString(modifier, "shiftKey") || JSStringIsEqualToUTF8CString(modifier, "rangeSelectionKey"))
+        return kWKEventModifiersShiftKey;
+    if (JSStringIsEqualToUTF8CString(modifier, "altKey"))
+        return kWKEventModifiersAltKey;
+    if (JSStringIsEqualToUTF8CString(modifier, "metaKey") || JSStringIsEqualToUTF8CString(modifier, "addSelectionKey"))
+        return kWKEventModifiersMetaKey;
+    return 0;
+}
+
+static unsigned arrayLength(JSContextRef context, JSObjectRef array)
+{
+    JSRetainPtr<JSStringRef> lengthString(Adopt, JSStringCreateWithUTF8CString("length"));
+    JSValueRef lengthValue = JSObjectGetProperty(context, array, lengthString.get(), 0);
+    if (!lengthValue)
+        return 0;
+    return static_cast<unsigned>(JSValueToNumber(context, lengthValue, 0));
+}
+
+static WKEventModifiers parseModifierArray(JSContextRef context, JSValueRef arrayValue)
+{
+    if (!arrayValue)
+        return 0;
+    if (!JSValueIsObject(context, arrayValue))
+        return 0;
+    JSObjectRef array = const_cast<JSObjectRef>(arrayValue);
+    unsigned length = arrayLength(context, array);
+    WKEventModifiers modifiers = 0;
+    for (unsigned i = 0; i < length; i++) {
+        JSValueRef exception = 0;
+        JSValueRef value = JSObjectGetPropertyAtIndex(context, array, i, &exception);
+        if (exception)
+            continue;
+        JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(context, value, &exception));
+        if (exception)
+            continue;
+        modifiers |= parseModifier(string.get());
+    }
+    return modifiers;
+}
+
 PassRefPtr<EventSendingController> EventSendingController::create()
 {
     return adoptRef(new EventSendingController);
 }
 
 EventSendingController::EventSendingController()
+    : m_time(0)
+    , m_position()
+    , m_clickCount(0)
+    , m_clickTime(0)
+    , m_clickPosition()
+    , m_clickButton(kWKEventMouseButtonNoButton)
 {
 }
 
@@ -55,40 +110,50 @@ JSClassRef EventSendingController::wrapperClass()
     return JSEventSendingController::eventSendingControllerClass();
 }
 
-static void setExceptionForString(JSContextRef context, JSValueRef* exception, const char* string)
-{
-    JSRetainPtr<JSStringRef> exceptionString(Adopt, JSStringCreateWithUTF8CString(string));
-    *exception = JSValueMakeString(context, exceptionString.get());
-}
-
-void EventSendingController::mouseDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::mouseDown(int button, JSValueRef modifierArray)
 {
-    setExceptionForString(context, exception, "EventSender.mouseDown is not yet supported.");
+    WKBundlePageRef page = InjectedBundle::shared().page()->page();
+    WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+    JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
+    updateClickCount(button);
+    WKBundlePageSimulateMouseDown(page, button, m_position, m_clickCount, modifiers, m_time);
 }
 
-void EventSendingController::mouseUp(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::mouseUp(int button, JSValueRef modifierArray)
 {
-    setExceptionForString(context, exception, "EventSender.mouseUp is not yet supported.");
+    WKBundlePageRef page = InjectedBundle::shared().page()->page();
+    WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+    JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+    WKEventModifiers modifiers = parseModifierArray(context, modifierArray);
+    updateClickCount(button);
+    WKBundlePageSimulateMouseUp(page, button, m_position, m_clickCount, modifiers, m_time);
 }
 
-void EventSendingController::mouseMoveTo(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::mouseMoveTo(int x, int y)
 {
-    setExceptionForString(context, exception, "EventSender.mouseMoveTo is not yet supported.");
+    m_position.x = x;
+    m_position.y = y;
+    WKBundlePageSimulateMouseMotion(InjectedBundle::shared().page()->page(), m_position, m_time);
 }
 
-void EventSendingController::keyDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::leapForward(int milliseconds)
 {
-    setExceptionForString(context, exception, "EventSender.keyDown is not yet supported.");
+    m_time += milliseconds / 1000.0;
 }
 
-void EventSendingController::contextClick(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+void EventSendingController::updateClickCount(WKEventMouseButton button)
 {
-    setExceptionForString(context, exception, "EventSender.contextClick is not yet supported.");
-}
+    if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {
+        ++m_clickCount;
+        m_clickTime = m_time;
+        return;
+    }
 
-void EventSendingController::leapForward(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    setExceptionForString(context, exception, "EventSender.leapForward is not yet supported.");
+    m_clickCount = 1;
+    m_clickTime = m_time;
+    m_clickPosition = m_position;
+    m_clickButton = button;
 }
 
 void EventSendingController::textZoomIn()
index 400f60ddd0438df084e1300b6660eae7468557ba..bd571dce8e62c1720a0cf0831c4abbd06728ac7c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,6 +27,8 @@
 #define EventSendingController_h
 
 #include "JSWrappable.h"
+#include <WebKit2/WKEvent.h>
+#include <WebKit2/WKGeometry.h>
 #include <wtf/PassRefPtr.h>
 
 namespace WTR {
@@ -41,12 +43,10 @@ public:
     // JSWrappable
     virtual JSClassRef wrapperClass();
 
-    void mouseDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void mouseUp(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void mouseMoveTo(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void keyDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void contextClick(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
-    void leapForward(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+    void mouseDown(int button, JSValueRef modifierArray);
+    void mouseUp(int button, JSValueRef modifierArray);
+    void mouseMoveTo(int x, int y);
+    void leapForward(int milliseconds);
 
     // Zoom functions.
     void textZoomIn();
@@ -56,6 +56,16 @@ public:
 
 private:
     EventSendingController();
+
+    void updateClickCount(WKEventMouseButton);
+
+    double m_time;
+    WKPoint m_position;
+
+    int m_clickCount;
+    double m_clickTime;
+    WKPoint m_clickPosition;
+    WKEventMouseButton m_clickButton;
 };
 
 } // namespace WTR