Title: [230074] trunk/Source/WebKit
Revision
230074
Author
commit-qu...@webkit.org
Date
2018-03-29 08:38:29 -0700 (Thu, 29 Mar 2018)

Log Message

[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: trunk/Source/WebKit/ChangeLog (230073 => 230074)


--- trunk/Source/WebKit/ChangeLog	2018-03-29 15:01:48 UTC (rev 230073)
+++ trunk/Source/WebKit/ChangeLog	2018-03-29 15:38:29 UTC (rev 230074)
@@ -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-28  Zalan Bujtas  <za...@apple.com>
 
         Make it possible to override the screen size

Modified: trunk/Source/WebKit/Shared/wpe/WebEventFactory.cpp (230073 => 230074)


--- trunk/Source/WebKit/Shared/wpe/WebEventFactory.cpp	2018-03-29 15:01:48 UTC (rev 230073)
+++ trunk/Source/WebKit/Shared/wpe/WebEventFactory.cpp	2018-03-29 15:38:29 UTC (rev 230074)
@@ -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