Changeset 222776 in webkit


Ignore:
Timestamp:
Oct 3, 2017 2:50:06 AM (7 years ago)
Author:
Michael Catanzaro
Message:

REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
https://bugs.webkit.org/show_bug.cgi?id=177449

Reviewed by Chris Dumez.

Source/WebCore:

  • platform/gtk/GtkUtilities.cpp:

(WebCore::wallTimeForEvent):

  • platform/gtk/GtkUtilities.h:

(WebCore::wallTimeForEvent):

  • platform/gtk/PlatformKeyboardEventGtk.cpp:

(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):

  • platform/gtk/PlatformMouseEventGtk.cpp:

(WebCore::PlatformMouseEvent::PlatformMouseEvent):

  • platform/gtk/PlatformWheelEventGtk.cpp:

(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

  • Shared/gtk/WebEventFactory.cpp:

(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebTouchEvent):

  • Shared/wpe/WebEventFactory.cpp:

(WebKit::wallTimeForEventTime):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebTouchEvent):

LayoutTests:

  • platform/gtk/TestExpectations:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r222768 r222776  
     12017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
     4        https://bugs.webkit.org/show_bug.cgi?id=177449
     5
     6        Reviewed by Chris Dumez.
     7
     8        * platform/gtk/TestExpectations:
     9
    1102017-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>
    211
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r222644 r222776  
    34503450webkit.org/b/175662 inspector/canvas/recording-2d.html [ Failure ]
    34513451
    3452 webkit.org/b/177449 fast/forms/ValidityState-valueMissing-002.html [ Failure ]
    3453 webkit.org/b/177449 fast/forms/listbox-selection-after-typeahead.html [ Failure ]
    3454 webkit.org/b/177449 fast/forms/listbox-typeahead-scroll.html [ Failure ]
    3455 webkit.org/b/177449 fast/forms/onchange-select-check-validity.html [ Failure ]
    3456 webkit.org/b/177449 fast/forms/select-double-onchange.html [ Failure ]
    3457 webkit.org/b/177449 fast/forms/select-script-onchange.html [ Failure ]
    3458 webkit.org/b/177449 fast/forms/select/menulist-oninput-fired.html [ Failure ]
    3459 webkit.org/b/177449 fast/forms/select/select-disabled.html [ Failure ]
    3460 webkit.org/b/177449 fast/events/popup-when-select-change.html [ Timeout Crash ]
    3461 
    34623452#////////////////////////////////////////////////////////////////////////////////////////
    34633453# End of non-crashing, non-flaky tests failing
  • trunk/Source/WebCore/ChangeLog

    r222774 r222776  
     12017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
     4        https://bugs.webkit.org/show_bug.cgi?id=177449
     5
     6        Reviewed by Chris Dumez.
     7
     8        * platform/gtk/GtkUtilities.cpp:
     9        (WebCore::wallTimeForEvent):
     10        * platform/gtk/GtkUtilities.h:
     11        (WebCore::wallTimeForEvent):
     12        * platform/gtk/PlatformKeyboardEventGtk.cpp:
     13        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
     14        * platform/gtk/PlatformMouseEventGtk.cpp:
     15        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
     16        * platform/gtk/PlatformWheelEventGtk.cpp:
     17        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
     18
    1192017-10-03  Youenn Fablet  <youenn@apple.com>
    220
  • trunk/Source/WebCore/platform/gtk/GtkUtilities.cpp

    r197062 r222776  
    5555}
    5656
     57template<>
     58WallTime wallTimeForEvent(const GdkEvent* event)
     59{
     60    // This works if and only if the X server or Wayland compositor happens to
     61    // be using CLOCK_MONOTONIC for its monotonic time, and so long as
     62    // g_get_monotonic_time() continues to do so as well, and so long as
     63    // WTF::MonotonicTime continues to use g_get_monotonic_time().
     64    return MonotonicTime::fromRawSeconds(gdk_event_get_time(event) / 1000.).approximateWallTime();
     65}
     66
    5767#if ENABLE(DEVELOPER_MODE)
    5868static CString topLevelPath()
  • trunk/Source/WebCore/platform/gtk/GtkUtilities.h

    r184010 r222776  
    2020#define GtkUtilities_h
    2121
     22#include <wtf/MonotonicTime.h>
     23#include <wtf/WallTime.h>
    2224#include <wtf/text/CString.h>
    2325
     
    2931bool widgetIsOnscreenToplevelWindow(GtkWidget*);
    3032
     33template<typename GdkEventType>
     34WallTime wallTimeForEvent(const GdkEventType* event) { return MonotonicTime::fromRawSeconds(event->time / 1000.).approximateWallTime(); }
     35
     36template<>
     37WallTime wallTimeForEvent(const GdkEvent*);
     38
    3139#if ENABLE(DEVELOPER_MODE)
    3240CString webkitBuildDirectory();
  • trunk/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp

    r222392 r222776  
    3131#include "PlatformKeyboardEvent.h"
    3232
     33#include "GtkUtilities.h"
    3334#include "GtkVersioning.h"
    3435#include "NotImplemented.h"
     
    12601261// Keep this in sync with the other platform event constructors
    12611262PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event, const CompositionResults& compositionResults)
    1262     : PlatformEvent(eventTypeForGdkKeyEvent(event), modifiersForGdkKeyEvent(event), WallTime::now())
     1263    : PlatformEvent(eventTypeForGdkKeyEvent(event), modifiersForGdkKeyEvent(event), wallTimeForEvent(event))
    12631264    , m_text(compositionResults.simpleString.length() ? compositionResults.simpleString : singleCharacterString(event->keyval))
    12641265    , m_unmodifiedText(m_text)
  • trunk/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp

    r222392 r222776  
    2828#include "PlatformMouseEvent.h"
    2929
     30#include "GtkUtilities.h"
    3031#include "PlatformKeyboardEvent.h"
    3132#include <gdk/gdk.h>
     
    3940PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event)
    4041{
    41     m_timestamp = WallTime::fromRawSeconds(event->time);
     42    m_timestamp = wallTimeForEvent(event);
    4243    m_position = IntPoint((int)event->x, (int)event->y);
    4344    m_globalPosition = IntPoint((int)event->x_root, (int)event->y_root);
     
    8889PlatformMouseEvent::PlatformMouseEvent(GdkEventMotion* motion)
    8990{
    90     m_timestamp = WallTime::fromRawSeconds(motion->time);
     91    m_timestamp = wallTimeForEvent(motion);
    9192    m_position = IntPoint((int)motion->x, (int)motion->y);
    9293    m_globalPosition = IntPoint((int)motion->x_root, (int)motion->y_root);
  • trunk/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp

    r222392 r222776  
    3030
    3131#include "FloatPoint.h"
     32#include "GtkUtilities.h"
    3233#include "PlatformKeyboardEvent.h"
    3334#include "Scrollbar.h"
     
    4445
    4546    m_type = PlatformEvent::Wheel;
    46     m_timestamp = WallTime::now();
     47    m_timestamp = wallTimeForEvent(event);
    4748
    4849    if (event->state & GDK_SHIFT_MASK)
  • trunk/Source/WebKit/ChangeLog

    r222772 r222776  
     12017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
     4        https://bugs.webkit.org/show_bug.cgi?id=177449
     5
     6        Reviewed by Chris Dumez.
     7
     8        * Shared/gtk/WebEventFactory.cpp:
     9        (WebKit::WebEventFactory::createWebMouseEvent):
     10        (WebKit::WebEventFactory::createWebWheelEvent):
     11        (WebKit::WebEventFactory::createWebKeyboardEvent):
     12        (WebKit::WebEventFactory::createWebTouchEvent):
     13        * Shared/wpe/WebEventFactory.cpp:
     14        (WebKit::wallTimeForEventTime):
     15        (WebKit::WebEventFactory::createWebKeyboardEvent):
     16        (WebKit::WebEventFactory::createWebMouseEvent):
     17        (WebKit::WebEventFactory::createWebWheelEvent):
     18        (WebKit::WebEventFactory::createWebTouchEvent):
     19
    1202017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
    221
  • trunk/Source/WebKit/Shared/gtk/WebEventFactory.cpp

    r222392 r222776  
    3232#include "Scrollbar.h"
    3333#include "WindowsKeyboardCodes.h"
     34#include <WebCore/GtkUtilities.h>
    3435#include <WebCore/GtkVersioning.h>
    3536#include <gdk/gdk.h>
     
    133134
    134135    return WebMouseEvent(type,
    135                          buttonForEvent(event),
    136                          IntPoint(x, y),
    137                          IntPoint(xRoot, yRoot),
    138                          0 /* deltaX */,
    139                          0 /* deltaY */,
    140                          0 /* deltaZ */,
    141                          currentClickCount,
    142                          modifiersForEvent(event),
    143                          WallTime::fromRawSeconds(gdk_event_get_time(event)));
     136        buttonForEvent(event),
     137        IntPoint(x, y),
     138        IntPoint(xRoot, yRoot),
     139        0 /* deltaX */,
     140        0 /* deltaY */,
     141        0 /* deltaZ */,
     142        currentClickCount,
     143        modifiersForEvent(event),
     144        wallTimeForEvent(event));
    144145}
    145146
     
    211212        WebWheelEvent::ScrollByPixelWheelEvent,
    212213        modifiersForEvent(event),
    213         WallTime::fromRawSeconds(gdk_event_get_time(event)));
     214        wallTimeForEvent(event));
    214215}
    215216
     
    228229        isGdkKeyCodeFromKeyPad(event->key.keyval),
    229230        modifiersForEvent(event),
    230         WallTime::fromRawSeconds(gdk_event_get_time(event)));
     231        wallTimeForEvent(event));
    231232}
    232233
     
    250251    }
    251252
    252     return WebTouchEvent(type, WTFMove(touchPoints), modifiersForEvent(event), WallTime::fromRawSeconds(gdk_event_get_time(event)));
     253    return WebTouchEvent(type, WTFMove(touchPoints), modifiersForEvent(event), wallTimeForEvent(event));
    253254#else
    254255    return WebTouchEvent();
  • trunk/Source/WebKit/Shared/wpe/WebEventFactory.cpp

    r222392 r222776  
    7373}
    7474
     75WallTime wallTimeForEventTime(uint64_t timestamp)
     76{
     77    // This works if and only if the WPE backend uses CLOCK_MONOTONIC for its
     78    // event timestamps, and so long as g_get_monotonic_time() continues to do
     79    // so as well, and so long as WTF::MonotonicTime continues to use
     80    // g_get_monotonic_time(). It also assumes the event timestamp is in
     81    // milliseconds.
     82    return MonotonicTime::fromRawSeconds(timestamp / 1000.).approximateWallTime();
     83}
     84
    7585WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboard_event* event)
    7686{
     
    8292        wpe_input_windows_key_code_for_key_event(wpe_input_key_mapper_get_singleton(), event),
    8393        event->keyCode, 0, false, false, false,
    84         modifiersForEvent(event), WallTime::fromRawSeconds(event->time));
     94        modifiersForEvent(event), wallTimeForEventTime(event->time));
    8595}
    8696
     
    120130    position.scale(1 / deviceScaleFactor);
    121131    return WebMouseEvent(type, button, position, position,
    122         0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), WallTime::fromRawSeconds(event->time));
     132        0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), wallTimeForEventTime(event->time));
    123133}
    124134
     
    155165    position.scale(1 / deviceScaleFactor);
    156166    return WebWheelEvent(WebEvent::Wheel, position, position,
    157         delta, wheelTicks, WebWheelEvent::ScrollByPixelWheelEvent, static_cast<WebEvent::Modifiers>(0), WallTime::fromRawSeconds(event->time));
     167        delta, wheelTicks, WebWheelEvent::ScrollByPixelWheelEvent, static_cast<WebEvent::Modifiers>(0), wallTimeForEventTime(event->time));
    158168}
    159169
     
    210220    }
    211221
    212     return WebTouchEvent(type, WTFMove(touchPoints), WebEvent::Modifiers(0), WallTime::fromRawSeconds(event->time));
     222    return WebTouchEvent(type, WTFMove(touchPoints), WebEvent::Modifiers(0), wallTimeForEventTime(event->time));
    213223}
    214224
Note: See TracChangeset for help on using the changeset viewer.