New issue
Advanced search Search tips

Issue 918360 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Devtools is slowing down to a halt when making use of CSS variables

Reported by j.veen...@gmail.com, Dec 31

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36

Steps to reproduce the problem:
1. Define a couple of CSS variables in :root and change them within media queries. (e.g. https://github.com/garage11/ca11/blob/develop/src/scss/ca11/lib/variables.scss)
2. Start a fresh browser; everything is still responsive
3. Start inspecting elements, changing the devtools width/responsive view width, reloading stylesheets using livereload.

What is the expected behavior?
Performance of the web application is consistent. It should be  slow from the start because of too much specificity, or performan

What went wrong?
Massive repaint operations, inheritance view shows a long list of :root {} inherited variables. List length seems to increase in time.

Did this work before? N/A 

Chrome version: 71.0.3578.80  Channel: stable
OS Version: 
Flash Version: 

I am not sure if this is a bug, but couldn't find anything related to these particular performance issues.
 
Labels: Needs-Triage-M71
Cc: santhoshkumar@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

@Reporter: Could you please share a sample test file/URL  which helps us to triage this further in a better way.
Owner: einbinder@chromium.org
Status: Assigned (was: Unconfirmed)
Hi,

Thank you for looking into this! I'm not sure if it's just me abusing CSS variables or if it's something else. The title for this issue is not entirely accurate; devtools is still responding, although it becomes really slow. I've put up a preliminary version of the PWA i'm working on: https://ca11.io/ 

This hopefully reproduces it. The app has all variables in the :root scope, so they can serve as a replacement to a multitude of media queries I had sprinkled around.
Just start a session (any username/password) and inspect elements, reload the page, resize devtools. At some point, my laptop is about to take off and the whole process is slowing down. With just the console opened, the browser remains very responsive. Let me know if you need more information. 
It looks like you have about 100 rules each with 15 or so properties. The styles sidebar isn't prepared to handle more than a few hundred properties without lagging. In theory we can do some fanciness in the styles sidebar to hide some rules when there are too many, or hide rules when they scroll out of view. But that isn't a trivial change.

Looking at https://ca11.io/css/app.css , it appears that the duplicated rules are in your source. Each media query appears 37 times. Something wonky appears to be going in your build step.
Oops, that explains it indeed. Sorry about that. I totally failed to make the link with the css output. Mea Culpa :)

Before, the variables sass file only included sass variables. Including this variables file in other Sass files didn't impact the css output. This changed, when I started defining css variables in the same file. 

Sign in to add a comment