Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2605193002: Fix mouse wheel over-scrolls when display is scaled and scroll is paginated (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 742
743 m_client->didHandleGestureEvent(event, eventCancelled); 743 m_client->didHandleGestureEvent(event, eventCancelled);
744 return eventResult; 744 return eventResult;
745 default: 745 default:
746 break; 746 break;
747 } 747 }
748 748
749 WebGestureEvent scaledEvent = 749 WebGestureEvent scaledEvent =
750 TransformWebGestureEvent(mainFrameImpl()->frameView(), event); 750 TransformWebGestureEvent(mainFrameImpl()->frameView(), event);
751 751
752 if (event.sourceDevice == WebGestureDeviceTouchpad &&
753 event.type == WebInputEvent::GestureScrollUpdate) {
754 float scaleFactor = client()->GetOriginalDeviceScaleFactor();
chengx 2017/01/06 23:46:36 aelias 2017/01/05 00:55:45 CC impl thread also has
755 scaledEvent.data.scrollUpdate.deltaX /= scaleFactor;
756 scaledEvent.data.scrollUpdate.deltaY /= scaleFactor;
chengx 2017/01/06 23:46:36 Bret: Use client()->convertViewportToWindow() inst
757 }
758
752 // Special handling for double tap and scroll events as we don't want to 759 // Special handling for double tap and scroll events as we don't want to
753 // hit test for them. 760 // hit test for them.
754 switch (event.type) { 761 switch (event.type) {
755 case WebInputEvent::GestureDoubleTap: 762 case WebInputEvent::GestureDoubleTap:
756 if (m_webSettings->doubleTapToZoomEnabled() && 763 if (m_webSettings->doubleTapToZoomEnabled() &&
757 minimumPageScaleFactor() != maximumPageScaleFactor()) { 764 minimumPageScaleFactor() != maximumPageScaleFactor()) {
758 m_client->cancelScheduledContentIntents(); 765 m_client->cancelScheduledContentIntents();
759 animateDoubleTapZoom( 766 animateDoubleTapZoom(
760 flooredIntPoint(scaledEvent.positionInRootFrame())); 767 flooredIntPoint(scaledEvent.positionInRootFrame()));
761 } 768 }
(...skipping 3434 matching lines...) Expand 10 before | Expand all | Expand 10 after
4196 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4203 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4197 return nullptr; 4204 return nullptr;
4198 return focusedFrame; 4205 return focusedFrame;
4199 } 4206 }
4200 4207
4201 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4208 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4202 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4209 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4203 } 4210 }
4204 4211
4205 } // namespace blink 4212 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698