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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1435233002: Remove invert viewport scroll order setting from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix after rebase Created 4 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 // Keep the center-of-pinch anchor in a stable position over the course 246 // Keep the center-of-pinch anchor in a stable position over the course
247 // of the magnify. 247 // of the magnify.
248 FloatPoint anchorAtOldScale = anchor.scaledBy(1.f / oldPageScale); 248 FloatPoint anchorAtOldScale = anchor.scaledBy(1.f / oldPageScale);
249 FloatPoint anchorAtNewScale = anchor.scaledBy(1.f / newPageScale); 249 FloatPoint anchorAtNewScale = anchor.scaledBy(1.f / newPageScale);
250 FloatSize anchorDelta = anchorAtOldScale - anchorAtNewScale; 250 FloatSize anchorDelta = anchorAtOldScale - anchorAtNewScale;
251 251
252 // First try to use the anchor's delta to scroll the FrameView. 252 // First try to use the anchor's delta to scroll the FrameView.
253 FloatSize anchorDeltaUnusedByScroll = anchorDelta; 253 FloatSize anchorDeltaUnusedByScroll = anchorDelta;
254 254
255 if (!frameHost().settings().invertViewportScrollOrder()) {
256 FrameView* view = mainFrame()->view();
257 DoublePoint oldPosition = view->scrollPositionDouble();
258 view->scrollBy(DoubleSize(anchorDelta.width(), anchorDelta.height()), Us erScroll);
259 DoublePoint newPosition = view->scrollPositionDouble();
260 anchorDeltaUnusedByScroll -= toFloatSize(newPosition - oldPosition);
261 }
262
263 // Manually bubble any remaining anchor delta up to the visual viewport. 255 // Manually bubble any remaining anchor delta up to the visual viewport.
264 FloatPoint newLocation(location() + anchorDeltaUnusedByScroll); 256 FloatPoint newLocation(location() + anchorDeltaUnusedByScroll);
265 setScaleAndLocation(newPageScale, newLocation); 257 setScaleAndLocation(newPageScale, newLocation);
266 return true; 258 return true;
267 } 259 }
268 260
269 // Modifies the top of the graphics layer tree to add layers needed to support 261 // Modifies the top of the graphics layer tree to add layers needed to support
270 // the inner/outer viewport fixed-position model for pinch zoom. When finished, 262 // the inner/outer viewport fixed-position model for pinch zoom. When finished,
271 // the tree will look like this (with * denoting added layers): 263 // the tree will look like this (with * denoting added layers):
272 // 264 //
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 } else if (graphicsLayer == m_rootTransformLayer) { 739 } else if (graphicsLayer == m_rootTransformLayer) {
748 name = "Root Transform Layer"; 740 name = "Root Transform Layer";
749 } else { 741 } else {
750 ASSERT_NOT_REACHED(); 742 ASSERT_NOT_REACHED();
751 } 743 }
752 744
753 return name; 745 return name;
754 } 746 }
755 747
756 } // namespace blink 748 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698