[Webkit-unassigned] [Bug 155858] Autoscrolling from a drag selection does not work in full screen, or when the window is against the screen edge
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Mar 25 12:53:40 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=155858
Simon Fraser (smfr) <simon.fraser at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #274927|review? |review-
Flags| |
--- Comment #7 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 274927
--> https://bugs.webkit.org/attachment.cgi?id=274927
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=274927&action=review
> Source/WebCore/page/mac/EventHandlerMac.mm:1149
> + CGFloat screenLeftEdge = screenRect.x();
> + CGFloat insetScreenLeftEdge = screenLeftEdge + EDGE_DISTANCE_THRESHOLD;
> + CGFloat screenRightEdge = screenLeftEdge + screenRect.width();
> + CGFloat insetScreenRightEdge = screenRightEdge - EDGE_DISTANCE_THRESHOLD;
> + if (screenPoint.x() >= screenLeftEdge && screenPoint.x() < insetScreenLeftEdge) {
> + CGFloat distanceFromEdge = screenPoint.x() - screenLeftEdge - EDGE_DISTANCE_THRESHOLD;
> + if (distanceFromEdge < 0)
> + adjustmentFactor.setWidth((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + } else if (screenPoint.x() >= insetScreenRightEdge && screenPoint.x() < screenRightEdge) {
> + CGFloat distanceFromEdge = EDGE_DISTANCE_THRESHOLD - (screenRightEdge - screenPoint.x());
> + if (distanceFromEdge > 0)
> + adjustmentFactor.setWidth((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + }
> +
> + CGFloat screenTopEdge = screenRect.y();
> + CGFloat insetScreenTopEdge = screenTopEdge + EDGE_DISTANCE_THRESHOLD;
> + CGFloat screenBottomEdge = screenTopEdge + screenRect.height();
> + CGFloat insetScreenBottomEdge = screenBottomEdge - EDGE_DISTANCE_THRESHOLD;
> +
> + if (screenPoint.y() >= screenTopEdge && screenPoint.y() < insetScreenTopEdge) {
> + CGFloat distanceFromEdge = screenPoint.y() - screenTopEdge - EDGE_DISTANCE_THRESHOLD;
> + if (distanceFromEdge < 0)
> + adjustmentFactor.setHeight((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + } else if (screenPoint.y() >= insetScreenBottomEdge && screenPoint.y() < screenBottomEdge) {
> + CGFloat distanceFromEdge = EDGE_DISTANCE_THRESHOLD - (screenBottomEdge - screenPoint.y());
> + if (distanceFromEdge > 0)
> + adjustmentFactor.setHeight((distanceFromEdge / EDGE_DISTANCE_THRESHOLD) * PIXELS_MULTIPLIER);
> + }
I think you should do all this with floats. No reason to use CG types here.
You can also use screenRect.maxX() etc rather than left + width.
> Source/WebCore/platform/ios/PlatformScreenIOS.mm:127
> + return FloatRect([[getUIScreenClass() mainScreen] _referenceBounds]);
Don't we have an implicit conversions from CGRect to FloatRect?
> Source/WebKit2/UIProcess/WebPageProxy.cpp:2342
> + m_process->send(Messages::WebPage::WindowScreenDidChange(displayID, screenRect), m_pageID);
I'm not sure why you have to pass a screenRect here. Wen can get the screen rect from the displayID in the web process.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160325/fb65a9c9/attachment.html>
More information about the webkit-unassigned
mailing list