Changeset 230420 in webkit


Ignore:
Timestamp:
Apr 9, 2018 6:00:10 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

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

Patch by Carlos Eduardo Ramalho <cadubentzen@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.

Location:
releases/WebKitGTK/webkit-2.20/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog

    r230416 r230420  
     12018-03-29  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
     2
     3        [WPE] Floating point exception in WebEventFactory::createWebWheelEvent
     4        https://bugs.webkit.org/show_bug.cgi?id=184037
     5
     6        Reviewed by Žan Doberšek.
     7
     8        * Shared/wpe/WebEventFactory.cpp:
     9        (WebKit::WebEventFactory::createWebWheelEvent): Use std::copysign() to avoid division by 0.
     10
    1112018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
    212
  • releases/WebKitGTK/webkit-2.20/Source/WebKit/Shared/wpe/WebEventFactory.cpp

    r224274 r230420  
    2828
    2929#include <WebCore/Scrollbar.h>
    30 #include <cstdlib>
     30#include <cmath>
    3131#include <wpe/input.h>
    3232#include <wtf/glib/GUniquePtr.h>
     
    146146    switch (event->axis) {
    147147    case Vertical:
    148         wheelTicks = WebCore::FloatSize(0, event->value / std::abs(event->value));
     148        wheelTicks = WebCore::FloatSize(0, std::copysign(1, event->value));
    149149        delta = wheelTicks;
    150150        delta.scale(WebCore::Scrollbar::pixelsPerLineStep());
    151151        break;
    152152    case Horizontal:
    153         wheelTicks = WebCore::FloatSize(event->value / std::abs(event->value), 0);
     153        wheelTicks = WebCore::FloatSize(std::copysign(1, event->value), 0);
    154154        delta = wheelTicks;
    155155        delta.scale(WebCore::Scrollbar::pixelsPerLineStep());
Note: See TracChangeset for help on using the changeset viewer.