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

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 2442573003: Mac: Don't allow RenderWidgetHostViewCocoa to participate in autolayout. (Closed)
Patch Set: Ensure the fix is independent from the constraints violation (remove upstream) Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 5a1368d92f5c03a7beb97094210eefededd29a75..b1521f554aec3020804d917ca21a8bc22e3ac4c4 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -656,13 +656,20 @@ void WebContentsViewMac::CloseTab() {
webContents->UpdateWebContentsVisibility(viewVisible);
}
-// When the subviews require a layout, their size should be reset to the size
-// of this view. (It is possible for the size to get out of sync as an
-// optimization in preparation for an upcoming WebContentsView resize.
-// http://crbug.com/264207)
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
- for (NSView* subview in self.subviews)
- [subview setFrame:self.bounds];
+ // Subviews do not participate in auto layout unless the the size this view
+ // changes. This allows RenderWidgetHostViewMac::SetBounds(..) to select a
+ // size of the subview that differs from its superview in preparation for an
+ // upcoming WebContentsView resize.
+ // See http://crbug.com/264207 and http://crbug.com/655112.
+}
+
+- (void)setFrameSize:(NSSize)newSize {
+ [super setFrameSize:newSize];
+
+ // Perform manual layout of subviews, e.g., when the window size changes.
+ for (NSView* subview in [self subviews])
+ [subview setFrame:[self bounds]];
}
- (void)viewWillMoveToWindow:(NSWindow*)newWindow {
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698