Title: [223545] releases/WebKitGTK/webkit-2.18
Revision
223545
Author
carlo...@webkit.org
Date
2017-10-17 07:34:41 -0700 (Tue, 17 Oct 2017)

Log Message

Merge r221075, r221260 - [WPE] Some event handlers not working.
https://bugs.webkit.org/show_bug.cgi?id=175864

Reviewed by Michael Catanzaro.

Source/WebCore:

Share the EventHandler implementation with the GTK port and add ifdefs where needed.

Covered by existing tests.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* page/wpe/EventHandlerWPE.cpp: Removed.
* platform/glib/EventHandlerGlib.cpp: Renamed from Source/WebCore/page/gtk/EventHandlerGtk.cpp.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const):

LayoutTests:

Remove expected failures for tests that now pass, add new expectation
for a test that is failing also on GTK+ and rebaseline a test with
the same expected result than on GTK+.

* platform/wpe/TestExpectations:
* platform/wpe/fast/events/focus-label-legend-elements-with-tab-expected.txt: Added.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/ChangeLog	2017-10-17 14:34:41 UTC (rev 223545)
@@ -1,3 +1,17 @@
+2017-08-23  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [WPE] Some event handlers not working.
+        https://bugs.webkit.org/show_bug.cgi?id=175864
+
+        Reviewed by Michael Catanzaro.
+
+        Remove expected failures for tests that now pass, add new expectation
+        for a test that is failing also on GTK+ and rebaseline a test with
+        the same expected result than on GTK+.
+
+        * platform/wpe/TestExpectations:
+        * platform/wpe/fast/events/focus-label-legend-elements-with-tab-expected.txt: Added.
+
 2017-10-13  Brent Fulgham  <bfulg...@apple.com>
 
         Protect FrameView during style calculations

Modified: releases/WebKitGTK/webkit-2.18/LayoutTests/platform/wpe/TestExpectations (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/platform/wpe/TestExpectations	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/platform/wpe/TestExpectations	2017-10-17 14:34:41 UTC (rev 223545)
@@ -382,7 +382,6 @@
 # The tests below need gardening after the EventSenderWPE has been added.
 # Most of them are probably failing because of missing support of event related
 # features in WPE.
-webkit.org/b/173419 fast/events/autoscroll-in-overflow-hidden-html.html [ Failure ]
 webkit.org/b/173419 fast/events/autoscroll-in-textarea.html [ Failure ]
 webkit.org/b/173419 fast/events/autoscroll-in-textfield.html [ Failure ]
 webkit.org/b/173419 fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html [ Failure ]
@@ -404,15 +403,9 @@
 webkit.org/b/173419 fast/events/input-events-paste-data.html [ Failure ]
 webkit.org/b/173419 fast/events/input-events-paste-rich-datatransfer.html [ Failure ]
 webkit.org/b/173419 fast/events/js-keyboard-event-creation.html [ Failure ]
-webkit.org/b/173419 fast/events/keydown-1.html [ Failure ]
 webkit.org/b/173419 fast/events/keydown-numpad-keys.html [ Failure ]
 webkit.org/b/173419 fast/events/mouse-cursor-image-set.html [ Failure ]
-webkit.org/b/173419 fast/events/mouse-drag-from-frame-to-other-frame.html [ Failure ]
-webkit.org/b/173419 fast/events/mouse-drag-from-frame.html [ Failure ]
-webkit.org/b/173419 fast/events/mouseenterleave-on-subframe.html [ Failure ]
 webkit.org/b/173419 fast/events/mouseover-button.html [ Failure ]
-webkit.org/b/173419 fast/events/mouseover-mouseout.html [ Failure ]
-webkit.org/b/173419 fast/events/mouseover-mouseout2.html [ Failure ]
 webkit.org/b/173419 fast/events/mouseup-from-button2.html [ Failure ]
 webkit.org/b/173419 fast/events/no-scroll-on-input-text-selection.html [ Failure ]
 webkit.org/b/173419 fast/events/node-event-anchor-lock.html [ Failure ]
@@ -419,7 +412,6 @@
 webkit.org/b/173419 fast/events/offsetX-offsetY.html [ Failure ]
 webkit.org/b/173419 fast/events/onchange-range-slider.html [ Failure ]
 webkit.org/b/173419 fast/events/option-tab.html [ Failure ]
-webkit.org/b/173419 fast/events/page-scaled-mouse-click-iframe.html [ Failure ]
 webkit.org/b/173419 fast/events/platform-wheelevent-in-scrolling-div.html [ Failure ]
 webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html [ Failure ]
 webkit.org/b/173419 fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html [ Failure ]
@@ -453,33 +445,28 @@
 webkit.org/b/173419 fast/events/autoscroll-should-not-stop-on-keypress.html [ Timeout ]
 webkit.org/b/173419 fast/events/autoscroll-when-zoomed.html [ Timeout ]
 webkit.org/b/173419 fast/events/before-input-prevent-insert-replacement.html [ Timeout ]
-webkit.org/b/173419 fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html [ Timeout ]
 webkit.org/b/173419 fast/events/clipboard-dataTransferItemList.html [ Timeout ]
 webkit.org/b/173419 fast/events/drag-dataTransferItemList.html [ Timeout ]
 webkit.org/b/173419 fast/events/event-view-toString.html [ Timeout ]
-webkit.org/b/173419 fast/events/frame-detached-in-mousedown.html [ Timeout ]
-webkit.org/b/173419 fast/events/iframe-onmousemove.html [ Timeout ]
 webkit.org/b/173419 fast/events/input-event-insert-replacement.html [ Timeout ]
 webkit.org/b/173419 fast/events/mouse-force-changed.html [ Timeout ]
 webkit.org/b/173419 fast/events/mouse-force-down.html [ Timeout ]
 webkit.org/b/173419 fast/events/mouse-force-up.html [ Timeout ]
-webkit.org/b/173419 fast/events/mouse-moved-remove-frame-crash.html [ Timeout ]
 webkit.org/b/173419 fast/events/page-visibility-iframe-delete-test.html [ Timeout ]
 webkit.org/b/173419 fast/events/page-visibility-iframe-move-test.html [ Timeout ]
 webkit.org/b/173419 fast/events/page-visibility-iframe-propagation-test.html [ Timeout ]
 webkit.org/b/173419 fast/events/page-visibility-onvisibilitychange.html [ Timeout ]
 webkit.org/b/173419 fast/events/page-visibility-transition-test.html [ Timeout ]
-webkit.org/b/173419 fast/events/popup-blocking-click-in-iframe.html [ Timeout ]
 webkit.org/b/173419 fast/events/scroll-after-click-on-tab-index.html [ Timeout ]
 webkit.org/b/173419 fast/events/standalone-image-drag-to-editable.html [ Timeout ]
-webkit.org/b/173419 fast/events/touch/emulated-touch-iframe.html [ Timeout ]
 webkit.org/b/173419 fast/events/touch/multi-touch-grouped-targets.html [ Timeout ]
 webkit.org/b/173419 fast/events/touch/multi-touch-inside-nested-iframes.html [ Timeout ]
 webkit.org/b/173419 fast/events/touch/page-scaled-touch-gesture-click.html [ Timeout ]
 webkit.org/b/173419 fast/events/touch/touch-target-limited.html [ Timeout ]
 webkit.org/b/173419 fast/events/touch/touch-target.html [ Timeout ]
-webkit.org/b/173419 fast/events/wheel-event-destroys-frame.html [ Timeout ]
 
+webkit.org/b/173411 fast/events/touch/frame-hover-update.html [ Failure ]
+
 fast/events/ios [ Skip ]
 fast/events/touch/ios [ Skip ]
 fast/events/touch/gesture [ Skip ]

Added: releases/WebKitGTK/webkit-2.18/LayoutTests/platform/wpe/fast/events/focus-label-legend-elements-with-tab-expected.txt (0 => 223545)


--- releases/WebKitGTK/webkit-2.18/LayoutTests/platform/wpe/fast/events/focus-label-legend-elements-with-tab-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/LayoutTests/platform/wpe/fast/events/focus-label-legend-elements-with-tab-expected.txt	2017-10-17 14:34:41 UTC (rev 223545)
@@ -0,0 +1,19 @@
+Tests for moving focus by pressing tab key across label and legend elements.
+To manually test, press tab key seven times then shift+tab six times.
+It should traverse focusable elements in the ascending order from 1 to 7 and then in the descending order back to 1.
+
+
+1. An input element inside a non-focusable label element
+2. A label element with an input element
+3. An input elment inside a focusable label element
+4. A label element with just text
+5. A fieldset element with tabindex
+6. A focusable legend element inside a fieldset element
+7. An input element inside a fieldset element
+6. A focusable legend element inside a fieldset element
+5. A fieldset element with tabindex
+4. A label element with just text
+3. An input elment inside a focusable label element
+2. A label element with an input element
+1. An input element inside a non-focusable label element
+

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-10-17 14:34:41 UTC (rev 223545)
@@ -1,3 +1,45 @@
+2017-08-28  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [GTK] [WPE] Rename EventHandlerGlib to EventHandlerGLib
+        https://bugs.webkit.org/show_bug.cgi?id=175864
+
+        Unreviewed cosmetic follow-up patch after r221075.
+
+        No new tests. No change in behavior.
+
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+        * platform/glib/EventHandlerGLib.cpp: Renamed from Source/WebCore/platform/glib/EventHandlerGlib.cpp.
+        (WebCore::EventHandler::tabsToAllFormControls const):
+        (WebCore::EventHandler::focusDocumentView):
+        (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
+        (WebCore::EventHandler::passMouseDownEventToWidget):
+        (WebCore::EventHandler::eventActivatedView const):
+        (WebCore::EventHandler::widgetDidHandleWheelEvent):
+        (WebCore::EventHandler::createDraggingDataTransfer const):
+        (WebCore::EventHandler::passMousePressEventToSubframe):
+        (WebCore::EventHandler::passMouseMoveEventToSubframe):
+        (WebCore::EventHandler::passMouseReleaseEventToSubframe):
+        (WebCore::EventHandler::accessKeyModifiers):
+        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const):
+
+2017-08-23  Carlos Alberto Lopez Perez  <clo...@igalia.com>
+
+        [WPE] Some event handlers not working.
+        https://bugs.webkit.org/show_bug.cgi?id=175864
+
+        Reviewed by Michael Catanzaro.
+
+        Share the EventHandler implementation with the GTK port and add ifdefs where needed.
+
+        Covered by existing tests.
+
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+        * page/wpe/EventHandlerWPE.cpp: Removed.
+        * platform/glib/EventHandlerGlib.cpp: Renamed from Source/WebCore/page/gtk/EventHandlerGtk.cpp.
+        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const):
+
 2017-10-16  Maureen Daum  <md...@apple.com>
 
         If an origin doesn't have databases in the Databases table we should still remove its information from disk in DatabaseTracker::deleteOrigin()

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/PlatformGTK.cmake (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/PlatformGTK.cmake	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/PlatformGTK.cmake	2017-10-17 14:34:41 UTC (rev 223545)
@@ -154,8 +154,9 @@
     editing/gtk/EditorGtk.cpp
 
     page/gtk/DragControllerGtk.cpp
-    page/gtk/EventHandlerGtk.cpp
 
+    platform/glib/EventHandlerGLib.cpp
+
     platform/graphics/PlatformDisplay.cpp
 
     platform/graphics/gtk/ColorGtk.cpp

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/PlatformWPE.cmake (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/PlatformWPE.cmake	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/PlatformWPE.cmake	2017-10-17 14:34:41 UTC (rev 223545)
@@ -135,7 +135,7 @@
 list(APPEND WebCorePlatformWPE_SOURCES
     editing/wpe/EditorWPE.cpp
 
-    page/wpe/EventHandlerWPE.cpp
+    platform/glib/EventHandlerGLib.cpp
 
     platform/graphics/egl/GLContextEGLWPE.cpp
 

Deleted: releases/WebKitGTK/webkit-2.18/Source/WebCore/page/gtk/EventHandlerGtk.cpp (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/page/gtk/EventHandlerGtk.cpp	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/page/gtk/EventHandlerGtk.cpp	2017-10-17 14:34:41 UTC (rev 223545)
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2006 Zack Rusin <z...@kde.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "EventHandler.h"
-
-#include "DataTransfer.h"
-#include "FloatPoint.h"
-#include "FocusController.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "KeyboardEvent.h"
-#include "MouseEventWithHitTestResults.h"
-#include "NotImplemented.h"
-#include "Page.h"
-#include "PlatformKeyboardEvent.h"
-#include "PlatformWheelEvent.h"
-#include "RenderWidget.h"
-#include "Scrollbar.h"
-
-namespace WebCore {
-
-#if ENABLE(DRAG_SUPPORT)
-const double EventHandler::TextDragDelay = 0.0;
-#endif
-
-bool EventHandler::tabsToAllFormControls(KeyboardEvent&) const
-{
-    // We always allow tabs to all controls
-    return true;
-}
-
-void EventHandler::focusDocumentView()
-{
-    if (Page* page = m_frame.page())
-        page->focusController().setFocusedFrame(&m_frame);
-}
-
-bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
-{
-    // Figure out which view to send the event to.
-    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : nullptr;
-    if (!is<RenderWidget>(target))
-        return false;
-    return passMouseDownEventToWidget(downcast<RenderWidget>(*target).widget());
-}
-
-bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
-{
-    return passMouseDownEventToWidget(renderWidget->widget());
-}
-
-bool EventHandler::passMouseDownEventToWidget(Widget*)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
-{
-    //GTK+ activation is not necessarily tied to mouse events, so it may
-    //not make sense to implement this
-
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::widgetDidHandleWheelEvent(const PlatformWheelEvent& event, Widget& widget)
-{
-    if (!is<FrameView>(widget))
-        return false;
-
-    return downcast<FrameView>(widget).frame().eventHandler().handleWheelEvent(event);
-}
-
-#if ENABLE(DRAG_SUPPORT)
-
-Ref<DataTransfer> EventHandler::createDraggingDataTransfer() const
-{
-    return DataTransfer::createForDrag();
-}
-
-#endif
-
-bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
-{
-    subframe->eventHandler().handleMousePressEvent(mev.event());
-    return true;
-}
-
-bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
-{
-    subframe->eventHandler().handleMouseMoveEvent(mev.event(), hoveredNode);
-    return true;
-}
-
-bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
-{
-    subframe->eventHandler().handleMouseReleaseEvent(mev.event());
-    return true;
-}
-
-OptionSet<PlatformEvent::Modifier> EventHandler::accessKeyModifiers()
-{
-    return PlatformEvent::Modifier::AltKey;
-}
-
-// GTK+ must scroll horizontally if the mouse pointer is on top of the
-// horizontal scrollbar while scrolling with the wheel; we need to
-// add the deltas and ticks here so that this behavior is consistent
-// for styled scrollbars.
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
-{
-    FrameView* view = m_frame.view();
-    Scrollbar* scrollbar = view ? view->scrollbarAtPoint(event.position()) : nullptr;
-    if (!scrollbar)
-        scrollbar = result.scrollbar();
-    return scrollbar && scrollbar->orientation() == HorizontalScrollbar;
-}
-
-}

Deleted: releases/WebKitGTK/webkit-2.18/Source/WebCore/page/wpe/EventHandlerWPE.cpp (223544 => 223545)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/page/wpe/EventHandlerWPE.cpp	2017-10-17 14:29:45 UTC (rev 223544)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/page/wpe/EventHandlerWPE.cpp	2017-10-17 14:34:41 UTC (rev 223545)
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "EventHandler.h"
-
-#include "FocusController.h"
-#include "Frame.h"
-#include "NotImplemented.h"
-#include "Page.h"
-
-namespace WebCore {
-
-bool EventHandler::tabsToAllFormControls(KeyboardEvent&) const
-{
-    notImplemented();
-    return false;
-}
-
-void EventHandler::focusDocumentView()
-{
-    if (Page* page = m_frame.page())
-        page->focusController().setFocusedFrame(&m_frame);
-}
-
-bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget*)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::passMouseDownEventToWidget(Widget*)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::widgetDidHandleWheelEvent(const PlatformWheelEvent&, Widget&)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults&, Frame*)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults&, Frame*, HitTestResult*)
-{
-    notImplemented();
-    return false;
-}
-
-bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&, Frame*)
-{
-    notImplemented();
-    return false;
-}
-
-OptionSet<PlatformEvent::Modifier> EventHandler::accessKeyModifiers()
-{
-    notImplemented();
-    return PlatformEvent::Modifier::AltKey;
-}
-
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const
-{
-    notImplemented();
-    return false;
-}
-
-}

Copied: releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/glib/EventHandlerGLib.cpp (from rev 223544, releases/WebKitGTK/webkit-2.18/Source/WebCore/page/gtk/EventHandlerGtk.cpp) (0 => 223545)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/glib/EventHandlerGLib.cpp	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/glib/EventHandlerGLib.cpp	2017-10-17 14:34:41 UTC (rev 223545)
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <z...@kde.org>
+ * Copyright (C) 2014-2017 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "EventHandler.h"
+
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "KeyboardEvent.h"
+#include "MouseEventWithHitTestResults.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformWheelEvent.h"
+#include "RenderWidget.h"
+
+#if ENABLE(DRAG_SUPPORT)
+#include "DataTransfer.h"
+#endif
+
+#if PLATFORM(GTK)
+#include "Scrollbar.h"
+#endif
+
+namespace WebCore {
+
+#if ENABLE(DRAG_SUPPORT)
+const double EventHandler::TextDragDelay = 0.0;
+#endif
+
+bool EventHandler::tabsToAllFormControls(KeyboardEvent&) const
+{
+    // We always allow tabs to all controls
+    return true;
+}
+
+void EventHandler::focusDocumentView()
+{
+    if (Page* page = m_frame.page())
+        page->focusController().setFocusedFrame(&m_frame);
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
+{
+    // Figure out which view to send the event to.
+    RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : nullptr;
+    if (!is<RenderWidget>(target))
+        return false;
+    return passMouseDownEventToWidget(downcast<RenderWidget>(*target).widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+    return passMouseDownEventToWidget(renderWidget->widget());
+}
+
+bool EventHandler::passMouseDownEventToWidget(Widget*)
+{
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
+{
+    // GTK+ activation is not necessarily tied to mouse events, so it may
+    // not make sense to implement this
+
+    notImplemented();
+    return false;
+}
+
+bool EventHandler::widgetDidHandleWheelEvent(const PlatformWheelEvent& event, Widget& widget)
+{
+    if (!is<FrameView>(widget))
+        return false;
+
+    return downcast<FrameView>(widget).frame().eventHandler().handleWheelEvent(event);
+}
+
+#if ENABLE(DRAG_SUPPORT)
+
+Ref<DataTransfer> EventHandler::createDraggingDataTransfer() const
+{
+    return DataTransfer::createForDrag();
+}
+
+#endif
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    subframe->eventHandler().handleMousePressEvent(mev.event());
+    return true;
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
+{
+    subframe->eventHandler().handleMouseMoveEvent(mev.event(), hoveredNode);
+    return true;
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+    subframe->eventHandler().handleMouseReleaseEvent(mev.event());
+    return true;
+}
+
+OptionSet<PlatformEvent::Modifier> EventHandler::accessKeyModifiers()
+{
+    return PlatformEvent::Modifier::AltKey;
+}
+
+// GTK+ must scroll horizontally if the mouse pointer is on top of the
+// horizontal scrollbar while scrolling with the wheel; we need to
+// add the deltas and ticks here so that this behavior is consistent
+// for styled scrollbars.
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
+{
+#if PLATFORM(GTK)
+    FrameView* view = m_frame.view();
+    Scrollbar* scrollbar = view ? view->scrollbarAtPoint(event.position()) : nullptr;
+    if (!scrollbar)
+        scrollbar = result.scrollbar();
+    return scrollbar && scrollbar->orientation() == HorizontalScrollbar;
+#else
+    UNUSED_PARAM(result);
+    UNUSED_PARAM(event);
+    notImplemented();
+    return false;
+#endif
+}
+
+}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to