Title: [230420] releases/WebKitGTK/webkit-2.20/Source/WebKit
Revision
230420
Author
carlo...@webkit.org
Date
2018-04-09 06:00:10 -0700 (Mon, 09 Apr 2018)

Log Message

Merge r230074 - [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
https://bugs.webkit.org/show_bug.cgi?id=184037

Patch by Carlos Eduardo Ramalho <cadubent...@gmail.com> on 2018-03-29
Reviewed by Žan Doberšek.

* Shared/wpe/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog (230419 => 230420)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-04-09 13:00:05 UTC (rev 230419)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-04-09 13:00:10 UTC (rev 230420)
@@ -1,3 +1,13 @@
+2018-03-29  Carlos Eduardo Ramalho  <cadubent...@gmail.com>
+
+        [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
+        https://bugs.webkit.org/show_bug.cgi?id=184037
+
+        Reviewed by Žan Doberšek.
+
+        * Shared/wpe/WebEventFactory.cpp:
+        (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.
+
 2018-03-25  Michael Catanzaro  <mcatanz...@igalia.com>
 
         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/Shared/wpe/WebEventFactory.cpp (230419 => 230420)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/Shared/wpe/WebEventFactory.cpp	2018-04-09 13:00:05 UTC (rev 230419)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/Shared/wpe/WebEventFactory.cpp	2018-04-09 13:00:10 UTC (rev 230420)
@@ -27,7 +27,7 @@
 #include "WebEventFactory.h"
 
 #include <WebCore/Scrollbar.h>
-#include <cstdlib>
+#include <cmath>
 #include <wpe/input.h>
 #include <wtf/glib/GUniquePtr.h>
 
@@ -145,12 +145,12 @@
     WebCore::FloatSize delta;
     switch (event->axis) {
     case Vertical:
-        wheelTicks = WebCore::FloatSize(0, event->value / std::abs(event->value));
+        wheelTicks = WebCore::FloatSize(0, std::copysign(1, event->value));
         delta = wheelTicks;
         delta.scale(WebCore::Scrollbar::pixelsPerLineStep());
         break;
     case Horizontal:
-        wheelTicks = WebCore::FloatSize(event->value / std::abs(event->value), 0);
+        wheelTicks = WebCore::FloatSize(std::copysign(1, event->value), 0);
         delta = wheelTicks;
         delta.scale(WebCore::Scrollbar::pixelsPerLineStep());
         break;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to