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

Unified Diff: ios/web/web_state/ui/crw_web_view_content_view.mm

Issue 1689753002: Set CRWWebViewContentView's size before resetting scroll proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 10 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/web_state/ui/crw_web_view_content_view.mm
diff --git a/ios/web/web_state/ui/crw_web_view_content_view.mm b/ios/web/web_state/ui/crw_web_view_content_view.mm
index 73422618630f6f75a332696f4516d1c93a763fee..11a0844c1afee696bf2fb062713d2f2ca5a5475b 100644
--- a/ios/web/web_state/ui/crw_web_view_content_view.mm
+++ b/ios/web/web_state/ui/crw_web_view_content_view.mm
@@ -79,20 +79,23 @@ const CGFloat kBackgroundRGBComponents[] = {0.75f, 0.74f, 0.76f};
green:kBackgroundRGBComponents[1]
blue:kBackgroundRGBComponents[2]
alpha:1.0];
- // The frame needs to be set immediately after the web view is added
- // as a subview. The change in the frame triggers drawing operations and
- // if not done after it's added as a subview, the web view exhibits
- // strange behavior where clicks from certain web sites are not triggered.
- // The actual value of the frame doesn't matter as long as it's not
- // CGRectZero. The CRWWebViewContentView's frame will be reset to a correct
- // value in a subsequent layout pass.
- // TODO(crbug.com/577793): This is an undocumented and not-well-understood
- // workaround for this issue.
- const CGRect kDummyRect = CGRectMake(10, 20, 30, 50);
- self.frame = kDummyRect;
}
}
+- (void)setFrame:(CGRect)frame {
+ if (CGRectEqualToRect(self.frame, frame))
+ return;
+ [super setFrame:frame];
+ [self updateWebViewFrame];
+}
+
+- (void)setBounds:(CGRect)bounds {
+ if (CGRectEqualToRect(self.bounds, bounds))
+ return;
+ [super setBounds:bounds];
+ [self updateWebViewFrame];
+}
+
#pragma mark Accessors
- (UIScrollView*)scrollView {
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller_unittest.mm ('k') | ios/web/web_state/ui/crw_wk_web_view_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698