Bug 201806

Summary: REGRESSION (r229419): Missing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: ScrollingAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, pvollan, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=183291
Attachments:
Description Flags
Patch v1 none

Description David Kilzer (:ddkilzer) 2019-09-15 11:10:54 PDT
Missing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:].

- (id)initWithScrollbar:(Scrollbar*)scrollbar featureToAnimate:(FeatureToAnimate)featureToAnimate animateFrom:(CGFloat)startValue animateTo:(CGFloat)endValue duration:(NSTimeInterval)duration
{
#if !ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
    self = [super initWithDuration:duration animationCurve:NSAnimationEaseInOut];
    if (!self)
        return nil;
#else
    // FIXME: Missing call to [self init] here!
    const NSTimeInterval timeInterval = 0.01;
    _timer = adoptNS([[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:0] interval:timeInterval target:self selector:@selector(setCurrentProgress:) userInfo:nil repeats:YES]);
    _duration = duration;
    _timingFunction = CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseInOut);
#endif

    [...]

    return self;
}

<https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm#L317>
Comment 1 Radar WebKit Bug Importer 2019-09-15 11:11:05 PDT
<rdar://problem/55380741>
Comment 2 David Kilzer (:ddkilzer) 2019-09-15 11:14:04 PDT
Created attachment 378817 [details]
Patch v1
Comment 3 David Kilzer (:ddkilzer) 2019-09-15 11:20:00 PDT
Comment on attachment 378817 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=378817&action=review

> Source/WebCore/platform/mac/ScrollAnimatorMac.mm:326
> +    self = [super init];
> +    if (!self)
> +        return nil;

Note that I chose to use plain old -init due to this class inheriting from NSObject:

#if !ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
@interface WebScrollbarPartAnimation : NSAnimation
#else
@interface WebScrollbarPartAnimation : NSObject
#endif
Comment 4 WebKit Commit Bot 2019-09-15 14:43:33 PDT
Comment on attachment 378817 [details]
Patch v1

Clearing flags on attachment: 378817

Committed r249887: <https://trac.webkit.org/changeset/249887>
Comment 5 WebKit Commit Bot 2019-09-15 14:43:35 PDT
All reviewed patches have been landed.  Closing bug.