Bug 170986 - Avoid repaints for invisible animations on tumblr.com/search/aww
Summary: Avoid repaints for invisible animations on tumblr.com/search/aww
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-19 03:57 PDT by Antti Koivisto
Modified: 2017-04-20 11:41 PDT (History)
5 users (show)

See Also:


Attachments
patch (3.98 KB, patch)
2017-04-19 04:05 PDT, Antti Koivisto
akling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.