views:

2278

answers:

7

My question is simple, why do elements with the CSS "position: fixed" applied to them cause Firefox to eat 100% CPU when scrolling the page they are in? And are there any workarounds?

I've noticed this behaviour on a few sites, for example the notification bar at the top of the page on stackoverflow. I'm using Linux in case that matters.

A: 

Do you have an example page up? I'd be happy to try it out in Windows and OS X.

JMack
A: 

Are you sure that there's a direct link here? Have you created a static HTML page with fixed elements to verify your theory? Given how widely these CSS properties are used, I'd think someone else would have noticed it by now, whatever browser/OS you're running.

Gilles
+5  A: 

This is bug #201307.

Jim
A: 

This website has a fixed element "First time at Stack Overflow? Check out the FAQ!", and it's slow as hell in firefox. Works better with Opera and Chrome though. FF3, Windows XP, ATI.

+3  A: 

It's a bug reported in bugzilla

Apparently a work-around (with mixed reports of success..) is to disable smooth-scrolling

Just disable smooth scrolling in Edit > Preferences > Advanced.

ConroyP
A: 

it eats CPU because the browser has to repaint the entire viewport every scroll change rather than just the newly visible area

rpetrich
A: 

As already stated, this is bug #201307. The workaround is to disable smooth scrolling:

Edit -> Prefrences -> Advanced -> General tab -> uncheck "Use smooth scrolling"