Use std::trunc instead of static_cast<int> in mouse_event.h
MouseEvent::screenX, MouseEvent::screenY, MouseEvent::clientX, MouseEvent::clientY, MouseEvent::pageX, MouseEvent::pageY we expose as double in mouse_event.idl [1]. Because of this is safe to use std::trunc instead of static_cast<int> in order to avoid float-cast-overflow. [1] https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/events/mouse_event.idl Bug: 1164520, 1162288 Change-Id: I9aef2eea97090fb61aa28c3bbc03209e1401ee39 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2621675 Commit-Queue: Liviu Tinta <liviutinta@chromium.org> Reviewed-by:Robert Flack <flackr@chromium.org> Reviewed-by:
Mustaq Ahmed <mustaq@chromium.org> Cr-Commit-Position: refs/heads/master@{#843832}
Showing
Please register or sign in to comment