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

Unified Diff: ios/web_view/public/cwv_scroll_view.h

Issue 2842953002: Implement CWVWebView.scrollView. (Closed)
Patch Set: Apply review comments. 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 side-by-side diff with in-line comments
Download patch
Index: ios/web_view/public/cwv_scroll_view.h
diff --git a/ios/web_view/public/cwv_scroll_view.h b/ios/web_view/public/cwv_scroll_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..50a3edce335b8e676a6cc5ad9687a9a919d8debe
--- /dev/null
+++ b/ios/web_view/public/cwv_scroll_view.h
@@ -0,0 +1,48 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_
+#define IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_
+
+#import <ChromeWebView/cwv_export.h>
+#import <CoreGraphics/CoreGraphics.h>
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@protocol CWVScrollViewDelegate;
+
+// Scroll view inside the web view. Has subset of methods of
+// UIScrollView. This is not a subclass of UIScrollView because
+// the underlying //ios/web API only exposes a proxy object of the scroll view,
+// not the raw UIScrollView.
+//
+// See the document of UIScrollView for the document of each
michaeldo 2017/05/01 18:49:53 Please re-wrap comments. Please replace "See the
Hiroshi Ichikawa 2017/05/08 06:52:41 Done.
+// method.
+//
+// TODO: Add nullability annotations.
michaeldo 2017/05/01 18:49:53 Please add a bug number and update TODO formatting
Hiroshi Ichikawa 2017/05/08 06:52:41 Done.
+CWV_EXPORT
+@interface CWVScrollView : NSObject
+
+@property(nonatomic, readonly) CGRect frame;
michaeldo 2017/05/01 18:49:53 Can you confirm that |frame| needs to be exposed?
Hiroshi Ichikawa 2017/05/08 06:52:41 Hm it may not be necessary. Let me remove it for n
+@property(nonatomic, readonly) CGRect bounds;
+@property(nonatomic) CGPoint contentOffset;
+@property(nonatomic, weak) id<CWVScrollViewDelegate> delegate;
+@property(nonatomic, readonly, getter=isDragging) BOOL dragging;
+- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer;
michaeldo 2017/05/01 18:49:53 Please move method after all properties.
Hiroshi Ichikawa 2017/05/08 06:52:41 Done.
+
+// KVO compliant.
+@property(nonatomic, readonly) CGSize contentSize;
+
+// Be careful when using this property. There's a bug with the
+// underlying WKWebView where the web view does not respect contentInsets
+// properly when laying out content and calculating innerHeight for Javascript.
+// Content is laid out based on the entire height of the web view rather than
+// the height between the top and bottom insets.
+// https://bugs.webkit.org/show_bug.cgi?id=134230
+// rdar://23584409 (not available on Open Radar)
+@property(nonatomic) UIEdgeInsets contentInset;
+
+@end
+
+#endif // IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698