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

Issue 2442573003: Mac: Don't allow RenderWidgetHostViewCocoa to participate in autolayout. (Closed)

Created:
4 years, 2 months ago by tapted
Modified:
4 years, 1 month ago
CC:
chromium-reviews, jam, darin-cc_chromium.org, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/ba268401a975c321f1e15ae3a4776fd3c60e268e Cr-Commit-Position: refs/heads/master@{#427290}

Patch Set 1 #

Patch Set 2 : Ensure the fix is independent from the constraints violation (remove upstream) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -13 lines) Patch
M chrome/browser/ui/browser_browsertest.cc View 1 chunk +1 line, -7 lines 0 comments Download
M content/browser/web_contents/web_contents_view_mac.mm View 1 chunk +13 lines, -6 lines 0 comments Download

Messages

Total messages: 25 (16 generated)
tapted
http://i.giphy.com/oDDDWKDfDMfRu.gif
4 years, 2 months ago (2016-10-21 04:24:48 UTC) #12
Avi (use Gerrit)
On 2016/10/21 04:24:48, tapted wrote: > http://i.giphy.com/oDDDWKDfDMfRu.gif Oh boy. Good luck. LGTM
4 years, 2 months ago (2016-10-21 13:04:12 UTC) #13
erikchen
Your comments make heavy use of the team "autolayout". Are we actually participating in AppKit ...
4 years, 2 months ago (2016-10-21 16:15:21 UTC) #14
tapted
On 2016/10/21 16:15:21, erikchen wrote: > Your comments make heavy use of the team "autolayout". ...
4 years, 2 months ago (2016-10-24 00:03:44 UTC) #15
erikchen
The fact that we're not setting translatesAutoresizingMaskIntoConstraints to NO is pretty terrifying. The behavior of ...
4 years, 1 month ago (2016-10-24 17:21:29 UTC) #16
tapted
+sky TBR for (chrome/browser/ui - just re-enabling BrowserTest.GetSizeForNewRenderView on Mac). Thanks all!
4 years, 1 month ago (2016-10-25 06:03:03 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2442573003/20001
4 years, 1 month ago (2016-10-25 06:03:17 UTC) #21
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-10-25 06:41:51 UTC) #23
commit-bot: I haz the power
4 years, 1 month ago (2016-10-25 06:44:43 UTC) #25
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/ba268401a975c321f1e15ae3a4776fd3c60e268e
Cr-Commit-Position: refs/heads/master@{#427290}

Powered by Google App Engine
This is Rietveld 408576698