Bug 175423 - Scroll performance is impacted when having a fixed background followed by other backgrounds.
Summary: Scroll performance is impacted when having a fixed background followed by oth...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-10 03:18 PDT by Kaede Hoshikawa
Modified: 2022-07-15 14:22 PDT (History)
4 users (show)

See Also:


Attachments
Testcase (468 bytes, text/html)
2017-08-10 16:09 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kaede Hoshikawa 2017-08-10 03:18:59 PDT
The frame rate of the following page drops significantly when scrolling.

> <html>
>   <head>
>     <style>
>     body {
>       background: url(background.jpg) fixed, #eee;
>       height: 10000px;  /* to make the page scrollable. */
>     }
>     .boxes {
>       border: 1px solid #000;
>       height: 200px;
>       width: 200px;
>       filter: drop-shadow(0 50px 50px #ddd);
>     }
>     </style>
>   </head>
>   <body>
>     <div class="boxes"></div>
>     <div class="boxes"></div>
>     <div class="boxes"></div>
>   </body>
> </html>

Two possible workarounds are either remove the filter from the boxes class or remove the second background from the body.

The web inspector shows that it takes WebKit a long time on compositing and painting.

The same page tested under Firefox 56.0b1 rendered with no problem when scrolling.
Comment 1 Simon Fraser (smfr) 2017-08-10 16:09:21 PDT
Created attachment 317868 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2017-08-10 16:09:43 PDT
will-change:filter on the boxes will fix this, but we should avoid repainting the body when scrolling in this case.
Comment 3 Brent Fulgham 2022-07-15 14:22:24 PDT
Importing bug for tracking.
Comment 4 Radar WebKit Bug Importer 2022-07-15 14:22:35 PDT
<rdar://problem/97094174>