OLD | NEW |
---|---|
(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 #ifndef IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_ | |
6 #define IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_ | |
7 | |
8 #import <ChromeWebView/cwv_export.h> | |
9 #import <CoreGraphics/CoreGraphics.h> | |
10 #import <Foundation/Foundation.h> | |
11 #import <UIKit/UIKit.h> | |
12 | |
13 @protocol CWVScrollViewDelegate; | |
14 | |
15 // Scroll view inside the web view. Has subset of methods of | |
16 // UIScrollView. This is not a subclass of UIScrollView because | |
17 // the underlying //ios/web API only exposes a proxy object of the scroll view, | |
18 // not the raw UIScrollView. | |
19 // | |
20 // 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.
| |
21 // method. | |
22 // | |
23 // 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.
| |
24 CWV_EXPORT | |
25 @interface CWVScrollView : NSObject | |
26 | |
27 @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
| |
28 @property(nonatomic, readonly) CGRect bounds; | |
29 @property(nonatomic) CGPoint contentOffset; | |
30 @property(nonatomic, weak) id<CWVScrollViewDelegate> delegate; | |
31 @property(nonatomic, readonly, getter=isDragging) BOOL dragging; | |
32 - (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.
| |
33 | |
34 // KVO compliant. | |
35 @property(nonatomic, readonly) CGSize contentSize; | |
36 | |
37 // Be careful when using this property. There's a bug with the | |
38 // underlying WKWebView where the web view does not respect contentInsets | |
39 // properly when laying out content and calculating innerHeight for Javascript. | |
40 // Content is laid out based on the entire height of the web view rather than | |
41 // the height between the top and bottom insets. | |
42 // https://bugs.webkit.org/show_bug.cgi?id=134230 | |
43 // rdar://23584409 (not available on Open Radar) | |
44 @property(nonatomic) UIEdgeInsets contentInset; | |
45 | |
46 @end | |
47 | |
48 #endif // IOS_WEB_VIEW_PUBLIC_CWV_SCROLL_VIEW_H_ | |
OLD | NEW |