Mac: Don't allow RenderWidgetHostViewCocoa to participate in autolayout.
WebContentsViewCocoa has a hook to resize all subviews to match its size. The problem is that the size of a RenderWidgetHostViewCocoa is allowed to get out of sync with its superview while waiting for a WebContents paint to be committed. If an autolayout is triggered while waiting for that commit, the WebContents thinks it's been resized and spawns a new paint. Since r424609, for 10.11+, Chrome stopped replacing the NSThemeFrame (which AppKit does not support) and instead started using NSFullSizeContentViewWindowMask. This seems to opt the window into additional autolayout triggers, coming from CoreAnimation. This can engage the code to "re-sync" the sizes of the RenderWidgetHostViewCocoa and WebContentsViewCocoa when it wasn't done previously. To fix, "re-sync" sizes in an override of -setFrameSize: rather than -resizeSubviewsWithOldSize:. This ensures a re-sync only occurs when the size of the WebContentsViewCocoa changes. BUG=655112, 655665, 264207 TBR=sky@chromium.org Review-Url: https://codereview.chromium.org/2442573003 Cr-Commit-Position: refs/heads/master@{#427290}
Showing
Please register or sign in to comment