Bug 186076 - -[WKFullscreenStackView updateConstraints] doesn't handle secondaryMaterialOverlayView or secondaryMaterialOverlayViewConstraints consistently
Summary: -[WKFullscreenStackView updateConstraints] doesn't handle secondaryMaterialOv...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-29 17:38 PDT by David Kilzer (:ddkilzer)
Modified: 2018-05-29 17:39 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2018-05-29 17:38:54 PDT
While investigating Bug 185887, I found some issues in Source/WebKit/UIProcess/ios/fullscreen/WKFullscreenStackView.mm (in no particular order):

- The WKFullscreenStackView.secondaryMaterialOverlayViewConstraints instance variable is only ever set, and never read, and the constraints are recomputed every time -[WKFullscreenStackView updateConstraints] is called.  If it's never used outside of -updateConstraints, the instance variable can probably be removed.

- The WKFullscreenStackView.secondaryMaterialOverlayView instance variable is `assign`, but references a UIVisualEffectView object which can be deallocated.  This instance variable is set in -[WKFullscreenStackView updateConstraints], but only appears to be referenced again to remove it from its superview (the WKFullscreenStackView instance), after which the instance variable may point to a deallocated object.  (Since it's never used again, this doesn't seem to be a security issue.)  It seems like WKFullscreenStackView.secondaryMaterialOverlayView should probably be `retain`.

- Also, when WKFullscreenStackView.secondaryMaterialOverlayView is removed from its superview in -[WKFullscreenStackView updateConstraints], I'm not sure how it will ever be used again.

- Clean up inconsistent use of legacy/modern setter syntax and ivar/property access.
Comment 1 Radar WebKit Bug Importer 2018-05-29 17:39:16 PDT
<rdar://problem/40635638>