[webkit-reviews] review granted: [Bug 208356] updateCSSTransitionsForElementAndProperty should clone RenderStyles : [Attachment 391944] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 28 01:10:16 PST 2020


Antti Koivisto <koivisto at iki.fi> has granted Dean Jackson <dino at apple.com>'s
request for review:
Bug 208356: updateCSSTransitionsForElementAndProperty should clone RenderStyles
https://bugs.webkit.org/show_bug.cgi?id=208356

Attachment 391944: Patch

https://bugs.webkit.org/attachment.cgi?id=391944&action=review




--- Comment #5 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 391944
  --> https://bugs.webkit.org/attachment.cgi?id=391944
Patch

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

>>> Source/WebCore/animation/AnimationTimeline.cpp:462
>>> +	 auto beforeChangeStyle = [&]() -> RenderStyle {
>> 
>> Why not return Ref<RenderStyle>?
> 
> RenderStyle isn't a Ref counted object, right?

Probably don't need to specify the return type explicitly, that is [&] { should
be sufficient.

>> Source/WebCore/animation/AnimationTimeline.cpp:482
>> +		    return RenderStyle::clone(*unanimatedStyle);
> 
> That way, we don't have to make a clone here.

RenderStyle is an internally refcounted copy-on-write type. Cloning it is ok.


More information about the webkit-reviews mailing list