css - CSS3 background-size property causing extreme performance issues in ff5 -
i've been putting page today , thought i'd implement striped background using css3. seemed fine in browsers except firefox. (i'm using 5.01 checked in 5.0 too)
the code simple enough:
body { background-color: #ebeced; background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%,transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%,transparent 75%, transparent); background-size:6px 6px; }
works great in chrome , opera practically crashes ff.
obviously know can achieve effect repeating background image wondering if else had similar issue or teething problems css3 again ;)
testing in jsfiddle produces same issues, didn't make fiddle didn't want responsible crashing you!
oh , it's not slow pc issue, i'm on i7, 8gb ram, blah blah.
i believe problem background-size property if increase or remove entirely issue resolved, it's not suitable me unless can use background-size.
i pretty sure know problem is.
the performance problem not apparent me, on new quad-core. see when create blank page , put css in there, if resize browser, redraw little clunky.
the problem comes fact combining drawing css3 gradients tiling gradient @ small size (6px). means every 1000 sq.px of page real estate, gradient tile 27,777 times [1000/6 squared]. ton! smart browser draw gradient once , tile it. seems firefox may draw gradient every time. if case, indeed bug. if modify background size property larger, 20px no longer see performance problem, others will. if don't want users experiencing these kinds of problems, should stay away combination because slower computers still have problems when don't see any.
the easy fix not use css3 gradients. create image - browsers @ tiling those. images, better use larger images ...
early versions of netscape navigator used ignore backgrounds if smaller 40x40 pixels. remember discovering cause of bug trying solve, , realizing though seemed nice able use 1x20 image background because minimum file size, not best choice performance because creates more rendering work browser. instead, create larger 50x20 version of image. effect same, saves processing time.
Comments
Post a Comment