Skip to content

The .sr-only utility class causes browser repaints in overflowing divs #24906

Closed

Description

@bbthorntz

After much research to removing scroll lag from our app, I discovered that elements with the .sr-only class cause repaints when scrolling in overflowing divs.

Browser: Chrome
Operating System: Mac OSX Sierra

Please see the reduced test case here:
https://codepen.io/bbthorntz/pen/pdxLzd

In Chrome, with 'Inspector -> Rendering -> Paint Flashing' enabled, you can see that the presence of the element with the .sr-only class causes paint flashing. If you remove this element, the paint flashing stops.

Removing the clip-path property from the class appears to fix the issue.

I have yet to test whether this affects other browsers/operating systems.

Activity

  1. added
    css
    v4
    on Nov 29, 2017
  2. gstreetmedia commented on Dec 2, 2017

    @gstreetmedia

    I can confirm that this causes the same issue on Windows & Android Chrome. Android has probably the biggest impact as it makes scrolling almost unusable.

  3. XhmikosR commented on Dec 30, 2017

    @XhmikosR
    Member

    @mdo: thoughts how to proceed?

    Also, has anyone filed a bug report in Chromium?

  4. mdo commented on Dec 31, 2017

    @mdo
    Member

    @XhmikosR Updating the class to remove the clip-path is probably best way forward. Chrome bug would be great, too.

  5. XhmikosR commented on Jan 3, 2018

    @XhmikosR
    Member

    @mdo: do you think you could have this sorted for the stable?

    I'm not familiar with the current clip-path approach, so I don't know if just removing it is good.

  6. added
    has-pr
    on Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    csshas-prv4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions