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

Issue 2356113002: Mac: Hack around Sierra autolayout bug in the certificate viewer. (Closed)

Created:
4 years, 3 months ago by tapted
Modified:
4 years, 3 months ago
Reviewers:
Mark Mentovai
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Hack around Sierra autolayout bug in the certificate viewer. Currently on macOS 10.12 Sierra, invoking the OS-provided SSL certificate viewer used by Chrome will show a window sheet with an improperly constrained height. Tracing shows the autolayout algorithm going berserk - it gets invoked a few thousand times and decides that the NSScrollView containing the certificate details should be sized as though details are expanded, and doesn't add scrollbars. This usually results in an attached panel window much larger than the screen height, which is mostly unusable. This happens when linking to the 10.10 SDK, but not the 10.11 SDK, and only when running against Sierra's 10.12 SDK. To fix, append an override of -[NSWindow setFrame:display:animate] to the certificate viewer's class implementation using the Objective C runtime. This override prevents programmatic changes to the frame from setting a height more than 400 pixels. User-initiated resizes function as usual. BUG=643123 TEST=On macOS 10.12 Sierra, go to a secure site (e.g. https://www.google.com) and view the SSL certificate (click padlock, click Details, click View Certificate). It should fit within the screen area. On other OSX versions, there should be no change. Committed: https://crrev.com/027233cd43df4596af6b3ba501a15090f1284c05 Cr-Commit-Position: refs/heads/master@{#420038}

Patch Set 1 : All the other cruft I attempted #

Patch Set 2 : Prune it all back #

Patch Set 3 : cite bug #

Patch Set 4 : self nits #

Total comments: 2

Patch Set 5 : DCHECK class_addMethod result #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -0 lines) Patch
M chrome/browser/ui/certificate_viewer_mac.mm View 1 2 3 4 2 chunks +67 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (16 generated)
tapted
Hi Mark, please take a look.
4 years, 3 months ago (2016-09-21 09:09:18 UTC) #11
Mark Mentovai
LGTM. Super-hack. https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certificate_viewer_mac.mm File chrome/browser/ui/certificate_viewer_mac.mm (right): https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certificate_viewer_mac.mm#newcode72 chrome/browser/ui/certificate_viewer_mac.mm:72: class_addMethod([SFCertificatePanel class], kSetFrame, method, type_encoding); Check the ...
4 years, 3 months ago (2016-09-21 12:30:16 UTC) #14
tapted
Thanks Mark! https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certificate_viewer_mac.mm File chrome/browser/ui/certificate_viewer_mac.mm (right): https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certificate_viewer_mac.mm#newcode72 chrome/browser/ui/certificate_viewer_mac.mm:72: class_addMethod([SFCertificatePanel class], kSetFrame, method, type_encoding); On 2016/09/21 ...
4 years, 3 months ago (2016-09-21 13:07:04 UTC) #15
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/2356113002/80001
4 years, 3 months ago (2016-09-21 13:07:56 UTC) #18
Mark Mentovai
LGTM
4 years, 3 months ago (2016-09-21 13:08:03 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-09-21 13:43:50 UTC) #21
commit-bot: I haz the power
4 years, 3 months ago (2016-09-21 13:45:51 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/027233cd43df4596af6b3ba501a15090f1284c05
Cr-Commit-Position: refs/heads/master@{#420038}

Powered by Google App Engine
This is Rietveld 408576698