Bug 170986

Summary: Avoid repaints for invisible animations on tumblr.com/search/aww
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, darin, kling, simon.fraser, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch kling: review+

Description Antti Koivisto 2017-04-19 03:57:10 PDT
There is an invisible CSS animation here that is triggering unnecessary repaints.
Comment 1 Antti Koivisto 2017-04-19 03:57:26 PDT
<rdar://problem/28644580>
Comment 2 Antti Koivisto 2017-04-19 04:05:15 PDT
Created attachment 307475 [details]
patch
Comment 3 Antti Koivisto 2017-04-19 05:18:19 PDT
https://trac.webkit.org/r215507
Comment 4 Darin Adler 2017-04-20 10:44:11 PDT
Comment on attachment 307475 [details]
patch

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

> Source/WebCore/rendering/style/RenderStyle.cpp:852
> +    if (style.visibility() == HIDDEN)
> +        return false;
> +    if (!style.opacity())
> +        return false;
> +    return true;

Not at all critical but I would have liked writing it like this:

    return style.visibility() != HIDDEN && style.opacity();

And probably explicitly specified inline too.
Comment 5 Antti Koivisto 2017-04-20 11:41:26 PDT
> Not at all critical but I would have liked writing it like this:

That approach turns incomprehensible when additional and more complex conditions are added (we have plenty of examples). Granted, two conditions is not there yet.