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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 1752043002: Merged FrameView and LayoutBox scrolling in EventHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@invertScrollCustomizationPath
Patch Set: Fixes for layout tests breaks Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index a669f98e0caa9a8c95eb96165f7e766d352d2238..817e40a9c7be61b1cf83a77543fa692e7ee23336 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -781,7 +781,7 @@ ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const F
FloatSize remainingDelta = delta;
// If this is main frame, allow top controls to scroll first.
- if (shouldScrollTopControls(delta))
+ if (shouldScrollTopControls(granularity, delta))
remainingDelta = host()->topControls().scrollBy(remainingDelta);
if (remainingDelta.isZero())
@@ -794,11 +794,14 @@ ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const F
return result;
}
-bool LocalFrame::shouldScrollTopControls(const FloatSize& delta) const
+bool LocalFrame::shouldScrollTopControls(ScrollGranularity granularity, const FloatSize& delta) const
{
if (!isMainFrame())
return false;
+ if (granularity != ScrollByPixel && granularity != ScrollByPrecisePixel)
+ return false;
+
// Always give the delta to the top controls if the scroll is in
// the direction to show the top controls. If it's in the
// direction to hide the top controls, only give the delta to the

Powered by Google App Engine
This is Rietveld 408576698