|
|
Chromium Code Reviews|
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. |
DescriptionMac: 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 #Messages
Total messages: 23 (16 generated)
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by tapted@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Mac: Hack around Sierra autolayout bug in the certificate viewer BUG=643123 ========== to ========== 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. ==========
tapted@chromium.org changed reviewers: + mark@chromium.org
Hi Mark, please take a look.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
LGTM. Super-hack. https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certi... File chrome/browser/ui/certificate_viewer_mac.mm (right): https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certi... chrome/browser/ui/certificate_viewer_mac.mm:72: class_addMethod([SFCertificatePanel class], kSetFrame, method, type_encoding); Check the return value, at least via a DCHECK. This call will fail if SFCertificatePanel already has an implementation of this selector. Apple might even add it.
Thanks Mark! https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certi... File chrome/browser/ui/certificate_viewer_mac.mm (right): https://codereview.chromium.org/2356113002/diff/60001/chrome/browser/ui/certi... chrome/browser/ui/certificate_viewer_mac.mm:72: class_addMethod([SFCertificatePanel class], kSetFrame, method, type_encoding); On 2016/09/21 12:30:16, Mark Mentovai wrote: > Check the return value, at least via a DCHECK. This call will fail if > SFCertificatePanel already has an implementation of this selector. Apple might > even add it. Done.
The CQ bit was checked by tapted@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mark@chromium.org Link to the patchset: https://codereview.chromium.org/2356113002/#ps80001 (title: "DCHECK class_addMethod result")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
LGTM
Message was sent while issue was closed.
Description was changed from ========== 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. ========== to ========== 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. ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== 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. ========== to ========== 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} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/027233cd43df4596af6b3ba501a15090f1284c05 Cr-Commit-Position: refs/heads/master@{#420038} |
