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

Side by Side Diff: ios/web/web_state/js/resources/scroll_workaround.js

Issue 2807213003: Move stringify, form, navigation and scroll methods out of core.js. (Closed)
Patch Set: Re-upload patch after rebase-update in local branch Created 3 years, 8 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview APIs used for the scroll workaround. See crbug.com/554257.
7 */
8
9 goog.provide('__crWeb.scrollWorkaround');
10
11 /** Beginning of anonymous object */
12 (function() {
13
14 /** @private */
15 var webViewScrollViewIsDragging_ = false;
16
17 /**
18 * Tracks whether user is in the middle of scrolling/dragging. If user is
19 * scrolling, ignore window.scrollTo() until user stops scrolling.
20 */
21 __gCrWeb['setWebViewScrollViewIsDragging'] = function(state) {
22 webViewScrollViewIsDragging_ = state;
23 };
24
25 /** @private */
26 var originalWindowScrollTo_ = window.scrollTo;
27
28 /**
29 * Wraps the original window.scrollTo() to suppress it as long as
30 * webViewScrollViewIsDragging is true.
31 */
32 window.scrollTo = function(x, y) {
33 if (webViewScrollViewIsDragging_)
34 return;
35 originalWindowScrollTo_(x, y);
36 };
37
38 }()) // End of anonymouse object
OLDNEW
« no previous file with comments | « ios/web/web_state/js/resources/navigation.js ('k') | ios/web/web_state/js/resources/web_bundle.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698