WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-177449-20171002215004.patch (text/plain), 15.58 KB, created by
Michael Catanzaro
on 2017-10-02 12:50:05 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Michael Catanzaro
Created:
2017-10-02 12:50:05 PDT
Size:
15.58 KB
patch
obsolete
>Subversion Revision: 222726 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0902852c962a00b336a9ae21edc610156dbf432c..850b11656a4d46a26f6cc115124d92de28ae464a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2017-10-02 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ * 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): >+ > 2017-10-02 Antti Koivisto <antti@apple.com> > > Crashes with guard malloc under RenderFullScreen::unwrapRenderer >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 2b97e7050ab2c787d615850a2e95502467ef34be..12d3612ce8efd2db9d0fd563f065bbf20da076f2 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,22 @@ >+2017-10-02 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ * 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): >+ > 2017-10-02 Alex Christensen <achristensen@webkit.org> > > Expose more WKPreferences SPI to match C SPI >diff --git a/Source/WebCore/platform/gtk/GtkUtilities.cpp b/Source/WebCore/platform/gtk/GtkUtilities.cpp >index 1dc0c14c5e9dbaca13b6fe0fcf9355b940f270f7..4c48bd1d3ec29b0cddd22c8231064b38a367b8a7 100644 >--- a/Source/WebCore/platform/gtk/GtkUtilities.cpp >+++ b/Source/WebCore/platform/gtk/GtkUtilities.cpp >@@ -54,6 +54,16 @@ bool widgetIsOnscreenToplevelWindow(GtkWidget* widget) > return widget && gtk_widget_is_toplevel(widget) && GTK_IS_WINDOW(widget) && !GTK_IS_OFFSCREEN_WINDOW(widget); > } > >+template<> >+WallTime wallTimeForEvent(const GdkEvent* event) >+{ >+ // This works if and only if the X server or Wayland compositor happens to >+ // be using CLOCK_MONOTONIC for its monotonic time, and so long as >+ // g_get_monotonic_time() continues to do so as well, and so long as >+ // WTF::MonotonicTime continues to use g_get_monotonic_time(). >+ return MonotonicTime::fromRawSeconds(gdk_event_get_time(event) / 1000.).approximateWallTime(); >+} >+ > #if ENABLE(DEVELOPER_MODE) > static CString topLevelPath() > { >diff --git a/Source/WebCore/platform/gtk/GtkUtilities.h b/Source/WebCore/platform/gtk/GtkUtilities.h >index 032dfd31a88724018997dfb615ec8630e5754ef9..511e6014feb303edfc9e7b36889a3d40f844601a 100644 >--- a/Source/WebCore/platform/gtk/GtkUtilities.h >+++ b/Source/WebCore/platform/gtk/GtkUtilities.h >@@ -19,6 +19,8 @@ > #ifndef GtkUtilities_h > #define GtkUtilities_h > >+#include <wtf/MonotonicTime.h> >+#include <wtf/WallTime.h> > #include <wtf/text/CString.h> > > namespace WebCore { >@@ -28,6 +30,12 @@ class IntPoint; > IntPoint convertWidgetPointToScreenPoint(GtkWidget*, const IntPoint&); > bool widgetIsOnscreenToplevelWindow(GtkWidget*); > >+template<typename GdkEventType> >+WallTime wallTimeForEvent(const GdkEventType* event) { return MonotonicTime::fromRawSeconds(event->time / 1000.).approximateWallTime(); } >+ >+template<> >+WallTime wallTimeForEvent(const GdkEvent*); >+ > #if ENABLE(DEVELOPER_MODE) > CString webkitBuildDirectory(); > #endif >diff --git a/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp b/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp >index 4fc13becc3ab2d61aed44b9fe8c2a1718e0f1f16..23e7c3c03c84fcfd0716d20fdc3ae23e077cd2b3 100644 >--- a/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformKeyboardEventGtk.cpp >@@ -30,6 +30,7 @@ > #include "config.h" > #include "PlatformKeyboardEvent.h" > >+#include "GtkUtilities.h" > #include "GtkVersioning.h" > #include "NotImplemented.h" > #include "TextEncoding.h" >@@ -1259,7 +1260,7 @@ static OptionSet<PlatformEvent::Modifier> modifiersForGdkKeyEvent(GdkEventKey* e > > // Keep this in sync with the other platform event constructors > PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event, const CompositionResults& compositionResults) >- : PlatformEvent(eventTypeForGdkKeyEvent(event), modifiersForGdkKeyEvent(event), WallTime::now()) >+ : PlatformEvent(eventTypeForGdkKeyEvent(event), modifiersForGdkKeyEvent(event), wallTimeForEvent(event)) > , m_text(compositionResults.simpleString.length() ? compositionResults.simpleString : singleCharacterString(event->keyval)) > , m_unmodifiedText(m_text) > , m_key(keyValueForGdkKeyCode(event->keyval)) >diff --git a/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp b/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp >index ec91afeef7a5bf1da05e9492bab026c4dd0a9a80..e90204aef61d63fd412df54434341ea178eb2ce4 100644 >--- a/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformMouseEventGtk.cpp >@@ -27,6 +27,7 @@ > #include "config.h" > #include "PlatformMouseEvent.h" > >+#include "GtkUtilities.h" > #include "PlatformKeyboardEvent.h" > #include <gdk/gdk.h> > #include <wtf/Assertions.h> >@@ -38,7 +39,7 @@ namespace WebCore { > // Keep this in sync with the other platform event constructors > PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event) > { >- m_timestamp = WallTime::fromRawSeconds(event->time); >+ m_timestamp = wallTimeForEvent(event); > m_position = IntPoint((int)event->x, (int)event->y); > m_globalPosition = IntPoint((int)event->x_root, (int)event->y_root); > m_button = NoButton; >@@ -87,7 +88,7 @@ PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event) > > PlatformMouseEvent::PlatformMouseEvent(GdkEventMotion* motion) > { >- m_timestamp = WallTime::fromRawSeconds(motion->time); >+ m_timestamp = wallTimeForEvent(motion); > m_position = IntPoint((int)motion->x, (int)motion->y); > m_globalPosition = IntPoint((int)motion->x_root, (int)motion->y_root); > m_button = NoButton; >diff --git a/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp b/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp >index 4e6d792520c48471778c9933ea6254921470af70..3ae1dadbee4ca5f87de5e1b1981b36678aa977de 100644 >--- a/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp >+++ b/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp >@@ -29,6 +29,7 @@ > #include "PlatformWheelEvent.h" > > #include "FloatPoint.h" >+#include "GtkUtilities.h" > #include "PlatformKeyboardEvent.h" > #include "Scrollbar.h" > #include <gdk/gdk.h> >@@ -43,7 +44,7 @@ PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event) > static const float delta = 1; > > m_type = PlatformEvent::Wheel; >- m_timestamp = WallTime::now(); >+ m_timestamp = wallTimeForEvent(event); > > if (event->state & GDK_SHIFT_MASK) > m_modifiers |= Modifier::ShiftKey; >diff --git a/Source/WebKit/Shared/gtk/WebEventFactory.cpp b/Source/WebKit/Shared/gtk/WebEventFactory.cpp >index bcea329d2283ca984566637a1d8d75d516084a8c..c19b192c13d9258ae66c4a6e71617522e48ab32f 100644 >--- a/Source/WebKit/Shared/gtk/WebEventFactory.cpp >+++ b/Source/WebKit/Shared/gtk/WebEventFactory.cpp >@@ -31,6 +31,7 @@ > #include "PlatformKeyboardEvent.h" > #include "Scrollbar.h" > #include "WindowsKeyboardCodes.h" >+#include <WebCore/GtkUtilities.h> > #include <WebCore/GtkVersioning.h> > #include <gdk/gdk.h> > #include <gdk/gdkkeysyms.h> >@@ -132,15 +133,15 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(const GdkEvent* event, int cu > } > > return WebMouseEvent(type, >- buttonForEvent(event), >- IntPoint(x, y), >- IntPoint(xRoot, yRoot), >- 0 /* deltaX */, >- 0 /* deltaY */, >- 0 /* deltaZ */, >- currentClickCount, >- modifiersForEvent(event), >- WallTime::fromRawSeconds(gdk_event_get_time(event))); >+ buttonForEvent(event), >+ IntPoint(x, y), >+ IntPoint(xRoot, yRoot), >+ 0 /* deltaX */, >+ 0 /* deltaY */, >+ 0 /* deltaZ */, >+ currentClickCount, >+ modifiersForEvent(event), >+ wallTimeForEvent(event)); > } > > WebWheelEvent WebEventFactory::createWebWheelEvent(const GdkEvent* event) >@@ -210,7 +211,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(const GdkEvent* event, WebWhe > momentumPhase, > WebWheelEvent::ScrollByPixelWheelEvent, > modifiersForEvent(event), >- WallTime::fromRawSeconds(gdk_event_get_time(event))); >+ wallTimeForEvent(event)); > } > > WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const GdkEvent* event, const WebCore::CompositionResults& compositionResults, Vector<String>&& commands) >@@ -227,7 +228,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(const GdkEvent* event, > WTFMove(commands), > isGdkKeyCodeFromKeyPad(event->key.keyval), > modifiersForEvent(event), >- WallTime::fromRawSeconds(gdk_event_get_time(event))); >+ wallTimeForEvent(event)); > } > > #if ENABLE(TOUCH_EVENTS) >@@ -249,7 +250,7 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(const GdkEvent* event, Vector > ASSERT_NOT_REACHED(); > } > >- return WebTouchEvent(type, WTFMove(touchPoints), modifiersForEvent(event), WallTime::fromRawSeconds(gdk_event_get_time(event))); >+ return WebTouchEvent(type, WTFMove(touchPoints), modifiersForEvent(event), wallTimeForEvent(event)); > #else > return WebTouchEvent(); > #endif // GTK_API_VERSION_2 >diff --git a/Source/WebKit/Shared/wpe/WebEventFactory.cpp b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >index 94741306633a83a94e40dc80e45b99d99e5b17a4..cc155a5583cf00884357f3eb830d105e28e627a9 100644 >--- a/Source/WebKit/Shared/wpe/WebEventFactory.cpp >+++ b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >@@ -72,6 +72,16 @@ static String identifierStringForKeyEvent(struct wpe_input_keyboard_event* event > return String::format("U+%04X", event->unicode); > } > >+WallTime wallTimeForEventTime(uint64_t timestamp) >+{ >+ // This works if and only if the WPE backend uses CLOCK_MONOTONIC for its >+ // event timestamps, and so long as g_get_monotonic_time() continues to do >+ // so as well, and so long as WTF::MonotonicTime continues to use >+ // g_get_monotonic_time(). It also assumes the event timestamp is in >+ // milliseconds. >+ return MonotonicTime::fromRawSeconds(timestamp / 1000.).approximateWallTime(); >+} >+ > WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboard_event* event) > { > String singleCharacterString = singleCharacterStringForKeyEvent(event); >@@ -81,7 +91,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboa > singleCharacterString, singleCharacterString, identifierString, > wpe_input_windows_key_code_for_key_event(wpe_input_key_mapper_get_singleton(), event), > event->keyCode, 0, false, false, false, >- modifiersForEvent(event), WallTime::fromRawSeconds(event->time)); >+ modifiersForEvent(event), wallTimeForEventTime(event->time)); > } > > WebMouseEvent WebEventFactory::createWebMouseEvent(struct wpe_input_pointer_event* event, float deviceScaleFactor) >@@ -119,7 +129,7 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(struct wpe_input_pointer_even > WebCore::IntPoint position(event->x, event->y); > position.scale(1 / deviceScaleFactor); > return WebMouseEvent(type, button, position, position, >- 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), WallTime::fromRawSeconds(event->time)); >+ 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), wallTimeForEventTime(event->time)); > } > > WebWheelEvent WebEventFactory::createWebWheelEvent(struct wpe_input_axis_event* event, float deviceScaleFactor) >@@ -154,7 +164,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(struct wpe_input_axis_event* > WebCore::IntPoint position(event->x, event->y); > position.scale(1 / deviceScaleFactor); > return WebWheelEvent(WebEvent::Wheel, position, position, >- delta, wheelTicks, WebWheelEvent::ScrollByPixelWheelEvent, static_cast<WebEvent::Modifiers>(0), WallTime::fromRawSeconds(event->time)); >+ delta, wheelTicks, WebWheelEvent::ScrollByPixelWheelEvent, static_cast<WebEvent::Modifiers>(0), wallTimeForEventTime(event->time)); > } > > static WebKit::WebPlatformTouchPoint::TouchPointState stateForTouchPoint(int mainEventId, const struct wpe_input_touch_event_raw* point) >@@ -209,7 +219,7 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(struct wpe_input_touch_event* > pointCoordinates, pointCoordinates)); > } > >- return WebTouchEvent(type, WTFMove(touchPoints), WebEvent::Modifiers(0), WallTime::fromRawSeconds(event->time)); >+ return WebTouchEvent(type, WTFMove(touchPoints), WebEvent::Modifiers(0), wallTimeForEventTime(event->time)); > } > > } // namespace WebKit >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 87ebca0aa4ca829ad4ff497a1aaac377ed9c4389..2ac4f5ad77e32a0800ad4b87b2cc1248e25f32c5 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2017-10-02 Michael Catanzaro <mcatanzaro@igalia.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ * platform/gtk/TestExpectations: >+ > 2017-10-02 Matt Lewis <jlewis3@apple.com> > > Rebaseline of js/dom/global-constructors-attributes-dedicated-worker.html after r222692. >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index 32c77b006eec40169e7b31bdb4285ce287c21320..9428cd73a54add59c01cdd2ad50a3e484a4a44ab 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -3449,16 +3449,6 @@ webkit.org/b/175661 inspector/worker/resources-in-worker.html [ Failure ] > > webkit.org/b/175662 inspector/canvas/recording-2d.html [ Failure ] > >-webkit.org/b/177449 fast/forms/ValidityState-valueMissing-002.html [ Failure ] >-webkit.org/b/177449 fast/forms/listbox-selection-after-typeahead.html [ Failure ] >-webkit.org/b/177449 fast/forms/listbox-typeahead-scroll.html [ Failure ] >-webkit.org/b/177449 fast/forms/onchange-select-check-validity.html [ Failure ] >-webkit.org/b/177449 fast/forms/select-double-onchange.html [ Failure ] >-webkit.org/b/177449 fast/forms/select-script-onchange.html [ Failure ] >-webkit.org/b/177449 fast/forms/select/menulist-oninput-fired.html [ Failure ] >-webkit.org/b/177449 fast/forms/select/select-disabled.html [ Failure ] >-webkit.org/b/177449 fast/events/popup-when-select-change.html [ Timeout Crash ] >- > #//////////////////////////////////////////////////////////////////////////////////////// > # End of non-crashing, non-flaky tests failing > #////////////////////////////////////////////////////////////////////////////////////////
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 177449
:
321731
|
321736
|
321746
|
321823
|
321825
|
322399
|
322413
|
322534
|
322639
|
322662